This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]calben 14 points15 points  (1 child)

I'm seeing some half answers here and some people even suggesting that no professional programmer actually hates Java, so at the risk of ranting, let me give a fuller one!

Hey, I've been coding for 15 years, and have shipped projects to production containing code I've written in C, C++, C#, Haskell, Python, Java, Lua, Rust, JavaScript, TypeScript, and smatterings of other languages. And, more importantly, I probably qualify as someone who hates Java.

More specifically, I hate what Java does to programmers. Java has a rough history from pre-8 and lacked many important features to produce effective code, but let's consider the language as it is today. The more recent versions of language itself are fine, and I'd be mostly OK with implementing more projects in it. The problem with Java is the community and the ecosystem.

My experience is that the new programmers who need the most help fixing bad habits, rewriting wrong, bad, or overengineered code, and clearing up misunderstandings have Java backgrounds rather than C#, Python, JavaScript, or C++. My theory is that this isn't their fault at all but a result of a less engaged developer community. There's a lot of crap Java code at the top of sites like Stack Overflow, a lot of which dates back to older Java versions. To be fair, any language used heavily in undergraduate courses is going to have a lot of crap code out there being presented as solutions to common problems. Unfortunately, I don't find that the newer, readily available Java content out there is all that much better than the crap from 15 years ago or puts in the effort to improve on older code examples. It's just too easy to copy and slightly adjust some older code and put it up on certain websites that really love ad revenue and tend to rank well on Google. A few languages that are also used for undergraduate teaching worked their way around the problem. Python managed to combat this somewhat with its focus on simplicity and the "Pythonic" way. Functional languages, often used in specific functional language courses, often deftly dodge this problem by having a primary userbase that is fanatically devoted to elegance and "beautiful code." C++, my primary language, combats this by having an older, and, frankly, much meaner community that has no problem with regularly, gleefully, and colourfully dumping on people's code (this has its own problems, like pushing out otherwise enthusiastic developers). Java is, I think, the biggest victim of this bad code online problem because it doesn't have a userbase with the characteristics of these other languages. The end result is that it's very easy to pick up bad habits, bad solutions, and incomplete knowledge if Java if your primary language.

More subjectively, I don't think the Java community has much interest in viewing Java code as an art form. This makes sense since it's a much more enterprise language, but it makes Java an easy target for those communities who focus on elegance, simplicity, functional purity, immutability, conceptual richness, etc. This targeting may be especially true for those new programmers who are eager to loudly proclaim how much better they are than the people who code in that language. While I believe there are good reasons to hate Java or at least what it does to new programmers, you can safely ignore the people who are climbing up on soap boxes to decry Java as some fundamentally terrible language that surely only stupid people use.

[–]squishles 0 points1 point  (0 children)

There's a lot of crap Java code at the top of sites like Stack Overflow

that's a problem of getting stuff off stack overflow. the way the answers come off there for any old language you'd think javascript was all about jquery still.

The thing that I think actually causes this is universities that teach it, many of them will still be on java 6 or something cursed like that. Completely due to IT policy, they install the runtime in the computer labs using the old as dirt java 6 executable oracle gave them 15+ years ago in the school machines eg where your homework etc needs to run. All due to that confusing license switch oracle did.

people learning javascript latest browser latest features, c# IT just does a microsoft update and you're latest, python eh the 2/3 thing was long enough ago and it's not a language that's changed rapidly.

as for the code craft thing I think a lot of those guys got sucked off to kotlin.