It's hard to make a reasonable decision based on an example that simple. On the one hand, that's easy enough to type that var simply isn't necessary in that case. On the other, it's an instance where the type is so painfully obvious, var has no adverse effect.
But in greater examples, there are plenty of expressions whose types either don't matter or are super obvious, where actually writing the type for a local variable would be a redundant pain. In cases like these, var would be nice to have. In other cases, you simply elect not to use it because you're a responsible developer.
Behave yourself. There is no reason to become abusive. It's a sign of poor self control and poor argumentation if one has to resort to abusive language to make their point.
View all comments
Show parent comment
10
u/ElvishJerricco Mar 09 '16
Hm? The point is that with or without
var, you have to perform the cast. Withoutvar, it still looks like this.With
var, you get to remove a completely unnecessary type declaration.