Oh, definitely. I would consider this bad practice, for sure.
Java just seems to have this tendency to make good coding practice a feature of the language. For instance, requiring that the class name matches the filename.
The 'var' keyword is, unfortunately, very easily abused to make code less readable, rather than more readable.
That being said, when it is used well, it is actually much nicer to read. And while we are on a similar subject, the 'dynamic' keyword (ex: in C#), is quite useful in certain circumstances to make code much easier to understand, but when abused it can make code incomprehensible.
12
u/covercash2 Mar 09 '16
It seems safer than that in the article.
More like:
We all know what those will compile to. Anything else will have to be declared explicitly, though only once:
instead of
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.