Changing order of enum values in C# breaks binary compatibility badly
Suppose I have a public interface that uses this enum: public enum LogLevel // v1 { Info, Warning, Error, Debug } There is a problem with this enum: the values […]
Suppose I have a public interface that uses this enum: public enum LogLevel // v1 { Info, Warning, Error, Debug } There is a problem with this enum: the values […]
Numerous books and articles explain the difference between public const string Foo = “foo”; and public static readonly string Foo = “foo”; The former is treated as true constant that […]
As I discovered that the source IEnumerable is called by PLINQ from multiple threads, it made me thinking: how can it possibly work? E.g. when someone writes code like this: […]
I am trying to play with PLINQ, and I was wondering, if I have an enumerable that, say, reads lines from a file, or stock prices off Yahoo Finance, would […]
Namespaces are a great way to organize code. However, I recently found out that even putting your classes in a carefully organized namespace hierarchy will not shield you from name […]
In C# code you can write something like decimal d = 1e-10m; However, decimal.Parse(“1e-10”) throws an exception: “System.FormatException: Input string was not in a correct format”. Not cool.
Time and time again I am burnt by the same bug. There are two kinds of enumerables in .NET: enumerators and generators. Enumerators go over some collection and return its […]
typeof(decimal).IsPrimitive returns false. Apparently,
Posted a larger and more structured article on the (somewhat surprising) capture rules for outer variables inside C# lambdas. http://www.ikriv.com/en/prog/info/dotnet/Lambdas.html
I had an interesting bug the other day. I wrote a foreach loop along these lines: foreach (var entry in controlsByName) { entry.Key.SomeEvent += (sender,args)=>{ProcessControlName(entry.Value);} } Looks innocent enough, […]