Always check the most obvious things first

I spent a while or so on this 'issue' I had. Basically it's not even an issue, it's an expected behavior (if you now what the expected behavior should be). I was using a Guid class to create a new guid in a project which would be used later in the application (guid is passed on to another part of the system). Here's the code I had:

 Guid myGuid = new Guid();

Everything worked fine, no errors, no exceptions, nothing. If you check 'myGuid' you would see that the guid is indeed assigned to the variable. But the problem is that the guid is empty (e.g. {000...000}). Instead of spending time on researching what else could went wrong, I didn't even think about that line. Once I changed the above line to: Guid myGuid = Guid.NewGuid () - everything was working fine.

I guess the 'lesson' is - check the most obvious things first - I usually tend to skip over the obvious stuff because 'I know that's right' and 'It can't be that simple'. Well, looks like sometimes it is :)