Most active commenters
  • toprerules(4)

←back to thread

183 points chhum | 16 comments | | HN request time: 0.001s | source | bottom
1. toprerules ◴[] No.44006750[source]
I admire Java as a success story, but I still have a deeply ingrained aversion to it for many reasons. I will admit that many of the reasons are due to Java's legacy as the language of bloated corporations, and its creation of overly verbose, magic fueled frameworks and poorly written code. Java as a language goes hand in hand with the idea that code is coal to be shoveled into the furnace, and we should all throw our aspirations away and embrace mediocrity.

My other issues with the JVM is how much of a black box it is from a platform perspective, which makes debugging a PITA with standard ops tools like strace, gdb, etc. The JVM's over allocation of memory robs the kernel of real insight as to how the workload is actually performing. When you use the JVM, you are completely locked in and god help you if there isn't a JVM expert to debug your thing and unravel how it translates to a platform implementation.

Then of course there's the weird licensing, it's association with Oracle, managing JDK versions, it's lack of it factor in 2025, and a huge boatload of legacy holding it back (which is not unique to Java).

I have successfully navigated my career with minimal exposure to Java, and nowadays there's a glut of highly performant languages with GC that support minimal runtimes, static compilation, and just look like regular binaries such that the problems solved by something like the Java or Python VMs just aren't as relevant anymore - they just add operational complexity.

To reiterate, I admire JG just like any tech person should. Java's success is clear and apparent, but I'm glad I don't have to use it.

replies(6): >>44007271 #>>44009450 #>>44010005 #>>44010292 #>>44010639 #>>44011196 #
2. the_overseer ◴[] No.44007271[source]
IT factor! Am I on a fashion website now? What kind of argument is that? Also, why on earth would you use strace or gdb for Java? It has enormously performant debugging tools in the JDK. Also, IDE debugging integration is second to none.
replies(1): >>44011261 #
3. exabrial ◴[] No.44009450[source]
>My other issues with the JVM is how much of a black box it is from a platform perspective, which makes debugging a PITA

Java has one the greatest debugging capabilities ever. dynamic breakpoints, conditional breakpoints, hell you can ever restart a stack frame after hot deploying code without a restart. You can overwrite any variable in memory, set uncaught exception breakpoints, and even have the JVM wait for a debugger to connect before starting. There is no equivalent in any other language that does _all_ of these things. And to top this off, there is 0 equivalent to Idea or Eclipse for any other language.

For runtime dynamics, JMX/JConsole is good enough for daily use, Java Flight Recorder gives you deep insight, or in a system you don't have direct access to. Hell even running jstack on a JVM is a good debug tool. If those don't do the trick, there's plain old HPROF (similar to other languages) and Eclipse Memory Analyzer.

>Then of course there's the weird licensing,

The JVM is open source. There are no licensing issues. OpenJDK can be freely downloaded and run in production without restrictions on any use. If you really want to buy a JVM from Oracle... well thats your prerogative.

> it's lack of it factor in 2025,

sdkman

> a huge boatload of legacy holding it back

what legacy code?

replies(2): >>44009836 #>>44010475 #
4. ◴[] No.44009836[source]
5. throwaway7783 ◴[] No.44010005[source]
In my 20+ years using java, not once have I used strace or gdb. Java itself has fantastic debugger support, and IDEs have built in step through capabilities.

Mentioning Java and Python in the same way in the context of performance is really odd. Python is nowhere near the JVM when it comes to performance

replies(1): >>44011266 #
6. briankelly ◴[] No.44010292[source]
The tooling is pretty easy to learn if scary looking at first and becoming a JVM expert, at least in the context of GC tuning, might take you a week or less. Some of the defaults are surprising though.

And I think there is some parallel with the kernel vs GC and mmap vs buffer pools - the GC simply has better context in the scope of the application. With other processes in the picture, though, yeah there is some provisioning complexity there.

7. marginalia_nu ◴[] No.44010475[source]
> what legacy code?

The Java API has its fair deal of baggage due to its extreme backward compatibility. Boolean.getBoolean[1] is one of the more accessible examples of a bad API that exists only because of legacy reasons, but there quite a number of them.

[1] https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean....

8. cgh ◴[] No.44010639[source]
Debugging Java is great, as others have mentioned. This includes probably the best remote debugging capabilities available for any platform.

OpenJDK, the de facto standard version used by everyone, is licensed under the GPL version 2 with the classpath exception.

No offence, but you simply aren’t well informed.

9. jjav ◴[] No.44011196[source]
> My other issues with the JVM is how much of a black box it is from a platform perspective, which makes debugging a PITA

You state how you don't really use java, but the above confirms it.

Java debugging and diagnostic tooling is second to none.

replies(1): >>44011257 #
10. toprerules ◴[] No.44011257[source]
That's a really narrow view of the world, and I think another Javaism to think that Java is the entire world. Today's multi-service deployments run tens if not hundreds of auxiliary processes not using Java. They use network overlays that change how processes interact with the network core. A person who is debugging a knock on effect issues has to be able to look through many different layers of processes, many of which are written in C, C++, Go, etc. Having to learn an entire toolset to debug Python or Java is a huge burden and it makes introspection extremely difficult. Java essentially wants to be the entire platform, which isn't how the world works anymore.
replies(2): >>44011596 #>>44012064 #
11. toprerules ◴[] No.44011261[source]
Because if I'm debugging a critical issues and wading through multiple layers of processes and system interactions, I don't want to have to learn a bespoke toolkit and debugging system for every single process.
12. toprerules ◴[] No.44011266[source]
It sounds like you've only ever written code without dealing with it in production. You can't always plug your code into an IDE when your debugging someone else's JVM app on a remote server.
replies(2): >>44011525 #>>44012096 #
13. vips7L ◴[] No.44011525{3}[source]
Except you can. Remote debugging is a huge feature.
14. vips7L ◴[] No.44011596{3}[source]
Don't you think a narrow view of the world is this idea that you should be able to use one tool to debug everything? It seems like you want GDB (and the unix's where it runs) to be the entire platform.
15. jjav ◴[] No.44012064{3}[source]
When you need to debug across the entire system and into the kernel, I'd use dtrace which has had java stack frame support since... I don't remember anymore, but closing in on 20 years.
16. throwaway7783 ◴[] No.44012096{3}[source]
Eh, okay. Sounds like you don't know how to do this in production.