When you have to iterate a reader where the number of items to read is unknown, and the only way to do is it to keep reading until you hit the end. This is often the place you need an endless loop. ...
Every now and then when I have a complex lambda, I do something like this: Func<SomeObject, bool> equals = o => o.ID == someID && o.Name == someName && IsAdd || ... var ...
In C#, using statement is used to dispose in a deterministic manner the resources without waiting for garbage collector. For example, it may be used to: Dispose SQL commands or connections, Close ...
I have several situations where I need to control timeouts in a technical application. Either in a loop or as a simple check. Of course – handling this is really easy, but none of these is looking ...
As C# has progressed, many language features have been added. It has come to the point where it's becoming unreadable for me. As an example, consider the following code snip from Caliburn.Micro code ...
How far should 'var' and null coalescing operator '??' be entertained without hampering readability?
I know the title of the question is very subjective, but I was confronted with usage of ?? operator by my peers, where at the same time I was not very happy/comfortable with applying var in new ...
As noted by the title, is nesting types (e.g. enumerated types or structures in a class) considered bad practice or not? When you run Code Analysis in Visual Studio it returns the following message ...