But if a method has to return an explicit type, isn't 'var''s usage
pretty limited?
Yep. AFAIK it's really only needed for inline construction of
anonymous types. The rest is mere convenience.
Isn't it so that 'var foo = ...' is only used by the lazy bunch who
don't want to spend 2 seconds longer typing to make the code more
readable?
See, the thing is that people like me think the var version is _more_
readable, not less so. You seem to think that code always gets more
readable as it gets longer. I think that the most readable code is
the _shortest_ code that still conveys the intended meaning.
C# is C#, it's not Miranda, it's not prolog, it's not VB.NET and it's
not Ruby. It's C#. If people want functional programming, or dynamic
typing, use a different language.
Well, that's just a ridiculous statement. C# started out as a Java
clone with some C features, and its design philosophy was always
similar to Python: if a feature is useful, adopt it! C# is not a
single-minded reseach language that must be kept "pure".
You might as well say "if people want OOP they should use Smalltalk"
as an argument to keep OOP out of all existing procedural languages.
And you could have made the same complaint when generics were
introduced: "If people want generics they should use C++"!
Functional programming is just as valid as the two other paradigms,
procedural and object-oriented programming. It's just another tool in
a toolbox. The fact that FP used to be limited to research languages
is a historical coincidence, not some holy law of design.
Also, C# 3.0 does not have dynamic typing, just inferred typing, which
is merely a variant of static typing, and one that's widely accepted
as an improvement (C++ will add the auto keyword which is similar to
var). There is such a thing as technical progress...