Hacker News new | ask | show | jobs
by pron 1353 days ago
I always find it funny when people bring up Kotlin in the context of Java's evolution. It's not one of Java's main competitors, and while Java has borrowed many features from other languages [1], to date it has not adopted a single feature from Kotlin [2]. In fact, almost at every turn -- from data classes, through async/await, to string interpolation (JEP 430) -- Java has opted for a different approach. Is Kotlin the only other language they know?

But I don't think you're entirely wrong to suggest that competition had something to do with this. Python is one of Java's main competitors, and when it comes to teaching a first language it is the main competitor. Both students and teachers who prefer Python as a first language mentioned this "on-ramp" problem as one of the reasons. There are others, and they will be addressed by other enhancements.

[1]: Java's "charter" calls for it being a last mover, adopting features after they've been successfully used elsewhere

[2]: Although there is one I hope it would one day -- nullability types.

2 comments

> Is Kotlin the only other language they know?

On the JVM: I'd say yes.

Scala, Groovy, Jython, JRuby, and what not came and went.

I'd say Clojure is the third, and it take a nice place in the design space.

But Kotlin to me is so close to Java that it is basically Java 2.0: the Java that Java cannot be due to intended organizational slowness.

> Python is one of Java's main competitors, and when it comes to teaching a first language it is the main competitor.

Yes it probably is. The changes outlines in the article are not going to help here I'm afraid.

But I'm weird. I'd say the best lang without static typing for noobs is a LISP (so that every student is likely equally confused). When learning a language with types go for Rust or Idris. All not exactly competitors of Java :)

> the Java that Java cannot be due to intended organizational slowness.

When Java was created in the '90s, James Gosling said that it is intended to be a slow-evolving conservative language that will only pick features from other languages once they have been sufficiently proven to be worth it. We try to live up to that goal and be a last-mover. It's not organisational slowness but conservatism in design that has worked very well for Java. Java will never adopt many if not most of the features Kotlin has, because most features never prove themselves as particularly beneficial over time, and because we try to make the language as minimal as possible, because it's intended for a very wide audience, and, in general, most programmers prefer languages with fewer features to languages with more features.

I'd say Kotlin was Java 2.0 ten to five years ago, but now it's a language that's going in a different direction from Java's.

> The changes outlines in the article are not going to help here I'm afraid.

Not alone, but this is just the beginning.

> I'd say Kotlin was Java 2.0 ten to five years ago, but now it's a language that's going in a different direction from Java's.

Maybe it is, maybe it is not... We all do not know the future.

> Java will never adopt many if not most of the features Kotlin has, because most features never prove themselves as particularly beneficial over time

So what. I care (as said before) for the implicit nulls problem. Also, I dont like to my code to be littered with annotations (to introduce magic) and exceptions-as-alternative-return-values.

Almost 10y with Java, now on Kotlin for everything new and not looking back.
That's great, but for the past 15 years or so, the portion of people using the Java platform through other languages has neither increased nor decreased (around 10%). There's a segment of programmers who prefer more feature-rich languages than Java, or perhaps different programming paradigms, and we're happy to have the platform accommodate them.