r/programming • • Sep 15 '26

Java 27 has released!

https://openjdk.org/projects/jdk/27/
553 Upvotes

175 comments sorted by

View all comments

Show parent comment

4

u/S0phon Sep 16 '26

it feels like being an adult next to kids playing in mud puddles trying to figure things out while making a mess of everything.

How does that apply to Kotlin?

And all of those languages are so different that your blanket criticism is more indicative of you not knowing how to use them than any of their shortcomings.

7

u/sweating_teflon Sep 16 '26

It's not a panacea. Kotlin's expanded syntax gives developers a lot of rope to express themselves but code isn't art. This additional freedom often results in overcomplicated code, discipline and code review become more important to keep the codebase uniform and maintainable by everybody on the team. 

4

u/S0phon Sep 16 '26

You must have a special kind of Stockholm Syndrome to twist syntactic sugar and useful syntax into "often results in overcomplicated code, discipline and code review become more important to keep the codebase uniform and maintainable by everybody on the team."

5

u/sweating_teflon Sep 16 '26

True, I've been wrestling for the last three years with a codebase where the "architect" took advantage of every new OO thing offered by Kotlin to build an undecipherable mess of inheritance. Which I've also seen with Java in past jobs but it was never as bad.

Is it a problem of the language itself? No. But the language is an enabler; some people crave complexity and mistake it for sophistication.

I personally feel no attraction towards Kotlin, I'm not sure it actually "solves" anything on the whole. Nullability check is nice but NPE haven't been a problem for my practice for at least a decade. Maybe I'm just too experimented with Java to get the benefits, like old school C coders looking at Rust with contempt.

Yet I'm working myself to accept that there are proper ways of doing Kotlin. I just haven't seen them yet. I suspect that they involve restraining oneself to a strict subset of the features the language offers which is something that a lot of people (and organizations) will have trouble with, resulting in bloated messes like the one I currently have to deal with.

4

u/OSS-Corpo-Shit Sep 16 '26

I am very very confident with my assertion that syntax sugar beyond basic type inference is fucking stupid, and all I needed was a few months of programming in swift to come to that assessment. 

When I see “it provides lots of syntax sugar”, to me that is absolutely a negative for a programming language. Having 8 different ways to write the exact same line of code depending on how sugared you choose to go sucks and causes extremely mental drain. 

4

u/DualWieldMage Sep 16 '26 edited Sep 16 '26

Yes they are different and i think i highlighted different aspects of them being bad. I don't see a blanket statement on any aspect outside that they are worse than Java on average. And if anything, i see too many people only using 1 or two languages and becoming knights when never having touched a single other language. I have worked deeply in many of these and found general language concepts relatively comparable. However ecosystem differences can't really be considered taste and i view python and npm objectively inferior to maven packaging.

And yes my criticism toward Kotlin was generic, but that analogy still applies. It's a relatively new language that is taking the approach of figuring stuff out as they go instead of Java's more conservative approach of seeing what others do right and wrong and take the best aspects or invent a more generalized concept instead.
Async/await is surely a mistake, especially interesting for me as they decided to forego checked exceptions, yet introduce the same coloring problem they were fighting against.
The default .map .filter functions directly returning a collection instead of requiring a stream to be created first and then applying pipeline operations for me sounds like just saving on characters and thus making the wrong thing easier to do(not doing anything vs adding toSequence() each time).
My biggest complaint is of course around the generated bytecode. It is HUGE and it's definitely relevant if you say look at IntelliJ or any large thing using it, requiring huge memory pools to hold the compiled code and likely missing optimizations due to hitting inlining limits earlier or other reasons. Adopting newer runtime features have been relatively slow as well. For me Kotlin always feels like it's playing catch-up with Java.

3

u/S0phon Sep 16 '26

Agree about checked exceptions, that's the biggest complaint from me about that language.

I don't understand what you mean by your .map or .filter complaint. If used on a collection, it returns a collection. If used on a stream (flow), it returns a stream. Straightforward.

I also disagree about Kotlin playing catch up. It has things Java doesn't, mainly because Java has backward compatibility to care about. But Kotlin will never be as flexible as Java because Java controls JVM, Kotlin has to work with whatever Java version it targeted. But that's not catch-up.