r/java • • Apr 20 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
291 Upvotes

295 comments sorted by

View all comments

49

u/coincoinprout Apr 20 '21

Java developers can confidently trust the JVM to do what's best. Whether they're implementing a multithreaded application or storing a large amount of data on the heap, they can be confident they won't shoot themselves in the foot with memory management or data races.

That's an exaggeration. It's true that you don't have to deal with memory management directly. But you can absolutely shoot yourself in the foot with memory management or data races. I don't know a lot of java programmers who never had to deal with OutOfMemoryErrors or thread safety issues. I think that the JVM is awesome but IMO you have to understand how it works at least a bit if you want to be a good developer. Thinking that the JVM will magically deal with all these issues would be a big mistake, and that's how you end up with an application that crashes in production.

3

u/istarian Apr 20 '21

Is there a magic fix for no more memory or concurrency problems? Those don't seem like issues that are specific to Java.

7

u/iamsooldithurts Apr 20 '21

They’re not specific to Java at all. The magic fix for concurrency problems is semaphores. For memory, that can be a very complicated problem; Java can only address so much space, so if there is too much data you’re SOL. If there isn’t too much data, but you still run out of memory, it can be a chore tracking down where the leaks are because some things don’t pass out of scope and get flagged for GC like you would expect.

3

u/Zardoz84 Apr 21 '21

They’re not specific to Java at all. The magic fix for concurrency problems is semaphores.

These aren't the magic fix. Instead, is one of the classic ways to handle.

PD: There isn't a magic way to handle it.

→ More replies (1)