News for hackers. Stuff that matters.
Re:The Kotlin Foundation by chrisseaton on Saturday February 13, 2021 @12:23PM (#26124935)
So why bother using Kotlin?

Seems like it fixes trivial things (makes simple classes a bit more terse) but retains the more fundamental problems and hangs on for Java to actually fix those.

Re:The Kotlin Foundation by dbsmith83 on Saturday February 13, 2021 @02:07PM (#26125819)
It's way more than terse classes. The syntax everywhere is cleaner. Higher order functions look so much nicer. Using val/var is superior to having to remember to write 'final' all the time. Kotlin also handles nullability way better. Ah, also, default arguments for constructors/methods. These features prevent a lot of developer mistakes, and thus better code is often achieved.

Also, Kotlin usually forges ahead on features, and the Java is playing catch up. Take data classes for instance. If anything it seems like Kotlin gave Java a good kick in the pants to get it to start developing faster and adding modern language features.

Re:The Kotlin Foundation by pjmlp on Sunday February 14, 2021 @03:25AM (#26130581)
Java and JVM are developed together, Kotlin just adds syntax sugar on top.

If Kotlin is so much better, why doesn't JetBrains just port everything into Kotlin/Native?

Re:The Kotlin Foundation by dbsmith83 on Sunday February 14, 2021 @10:27AM (#26133131)
Because there are benefits to the JVM and interoperability with Java
Re:The Kotlin Foundation by pjmlp on Sunday February 14, 2021 @04:32PM (#26136464)
Apparently not, given the cargo cult hate against Java on Kotlin community, glad to "leave Java behind".
Re:The Kotlin Foundation by listenallyall on Saturday February 13, 2021 @03:24PM (#26126469)
If Kotlin's only improvement over Java were its scope functions, that alone would be an overwhelmingly good reason to migrate. Scope functions are awesome, cannot stress that enough.

Kotlin syntax makes writing functional code beautiful and simple... map and fold and filter are so much easier to write than in any other language that also have the same functions, such as JS. Again, that alone would be enough to migrate.

But there are still so many more simple, but incredibly useful functions like SubstringAfterLast which takes a nasty, ugly Split function into a beautiful, precise line of code. Just one example of many.

Re:The Kotlin Foundation by pjmlp on Saturday February 13, 2021 @03:59PM (#26126841)
import static
Re:The Kotlin Foundation by The_Colonel on Saturday February 13, 2021 @02:33PM (#26126047)
Kotlin fixes just trivial things - like nullability for example. Java still doesn't have a good solution, only about 5 bad ones and nothing is in sight. It even looks like Java designers simply don't consider it a problem anymore ...

Instead, they focus on things like value types. Which are definitely cool, but they don't actually solve any of my problems. Typical business apps written in Java don't suffer from performance issues, they suffer from (accidental) complexity explosion and subsequent buginess (of which NPEs is a symptom).

Re:The Kotlin Foundation by erik_seaberg on Saturday February 13, 2021 @05:51PM (#26127749)
When teams go so far as to consider alternatives to the JVM, memory footprint and poorly tuned GC are typical reasons.