Monthly Archives: May 2011

On partitionning .NET code

A few months ago I published two articles on SimpleTalk on how to partition .NET code, first with assemblies, second with namespaces inside assemblies. I repackaged this content in two white books available in the NDepend documentation. Partitioning .NET code … Continue reading 

Posted in Uncategorized | 17 Comments

Book review : C# in Depth Second Edition

Exactly 3 years ago I praised C# in Depth First Edition authored by Jon Skeet. Today, after several months owning and reading the second edition, I am even more enthusiast about this book! If you know Jon’s blog, you certainly … Continue reading 

Posted in Uncategorized | 4 Comments

Workaround for: Cannot assign lambda expression to a range variable

I stumbled recently on a LINQ limitation. This piece of code cannot compile (even R# doesn’t detect any error) : using System; using System.Linq; class Program {    static void Main(string[] args) {       var query = from i in new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }                   let fct = (int x) => (x - 5) * (x - 5)                   where fct(i) > fct(i - 1)                   select i;       foreach (var i in query) { Console.WriteLine(i); }    } } The C# compiler error, provoked by fct, is actually … Continue reading 

Posted in Uncategorized | 10 Comments

Back to basics: Usage of static members

Using the static keyword should be considered as an unnatural design act in a OOP world. The problem is that developers get punished for using static fields and methods, months or years after having creating them. And indeed, reasons why … Continue reading 

Posted in Uncategorized | 15 Comments