Managers Disease Keeping in sync with Eclipse. What a mare.
Jun 07

Learning from agile languages

Tech Add comments

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!

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: Type in the word 'ajax'