c# 3.0 goodness


While checking planet mono, I ran upon a posting about the C# 3.0 spec. While C# 2.0 hasn't been released yet, I still think it's fair to look into the future of the language. Frankly, it looks to be a pretty good future. While playing with ruby, I've found that mixins (extensions in C#3) and lambda functions are very useful. It is amazing to see how concise and neat code becomes with the addition of those two treats. Mixins are just great, they allow you to add functionality without adding hierarchy which generally means that there will be less crufty krap floating around your code pool. Lambda functions are similar to any household tool, a lot of good or bad can come of them.

As a side note, I dislike the usage of conditional expressions using the ternary operator found in some languages. For example: printf("I have %d apple%s\n", apples, (apples == 1) ? "" : "s"); That snippet does not bring about a warm fuzzy feeling. Now just imagine a chain of those in your code, possibly in a call to a method. Just say no.