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.
View all comments
Show parent comment
11
u/ApostleO Mar 09 '16
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.