Peter Goodman bio photo

Peter Goodman

A developer living in Auckland building software using all sorts of bits and pieces I find along the way. Originally from Northern Ireland.

Twitter Google+ LinkedIn Github

There are many heated discussions on the overuse of var and I'm not going to repeat the arguments here. Personally, I have no problem with var used in the declaration of a variable where the value is instantiated inline via a constructor, anything else (apart from LINQ) seems dangerous. Having said that, the following sample I came across today is simply stupid.

var controller = new MyController().GetValueX(foo);