This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: Learning from agile languages
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
It was interesting to chat with Anders Hejlsberg about C# at the whiteboard cabana session at TechEd.
He talked about the fact that we should be learning from the (now so-called) agile languages such as Ruby/Python/Groovy...
He thought that there has definitely been a lot to learn and gave a simple example:
Currently, the following is really ugly to do in our languages:
Dictionary x = new Dictionary();
It is so verbose. Anders suggested having the compiler be smart and use defaults. So the former would become:
var x = new Dictionary();
And x would default to be the right thing. Saves a bit on typing, but when you code to interfaces more and more, it doesn't really help.
E.g. you would still need:
Map m = new HashMap();
He also mentioned changing the configuration/initiation of objects to go from:
Point p = new Point();
p.x = 5;
p.y = 10;
to:
Point p = new Point { x = 5, y = 10 };
I personally prefer params in methods/constructors so you could just do:
Point p = new Point(x = 5, y = 10);
Good news that people are looking at the other languages to clean new information at least!