Following various diggdot.us links, I was amused by this post about new language features in C# 3.0.
First of all, I'm amused that people continually get more excited about language feature creep than better libraries using the language. It's always "bolt some more syntax on."
The first thing to get excited about it is the "i don't know what my variable type is/i'm too lazy to type the var type" feature. If you declare a variable and assign it a type that the compiler can figure out because you put the literal expression right after that, you can use var. Apparently it's a whole lot easier than "string". And "int". Ergonomic studies probably show that the 3 character sequence var is easier to type than int. The comments rant back and forth about this "feature." My favorite example is this one:
for (var i = 0; i < 2147483648; i++)
You don't have to know that you could/should use an int64 instead of an int32. Wow. My excitement bubbleth over. I wonder if it deals with:
for (var i = 0; i < 2147483647; i+=3)
The interested student can figure out what's going to go wrong with that if it get's excited and uses int32 there. So, I think this var thing is pretty overrated basically. I'm of course not used to declaring types at all. Why can't the compiler just be smart enough to "assume" the "var" when I don't put anything there? Of course, you can only use this var thing in certain situations. If the compiler can't figure it out for you, you have to figure it out for you. Why don't people see where this kind of inconsistency just adds more confusion than it might offset.
Object initializers are another new and nifty feature. Basically put the class name, followed by a paren list of varname/value pairs and you get an object with that. The Smalltalk code to do that without extending the language is:
Object class>>properties: aDictionary
| result |
result := self basicNew.
aDictionary keysAndValuesDo: [:key :value |
result instVarAt: (self instVarIndexFor: key) put: value].
^result
Variations that use arrays and or optionally send messages ad nauseum. It's all in the messages. No new language feature necessary.
Anonymous types are next. Apparently, they're missing ad hoc structure defs. What to say. I'm sorry. This kind of stuff just isn't a big deal for us. I could make a proxy object that would do something like what it does. Again, it's all in the objects and messages. No syntax necessary.
And finally extension methods. Now this is a handy language feature. One of these was worthwhile. It should have been in version 0.0 of the language spec. Of course, Smalltalk and Objective-C have both been doing this for a while. So it's just more catchup.