Live data from Hacker News

Don’t call it a comeback: Java is still champ

github.com

121–130 of 557 posts

Re: Don’t call it a comeback: Java is still champ

#121

Earlier quoted context omitted.

That's exactly what was meant. With Loom Java will hopefully not have the same function split as languages like JavaScript (or C# for that matter) where you have to add lots of async/await everywhere; and instead will have something like Go (where everything is async). https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...

I don't understand the part about go, does that mean go doesn't require async but gives you the functionality of async? (I never tried go) The problem with async is that we can separate when to start a task and when to ask for its result. The compiler can just add await everywhere an async function is called, it is trivial, but you don't get the flexibility of async. If everything is treated as async, you will need t…

> If everything is treated as async, you will need to await everything

In go you work rather differently. You let tasks go off and do their thing, and provide a channel to communicate. Pulling a response from the channel is the 'await'. A good part of go's magic is that these tasks - goroutines - don't result in large amount of blocked threads.

Java will soon have the building blocks of something rather similar to goroutines.

Re: Don’t call it a comeback: Java is still champ

#122
post #27

The only problem Java has is experienced C programmers don't build servers from scratch with it yet. Once they take that responsibility, the debate will be over because: "While I'm on the topic of concurrency I should mention my far too brief chat with Doug Lea. He commented that multi-threaded Java these days far outperforms C, due to the memory management and a garbage collector. If I recall correctly he said "only…

The p50 speed up from delaying memory management comes with a trade off, namely you get Garbage Collection pauses, bad p99, and spend your effort tuning the Garbage Collector instead of your code.

That sounds a lot like the complaints about Java from a decade ago. Have you used it lately?

Java's GCs are incredible and you have a menu of algorithmic options that let you avoid whatever problem you're worried about.

Re: Don’t call it a comeback: Java is still champ

#123
post #83
post #75

Earlier quoted context omitted.

Does it really? With Java’s G1GC the only knob you may end up having to tune is the max target pause time - which pretty much chooses between better p50 and worse p99 va worse p50 and better p90 - aka throughput vs latency, that are almost inherently opposite ends of the same spectrum. It is not GC-specific that any improvement will fail to increase one of those. So the actual tradeoff is more whether you want better…

You mean the integer parameter "-XX:MaxGCPauseMillis"? The name says it all. You can do over a dozen sync disk writes in a millisecond these days.

Have you seen the output of JVM flight recorder or some other tool used to observe memory allocation/reclamation patterns? The JVM is very lazy when it comes to GC - its algorithms are crazy good and can catch up with really high allocation rates as well. So the maximum pause time’s unit doesn’t really say much, and when it comes to dynamic memory allocation, the JVM is the best choice according to the biggest web services operating on terabyte sized heaps.

Re: Don’t call it a comeback: Java is still champ

#124
post #122

Earlier quoted context omitted.

The p50 speed up from delaying memory management comes with a trade off, namely you get Garbage Collection pauses, bad p99, and spend your effort tuning the Garbage Collector instead of your code.

That sounds a lot like the complaints about Java from a decade ago. Have you used it lately? Java's GCs are incredible and you have a menu of algorithmic options that let you avoid whatever problem you're worried about.

The JVM GC is fundamentally the same as 10 years ago.

Re: Don’t call it a comeback: Java is still champ

#125
post #27

The only problem Java has is experienced C programmers don't build servers from scratch with it yet. Once they take that responsibility, the debate will be over because: "While I'm on the topic of concurrency I should mention my far too brief chat with Doug Lea. He commented that multi-threaded Java these days far outperforms C, due to the memory management and a garbage collector. If I recall correctly he said "only…

Java does not (yet) have green threads, which limits the number of connections you can serve per machine. You can go to Scala though (it has them) and still stay on the JVM.

Re: Don’t call it a comeback: Java is still champ

#126
post #93
post #48

Earlier quoted context omitted.

I might be wrong but I think they stopped working on major new versions for a decade. There seems to be Java 6 or 1.6 or whatever for a really long time. Like Netscape's version 4.

Who stopped what? Java 19 is the upcoming release.

using the parent comments naming scheme it is actually 1.19, I don’t know why they stopped developing major releases however.

Re: Don’t call it a comeback: Java is still champ

#127
post #54

Earlier quoted context omitted.

Java is heavily used in high-frequency trading. I believe it's the most popular language after C++.

Indeed. Shutoff Garbage collection completely and it can work. (And make sure your Java code creates no garbage - which is a new type of programming in and of itself)

Maybe I’m taking your comment wrong, why is this a bad thing? What other GC’d language just lets you turn it off?

Re: Don’t call it a comeback: Java is still champ

#128
post #5

Java's adequate. It's like a Toyota Corolla (insert your boring car of choice here if you don't feel this one works for the analogy). Not the prettiest, not the fastest, not the most efficient. But it gets you from point A to point B with little fuss or muss. I totally get why companies adopt and standardize on it. Do I use it for personal projects? Nope. Because it's not fun to "drive". For that, I pick the equivale…

Hit too close with the analogy:

Been a Java dev for ten years and I drive a Toyota Corolla....

...but also in my spare time I play around with Clojure and dream of buying a '69 SS Camaro

Re: Don’t call it a comeback: Java is still champ

#129
post #5

Java's adequate. It's like a Toyota Corolla (insert your boring car of choice here if you don't feel this one works for the analogy). Not the prettiest, not the fastest, not the most efficient. But it gets you from point A to point B with little fuss or muss. I totally get why companies adopt and standardize on it. Do I use it for personal projects? Nope. Because it's not fun to "drive". For that, I pick the equivale…

What does that make Scala? A RAV4?

I'm going to catch hell for this, I just know it.

A Chrysler PT Cruiser. Odd looking, beloved by its fans, and a reasonably adequate (if quirky) to drive.

Re: Don’t call it a comeback: Java is still champ

#130
post #44

Earlier quoted context omitted.

Have you explored Kotlin? It's really not just for Android.

I've heard from a few corners that Kotlin is "Java but better", but I've also heard that the tooling is pretty lacking if you aren't using JetBrains stuff. True?

Successfully used VSCode for Kotlin projects.
Post reply on HN