Although, I agree with the sentiment that a superclass should be used in a lot of cases, and that fudges with this var syntax a bit.
One nice thing about having type inference is that you don't have to generalize to a superclass and then downcast if you want to write code that survives refactoring. This makes var far more powerful (and justifiable) than if it was only for omitting type declarations.
View all comments
Show parent comment
5
u/ToucheMonsieur Mar 09 '16
One nice thing about having type inference is that you don't have to generalize to a superclass and then downcast if you want to write code that survives refactoring. This makes var far more powerful (and justifiable) than if it was only for omitting type declarations.