4 ms·
Yes, it is ridiculous to criticize Java coders for "misusing" their OO mechanisms. Those mechanisms are all they have, to build everything, whether OO makes se
by ncmncm 6y ago
Yes, it is ridiculous to criticize Java coders for "misusing" their OO mechanisms.
Those mechanisms are all they have, to build everything, whether OO makes sense in that niche or doesn't. So, probably more often than not, they are obliged to cobble together a substitute for what they need from the limited toolkit at hand, making a hammer do a screwdriver's job, as best they can.
You have to feel sorry for them, and even sometimes admire them, making the best of adversity in their impoverished language.
Then think of the poor C coders, lacking even that.
- dkarl 6y agoIn the current-day context there are a lot of ways you can improve Java code just by not using OO mechanisms. A lot of the pervasive use of inheritance in the past was driven by the assumption of working in big monolithic codebases in huge teams with long development cycles and really poor use of SCM. Working in small teams, on microservice codebases, in short dev cycles, without long-lived feature branches and late merges, you don't need as much protection against other people's code. You can use concrete classes instead of interfaces, and you can separate data from algorithms instead of finding ways to conceptualize every function as a "behavior" of some anthropomorphized collection of data. A couple of edits: The old style makes sense for the API surface of libraries; I won't dispute that. As much as they annoy me, I do see a bright side to people who insist on defining "correct" Java style as the circa-2000 style motivated by a bunch of long-dead assumptions: they will help Java die. Nobody under forty wants to write code that way. All it will take to kill Java will be for Oracle to declare a future release (say Java 25) as an "eternal support" release and then release an entirely different language as "Java 26" the way Microsoft did with Visual Basic.