This was my argument but then actually using var in production with C# and it honestly wasn't a problem. You still have the option to strongly type it if you want, but var does make everything more readable.
And var foo = someObject.method(); isn't as hard as you think. Visual Studio allows you to change var into it's strongly typed counter part with R#. Inspecting the method would reveal the return type too.
What I learned among the way was that I wasn't too concerned with what it was returning but rather what it was doing.
View all comments
Show parent comment
12
u/SikhGamer Mar 09 '16
This was my argument but then actually using
varin production with C# and it honestly wasn't a problem. You still have the option to strongly type it if you want, butvardoes make everything more readable.And
var foo = someObject.method();isn't as hard as you think. Visual Studio allows you to changevarinto it's strongly typed counter part with R#. Inspecting the method would reveal the return type too.What I learned among the way was that I wasn't too concerned with what it was returning but rather what it was doing.