Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
CTRL + E, CTRL + D
automatically resolves any var keywords in my code to what they should be.
That way I can be lazy and have proper code! -
I think using var in C#, the new Java versions and so on makes total sense. Why would you want to write
ArrayList<Type> list = new ArrayList<Type>()
... instead of
var list = new ArrayList<Type>()
With var it is way more readable imo. -
@Haxk20 Yeah your right, let's just pollute the code with half a trillion redundant type declarations like this:
Dictionary<KeyValuePair<string, int>, List<Func<User, bool>>>
Instead of just using var. Real bright idea.
Or for example why would you use:
List<int> someList = new List<int>()
Instead of
var someList = new List<int>()
It's so much more readable. -
matste6416yI like watching Java developers being against this simple improvement. So many Aspergers and Stokholm syndrome victims.
You know what? It’s actually hard to find a modern, statically typed, oo language which doesn’t have variable type inference. Even C++ introduced it in c++11. -
@Haxk20 I know where you come from, when I say a first intro to var I too was like "Yeah I'm not gonna use that". But now I can't live without it:)
-
Update to what my comment says:
I now use var on instantiated things like List<T>, as it says
var list = new List<string>();
anyway already.
Related Rants
var does not mean dynamic
rant
misconceptions
triggered
not everything is javascript
c#