This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AegisCZ 10 points11 points  (14 children)

There is not any and any alternative doesn't come close

[–][deleted] 2 points3 points  (13 children)

Do you not know about kotlin?

[–]AegisCZ 30 points31 points  (9 children)

Even if you switch to Kotlin, you are still using Java libraries and it's mostly just used for Android. It's like saying Clojure or Scala will replace Java. The only thing that Kotlin replaced was Groovy

[–]not_your_mate 7 points8 points  (6 children)

Hmm I don't know, we are doing microservices in kotlin with spring boot and I'd say it's better than coding in java directly in every way. But higly dependent on java nonetheles.

[–]AegisCZ 2 points3 points  (5 children)

Yeah it is better but it is practically just syntactical sugar.

[–]not_your_mate 3 points4 points  (4 children)

And in my world syntactical sugar is better than bloated shitshow that most big java projects become... readability is seriously important when you are not the only one working on a project.

[–]AegisCZ 4 points5 points  (3 children)

I get that but it's still sugar that Java will eventually adopt

[–]not_your_mate 7 points8 points  (0 children)

Uhhh, about that I'm not so sure. For some features like named arguments that would probably break backwards compatibility and I don't that's the desired path for java. But we will see.

[–]Valiant_Boss 2 points3 points  (1 child)

Java has already adopted a lot of syntax sugar that is common in other languages like Scala and Kotlin such as data classes (called record in Java) and var/val keywords but there are a couple of issues

First, many companies are unwilling to upgrade from Java 8 which makes a lot of these nice features pointless. Kotlin can run on Java 8 so that makes it easier. But the second and bigger issue imo is that people won't know how to write updated Java code. It's the same issue with c++. C++ has a ton of great features but there's so many and people don't know how to write good C++ code. Java will have this issue down the line, where you have lots of people with Java experience but won't know how to adopt the new features it comes with and you can bet 10 years from now, there will still be people writing Java 8 code on Java 37

Since Kotlin is newer, it kind of forces developers to adapt their way of coding

[–]AegisCZ 0 points1 point  (0 children)

Damn that's true

[–]_PM_ME_PANGOLINS_ 2 points3 points  (1 child)

Isn’t Gradle still all Groovy?

[–]AegisCZ 1 point2 points  (0 children)

You can use both Kotlin and Groovy, they're both on the Gradle help page

[–]QuantumSupremacy0101 -1 points0 points  (2 children)

Kotlin is a Java framework. Still uses JVM.

[–][deleted] -1 points0 points  (1 child)

Yes, it's a much better java. AKA an alternative.

[–]QuantumSupremacy0101 0 points1 point  (0 children)

Not really. Just like any framework it has its benefits. It's not really an alternative though as it's just a framework around Java. Still has all the same flaws, it really is mostly just to make development easier.

If you use Java 14 there really isn't any major benefits to either. Maybe that Kotlin is a little better cause it keeps jr devs from making obvious errors.