Monday, October 23, 2006

C# 3.0 will rock - but hard to read?

Take a look at this example of Lambda expressions in c# 3.0

The power if the new LINQ style syntax for things like lists is obvious. For example the following:

var q = from i in list where i > 10 & i <20 select i;


That is going to be great for productivity. That is without question. But going back a few weeks or months later to revisit you code, well that's I think will be different. Usually with code (mine anyway) you can get a pretty good idea what is going on by skimming. With the example above, you really need to read the line start to finish to get a good understanding what is happening.
I hope as I/We get used to LINQ style syntax it will become easier to skim read.

No comments: