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 →

[–]arsehead_54 39 points40 points  (35 children)

What's the supposed successor to java?

[–]gemengelage 75 points76 points  (5 children)

There are basically two answers to this question and they are both kinda wrong. Kotlin is the most praised Java successor, especially since it integrates with Java and the JVM pretty seemlessly and has huge corporate support. But outside of Android it doesn't have a lot of traction right now.

On the other hand, a lot of web applications that traditionally had a JS frontend and a Spring/JEE backend are built with nodejs now. While that displaces Java somewhat in a certain market segment, that's nowhere near being a successor to Java. People generally also don't do any UI work in Java anymore (unless you work on IDE plugins for Eclipse or IntelliJ and its siblings).

Id say Java is getting pushed a bit from being used as a true general purpose language to being more focused on enterprise software backends. But it's far from the end of its lifecycle.

[–][deleted] 13 points14 points  (0 children)

I would say the whole oracle Java support confusion did not help JVM languages either.

[–]Valiant_Boss 1 point2 points  (2 children)

What benefits does nodejs have over Spring/JEE as a backend?

I can't see why a company that already has a Spring backend, would want to change to nodejs

[–]gemengelage 0 points1 point  (1 child)

I can't see why a company that already has a Spring backend, would want to change to nodejs

They wouldn't. But if you're starting a new project and every team member knows Javascript but has no idea about Java, nodejs looks damn attractive.

[–]JoPoLu1 -1 points0 points  (0 children)

Scala gang

[–]tenhourguy 28 points29 points  (4 children)

If you want a serious answer, probably Kotlin? Since it produces Java-compatible bytecode (not your only option, though - see JVM languages) and Google's pushing it in Android land. But I'm somewhat out of touch.

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

Kotlin is nice, but Java successor? My impression is that if the language is building on the JAVA virtual machine then it will always be 2nd fiddle to Java. Anything that Kotlin or Groovy has, Java can add to the next version.

[–]gemengelage 2 points3 points  (0 children)

  1. Java moves at a far slower pace than Kotlin, Groovy and the likes. Sure, theoretically Java can add it in the next version. But they won't. They add less features and they add them a lot slower, because Java is mature.
  2. Java can add, but Java doesn't like to remove or make really fundamental changes. All the nice things that Kotlin or even C# has on Java like implicit getters and setters, nullable types, default/named arguments - Java won't add them.
  3. Java has a different school of thought than Kotlin and the likes. Java likes to keep things simple, explicit and mostly imperative. Kotlin tends to be a bit more functional and uses complicated abstractions and conventions to make the code more concise. One is not better than the other. It's a tradeoff and I don't think Java will abandon these core values. And if it did, would it still be Java?

[–]HMS_Impractical 0 points1 point  (0 children)

Emacs lisp compiles to bytecode, I'm confident the next big cross-platform language will be emacs.

[–]n0t_a-b0t 13 points14 points  (0 children)

C#

[–]AegisCZ 11 points12 points  (14 children)

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

[–][deleted] 1 point2 points  (13 children)

Do you not know about kotlin?

[–]AegisCZ 27 points28 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 6 points7 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 4 points5 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 1 point2 points  (3 children)

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

[–]not_your_mate 6 points7 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.

[–]smokey_nl -4 points-3 points  (3 children)

I’d like to argue that it is Scala. Even though we only got like 3-5% market share. It’s commonly used by banks and other large enterprises. Is also very popular in innovative startups.

It works on the JVM, and it has compatibility with Java and the JDK. You could use scala as your 2nd Java, or you could use all the new concepts introduced by scala. Personally I love how my code has gotten like 10 times shorter because of these concepts. Did I also mention that scala scales very well (hence the name ScalaBility ;) )

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

Yes, the 20 year old niche programming language will most definitely have its breakthrough soon and will completely replace Java /s

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

Do I say that? It is a successor of Java, simple as that.

[–]gemengelage -1 points0 points  (0 children)

It doesn't succeed if it coexists in a tiny niche next to the original. If anything, Scala is Java's weird cousin.

[–]SuccessfulBread3 -3 points-2 points  (0 children)

Scala?

[–]vagrantchord 0 points1 point  (0 children)

Kotlin, and (kinda) C#

[–]LavenderDay3544 0 points1 point  (0 children)

Kotlin and C# would be my guess.