Live data from Hacker News

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

github.com

211–220 of 557 posts

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

#211
post #30

Funny how the revival of Java is similar to the revival of .NET. After some stale years, both languages refined themselves and are back in the top competition (.NET in the VM space, Java in the language space). It really shows which languages can re-invent themselves (Java, .NET, PHP, ..) while some fail (Fortran, Basic, Pascal, Perl, ..). Not sure where JS is ;). Python seems to have survived the 2/3 schism by now.

I guess both JavaScript and Python reinvented themselves through gradual typing. It makes Python quite a different language and JavaScript literally a different language.

My most recent small (1k LoC) Python project is “fully typed” and therefore practically type safe (not strictly speaking though). Lots of the large libraries are typed as well, which is important.

For Python, work around the GIL might be the next evolutionary step, that time in the name of performance.

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

#212
post #11

I recently started a side new project in Java targetting GraalVM with language version 17. Aside from Java's innate finickyness, it has been an unexpected pleasure. I think a lot of it has to do with its static typing (I typically work in dynamic languages, and it's nice knowing that if the program compiles it likely works), and how simple the language keeps its primitives. But you need really good tooling to use it,…

> But you need really good tooling to use it, like a powerful IDE with good autocompletion and refactor support. It is way too verbose to type everything out yourself, and the verbosity means manually refactoring takes lots of changes around the program to manifest. One of the ironies of Java has been that its strictness and verbosity can make it hard to develop, but that strictness also enabled the development of po…

> What feels like a hassle for a 100 line file becomes an asset for a million-line project

This is true and hard to communicate to people that haven't lived it.

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

#213
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…

Erlang is not as peformant as Java, but there are plenty of reasons to prefer the former to the latter: - a much better concurrency model, that gets you parallelism for free just by adding cores - no global gc pauses, low-latency - fantastic operational tools (trace debugging, remote shell, etc.) - Erlang/OTP gives you great middleware out of the box, including including queues, pub-sub, service monitoring, database,…

No Erlang can't share memory between cores atomically.

Erlang can only scale 1-to-1 things like phone calls.

Java is the ONLY language that scales many-to-many with stable non-blocking IO and concurrent parallelism that shares memory atomically AND doesn't crash.

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

#214

and it still enforces terribly strict OOP patterns onto the developer which is almost never the right way to develop software if you care about performance even a little.

OOP is fine. OOP and functional programming written by skilled programmers both end up being basically the same thing -- they are just different techniques to achieve encapsulation, control over dispatch, control over state, etc.

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

#215

Earlier quoted context omitted.

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

The real nightmare is Java's versioning scheme

The version number increments by 1 every 6 months. What is so nightmarish about that?

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

#216
post #63

Earlier quoted context omitted.

> To use anything else (than JavaSE without heavy deps.) on the server is madness. That's a terribly broad generalization. There are multiple other options that are entirely sane.

When all you have is a hammer... What a ridiculous take, most server apps don't use Java and they are just fine.

This was true until 2017 when I became a C programmer.

They are fine until they need to scale and iterate quickly without downtime.

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

#217
Trouble with java is that it does not scale up or down in terms of ram.

Minimum RAM for a sever doing something normal over tcp is measured in gigabytes.

Big servers > 16gb get difficult to manage at runtime.

You have to scale with more VMs.

You can write useful C servers that are very small, especially if you compile with musl. And run the same code for 1000kcc (not a typo)

When you have big arrays of memory storing everything as Objects/pointers gets messy and inefficient. But any big heap is hard to manage and keep response times consistently low.

My other gripe os that "write once run anyway" is no longer close to true, since Oracle. Mac, Linux x64 and Windows 64 are your only sane options. If you look at the compile targets list for c or rust you can see write once run anywhere working on a lot more cpus. True, you might have Arch specific code but it works, and most Java does not port from Linux container to Windows for example.

A statically compiled Binary is often easier to move across systems, because a java app is rarely a single jar. It's usually >5gb of app specific jvm and libs and config files.

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

#218
post #106

The JVM is pretty great. I could certainly nitpick things, but it's pretty great. Java is pretty decent. However, I would say that Java lost a lot of time and even now there are some decently rough edges. Java didn't evolve as a language for a while and that left the door open to other languages and other non-JVM ecosystems a lot. As the article notes, Java 8 was a breath of fresh air, but it was minimal in some ways…

I really like the C# object initializer syntax, and it looks like the next version might get rid of the last problem I had with it. Right now it does not play nice with nullable types, if a property is declared non-nullable you have to use a constructor or some ugly trick to circumvent the warnings. As far as I understand this will be fixed in .NET 7 (not sure if the decision is final, though) and you can get the ful…

If you perhaps happen to know or have a pointer: how would that work in C#? A field not initialised will be null, and if it’s non-nullable… what’s its value going to be?

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

#219
post #213

Earlier quoted context omitted.

Erlang is not as peformant as Java, but there are plenty of reasons to prefer the former to the latter: - a much better concurrency model, that gets you parallelism for free just by adding cores - no global gc pauses, low-latency - fantastic operational tools (trace debugging, remote shell, etc.) - Erlang/OTP gives you great middleware out of the box, including including queues, pub-sub, service monitoring, database,…

No Erlang can't share memory between cores atomically. Erlang can only scale 1-to-1 things like phone calls. Java is the ONLY language that scales many-to-many with stable non-blocking IO and concurrent parallelism that shares memory atomically AND doesn't crash.

And for the fraction of the software projects out there that that actually need this feature as a hard requirement, I'm sure it's wonderful.

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

#220

Earlier quoted context omitted.

Corollas don't come with all sorts of weird (now aging) buzzword-driven preferences like nudging you towards xml, factories, etc.

Personal rant: I've never understood the hate towards XML. It's a practical and flexible markup language that does not depend on whitespace or quoting every bloody thing. Plus, every markup language invented since has had to re-invent XML things that, surprise surprise were actually needed. Paths, schemas, comments, etc. I get frustrated with JSON because of things I could do in XML that I can't do in JSON without br…

You're comparing XML and JSON, and you're complaining about how verbose JSON is? Um, JSON is, like, half as verbose as XML is.
Post reply on HN