27.aug I attended MSDN Live in Oslo. Although mainly a java and open source developer, I’ve worked with ASP.NET 2.0. I used Visual Studio 2005 and web parts, so I do have, if not a leg, at least a few toes in the .Net world as well.
There are some very good things coming with .Net 3.5 and C# 3.0. And the Linq is amongst the best. The introduction of SQL-like syntax in the OO-language first made me sick, but really it’s quite ingeniously the more I think about it. My objective as a programmer is to write easily read, maintainable, and testable code. Now I’m ashamed of my first reaction. Ashamed.
Try writing the following code object-oriented!
IEnumerable<MyClass> result =
from myClass in collection1
where property1 > criteria1
orderby property2 descending
Probably looks messy if you are unfamiliar with writing with such a syntax. But if you reflect on the alternative, you’d have to use collections, comparators, ifs, loops and temporary containers. This is beautiful!
Linq is also a persistence API, which looks great as well, but that’s beyond what I wanted to emphasize here.
Scott Guthrie has written a lot about Linq to Sql. Read his blog for in deep examples and exploit the possibilities!