2 ms·
As a man named William Shatner once said, "Brevity is the soul of wit." Or was that Shakespeare? The same is true for good programs, I think. When we see pro
by abrenzel 16y ago
As a man named William Shatner once said, "Brevity is the soul of wit." Or was that Shakespeare? The same is true for good programs, I think.
When we see problems like this, it's right to ask questions about what the language design encourages its programmers to do. Additonally, languages have "personality" just like people do, and those personalities evolve with the user base of the language as they adapt to the language's environment.
The question of whether this type of code is more common in Java than say Python or Perl is empirical, and my gut says it is. Java is the commoditized, corporate language par excellence. The features it implements and the way it implements them have attracted the kinds of programmers who would write code like that. That's not to say that Java code forces its users to write code that is so inelegant. That's just to say that it creates incentives that often push toward ugly code. C++ does that too. On the other side, Python (to name one example) seems to set up its environment in such a way as to encourage pretty code.
There's no clear-cut good or bad here, only interesting trends in the code produced in various languages.