Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Java is a fine language and has sufficiently expressive types. It's the most consistently overlooked language and frankly it's completely annoying. Java is a powerhouse. If you can live with a VM, it's an amazing language. The disdain for Java is honestly just weird. The boiler plate is only marginally annoying to write and makes it considerably easier to read. The 'enterprise ecosystem' is definitely bloat, but that's not Java.


Overlooked? It's one of the most used languages of all time maybe second only to C.

The distain likely comes from a time period of its history where "Enterprise" patterns had been taken to an absurdist end before the community final regained it sanity. Modern java is quite expressive and ergonomic.

Those in industry in those enterprise days simply got sick of those silly FactoryFactory classes and their like.

Today there's almost no "boilerplate" as they've even made it nice even for scripting use cases and allow floating main methods, var, etc.

However, to actually compete with rust they'd need first class native support and an ARC GC replacement. Iirc they already have "pluggable" gc implementations so it's not out of the question. Java tends to be fairly conservative in features though, so may take a couple decades to get there if they even care to.


1. Java is mentioned in their comparison table. They just don't use it much. 2. There is really no reason to include Java in the search for your preferred language, since Kotlin is strictly better along every relevant axis.


Kotlin is a few tweaks on top of Java, most of which aren't relevant anymore, and it's not strictly better in most ways other than saving a few keystrokes (and preference).

It's a little bit nicer to write but that's almost irrelevant.

It also comes with some runtime cruft.

In reality there is no Kotlin without Java, which means most projects end up a bit 'dual'; every single Kotlin project we've had (except Android) folded back onto Java. Even Scala wasn't worth it, though that's a different question.


There definitely is Kotlin without Java, and you can compile Kotlin code for use in jvm, ios/ipados/macos, android, wasm/js, and native.


Technically yes, but I don't think it could exist without Java.


You can't even read a file in Kotlin without Java.


Not true today anymore, but definitely true for a lot of its history.


Really? I know there's kotlin.io.* but afaik that doesn't work on KNative or KJS.


thats pretty much what I mean, yes.


I strongly disagree with Kotlin being strictly better than Java. It pretends to fix things that haven't been problems in Java for more than 10 years while introducing a layer of syntactic complexity that's completely unwarranted. It just thrives on hype and Android development.


I've "ported" several legacy server side applications to kotlin over the years. I have no regrets.

That said I feel kotlin is almost a testbed language for java to steal features from at this point. Modern java is "good enough" now to warrant sticking with java these days. But back before some of the more recent java editions, kotlin was a boon to productivity, at least for me.

Luckily with "big" (feature and keyword wise) languages, you get to pick and choose what features you actually use. Obviously there are pros and cons, but in most cases you can control the complexity. The issue that remains is when a library or framework you use evolves to use more bells and whistles than you're comfortable with, but I'm general the kotlin community is finally large enough that there's always alternative libraries etc.

I generally just consumed the java libs directly in kotlin, sometimes with my own tiny shim layers for ergonomics. That way nothing crazy gets foisted on me w.r.t. orms etc.


Kotlin’s closed-by-default design choice makes it worse than Java, and thus not strictly better than Java. It’s premature optimization, and a design-up-front-influenced paranoia/fear of any extension in not-designed-for places. But when I write code, I prefer to keep it open to extension, and in practice, I found a lot of value in extending decently written code, that would not be possible with Kotlin without having to go back and modify things to be open.


can you point to documentation or articles that explain this closed-by-default concept in more detail?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: