Posted on : 13-11-2008 | By : Utkarsh Shigihalli | In : .net, c#, programming
0
The singleton pattern ensures a class has only one instance, and provide a global point of access to it.
There is a nice article about choosing between Singleton pattern and the static class here with examples.
Posted on : 06-11-2008 | By : Utkarsh Shigihalli | In : .net, c#, programming
0
Pedram Rezaei has written how we can let .NET debugger know, not to step in to certain elements of your program with the help of DebuggerStepThroughAttribute.
Read it here
Posted on : 09-06-2008 | By : Utkarsh Shigihalli | In : .net, c#, development
0
Recently, one of my friend digged in to metadata of TypeCode enum type and found out that, it does not have value 17 in it.
Even I was surprised to see this, and wanted to know the reason behind value 17 missing from the enumeration.
I googled and found a link to blog which explains, why the value 17 has been missed from the enum.
From the author:
We’ve had this “hole” in the TypeCode enum since October of 2000, and I can’t find an older set of bits. But, I’m sure that comment in IConvertible is right – this used to be TimeSpan. For TimeSpan, it’s possible we thought it would be interesting for a while, then we realized that frankly not that many people need to convert a Decimal to a TimeSpan, then removed it.
You might ask why we didn’t “fix” the enum when we removed whichever of these values we had originally added. It turns out that whenever we have a breaking change internally, we need to recompile all the code that might possibly depend on the removed or changed public surface area. For us, that would mean rebuilding everything that might have referred to TypeCode.String, whose value would have changed from 18 to 17. While we do go through that process internally in DevDiv, it is costly & painful for us.