News for hackers. Stuff that matters.
Re:Python 3.11.0 final is now available by rattray on Tuesday October 25, 2022 @08:38AM (#33329668)
Kotlin remains a way better language IMO.

Java has adopted maybe 20% of the things that make Kotlin better, but due to backwards compatibility it'll never catch up.

Personally I think it'd almost never make sense to adopt Java over Kotlin for any greenfield JVM project, unless the devs you hire are truly so low-skill they can't pick it up.

Re:Python 3.11.0 final is now available by ghostwriter on Tuesday October 25, 2022 @08:50AM (#33329784)
> Java has adopted maybe 20% of the things that make Kotlin better, but due to backwards compatibility it'll never catch up.

Kotlin supports neither structural pattern matching nor guarded patterns as they are available in both Java 18 and Scala. It's Kotlin that needs catching up nowadays.

Re:Python 3.11.0 final is now available by seanw444 on Tuesday October 25, 2022 @01:13PM (#33333397)
> nowadays

It's an abstraction atop Java. Of course it plays the catch-up game. It inherits new features from Java. They can't have it instantly.

Re:Python 3.11.0 final is now available by ghostwriter on Tuesday October 25, 2022 @02:38PM (#33334528)
What's the point of Kotlin, aside absence of semicolons and the 'val' keyword, if it plays the catch up game with the rest of the features becoming available first in Java?

> They can't have it instantly.

Why not if Scala did it way before pattern matching was introduced into Java?

Re:Python 3.11.0 final is now available by ackfoobar on Thursday October 27, 2022 @05:42PM (#33364423)
Off the top of my head:

Null-safety.

Read-only interface by default - `MutableList` vs `List`.

if-expression, they just look nicer than `a ? b : c`.

---

You're right that Kotlin is not an "abstraction atop Java (the language)". It's meant to be a better Java that feels familar to Java. With that rationale in mind, it's reasonable that they left some features from FP languages out of Kotlin.

As I have said in another reply, it was a great decision to not follow what Scala did with pattern matching.

Re:Python 3.11.0 final is now available by ackfoobar on Thursday October 27, 2022 @05:28PM (#33364290)
In Java 18, this is the pattern matching you're talking about.

`if (o instanceof String s) {`

Not much benefits over Kotlin's smart casts.

Guarded patterns with this version of pattern matching should be translatable to adding another "and" condition. The Kotlin compiler should have no problem reasoning with that.

---

I find positional destructuring in Scala (which works similarly in Java 19) a bad design.

https://news.ycombinator.com/item?id=31399737