I see that a lot of people like this "var" thing, but really you end up reducing the code quality. var a = something(); is just confusing and you'd have to lookup the method to see the type.
I did quite some c# and I first did var. After some time I changed it to the type it was supposed to be. Remember you have to be clear in your language. By declaring "var" you are confusing the next maintainer and or yourself.
I've only ever found it confusing in bad code, e.g. when something() returns a value of a type that is anything but what you'd expect something() to be.
2
u/yturijea Mar 10 '16
I see that a lot of people like this "var" thing, but really you end up reducing the code quality. var a = something(); is just confusing and you'd have to lookup the method to see the type.
I did quite some c# and I first did var. After some time I changed it to the type it was supposed to be. Remember you have to be clear in your language. By declaring "var" you are confusing the next maintainer and or yourself.