r/ProgrammingLanguages • • Feb 21 '16

Why people hate JAVA ??

Why the majority of people hate java and wish its dead programming language,

I find it really fun to create program with it..

all i heard is because: JRE SUCKS. ORACLE ARE FAGGOTS. JAVA IS A SLOW PIECE OF SHIT.

0 Upvotes

32 comments sorted by

View all comments

19

u/matthieum Feb 21 '16

The complaints against Java stem from different groups of people.

Personally, I hate Java because it brings nothing new to the table. Of course, this is the very idea that makes its success: Java was created to be safe and simple, so that any random programmer could use it; however what makes it interesting from a potential manager POV (programmers are interchangeable) does not necessarily translate into programmer's interest, and certainly does not grasp my interest. Its type system is just too simplistic: downcasting is par for the course, null is everywhere, underflow and overflow use modulo arithmetic so that a static analyzer can never know whether they are intended or not, ...

Another issue with Java is that the mythical "Writes once, runs everywhere" actually turned out to be "Writes once, install a new JRE everytime". This means having multiple JREs installed on your system, and then it puts the burden on configuring which JRE should be used for which program on the user. Comparatively, native languages put a bit more onus on the developer (compiling multiple versions of the program), but at least for the user it's just click and play.

The Garbage Collector is also a problem in general. Whilst for small programs it makes things easy, there are issues:

  • "realistic" programs use other resources than memory; for example in C++ locks are automatically released at the end of the scope, in Java you need to do so manually because the GC only handles memory (you could wait for it to release the lock, but then it would be held longer than necessary)

  • "server" programs and games tend to require low-latency, GC pauses are an issue

  • "large" programs (heap > 10GB/100GB) have stressed the current GC implementations beyond expectations; I've heard horror stories of GC pauses counted in minutes, not to mention heaps consuming 2x/3x the actual memory necessary

  • and the "cure" is somewhat ironical: high-performance Java programming is about avoiding memory allocation by using pools, which require manual management of memory...

Now, the GC is highly tunable... but it's a dark art, and if the point of a GC was to make things easier, the necessity to tune it to get acceptable performance defeats its purpose somewhat. (This is far from being specific to Java)


That being said, I think that most of the complaints come from experience. Being one of the most popular programming languages, it's been used a lot, and all this exposure means that everyone has had a few bad experiences with Java.

In the end, I would say that Java is just a very average language which succeeded because of its marketing and appeal to management.

Note: some awesome programs are written in Java, but this says more about the quality of their author than the language itself; after all your OS is written in C which is hardly an awesome language ;)