1. Kotlin is a hack and 2. Rust is more fun.
Pretty understandable why one would simply want to move on to greener pastures.
1. Kotlin is a hack and 2. Rust is more fun.
Pretty understandable why one would simply want to move on to greener pastures.
Here are some examples that have hit the graveyard: It's been 2 years since exception handling in switch was proposed [0], 3 years since null-restricted types were proposed [1], 4 years since string templates [2], 8 years since concise method bodies [3], and 11 years for JSON parsing [4].
[0] https://inside.java/2023/12/15/switch-case-effect/
[1] https://openjdk.org/jeps/8303099
[2] https://openjdk.org/jeps/430
Based on your other comment you prefer "fat" languages like kotlin and C# - and that's fair. I find languages with less, but more powerful features far more elegant and while Java has its fair share of historic warts, modern additions are made in a very smart way.
E.g. switch expressions seamlessly support sum and product types, meanwhile kotlin's `when` really is just syntactic sugar.
All in all, with too many features you have to support and understand the complete matrix of their interactions as well, and that gets complicated quickly. And Kotlin is growing towards that.
When used as a different way of writing an if else if can be a code smell. When used with an exhaustive list of an enum or sealed class prevents bugs in production.
String templates are valuable syntactic sugar, but that's it.
There are a bazillion JSON libraries with at least 3-4 absolutely stellar ones. I don't really see it that big of a limiter.
And if you mean checked exceptions, that's controversial to claim it's all bad. But some ergonomics improvements would be better.
What do you mean by broken exception system?
Java is not a small language that you can throw features around, they have to take into consideration final goal of it and decades of development.
Yes, even Mark Reinhold admitted that in the last "Ask the Architects" interview.
>null restricted type will come with valhalla
Will they? It's been 10+ years of Valhalla. Why is a compiler construct even behind project Valhalla? Kotlin has showed you don't need it to do them.
> string templates had a try
Yes they were over engineered and they failed to deliver a basic feature.
> Java is not a small language that you can throw features around, they have to take into consideration final goal of it and decades of development.
Yes I agree, but it shouldn't take YEARS to ship anything. 11 years for a JSON api?! Come on.
Anything? Or maybe something that you specifically want?
It added records when I wanted them, it added streams and lambdas. I don't care for string templates (I thing those are ugly in any language).
null-restricted types would be nice but you have to understand that designing a language is not throwing every possible feature on top of it (like kotlin and resulting lack of readability it has and hard time updating to newer JDK), you have to design it, think of the possibilities, what users really want etc.
Valhalla type system results in addition of null-restricted types, as a natural evolution of the language.
PS: personally I really like Swift, I would suggest giving it a try for fun
I don’t think it’s for me though. It’s very Apple centric and I’m a Windows gamer and PowerShell user at heart.
Java was stagnant and ripe for being kicked off the top.
Scala was the hack that showed why Java was starting to suck but Scala suffered from no direction. Every single idea a PhD ever had was implemented in the language with no thought other than it seems cool to be able to do that too. Which is why all the Scala codebases fell apart, because you could write anything, anyway you want, and it was impossible to maintain without extremely strict guidelines on what parts of the language you were allowed to use. Also the build times were atrocious.
Kotlin designers evaluated language features across the ecosystem and chose what made sense to make Java better when it came out and now has easily surpassed Java. They are still thoughtful in what they choose to add to the language and it is now very powerful. However they smartly imitate Python by having clear guidelines on what choices you should be making when writing code so that other developers can easily dive in.
I'd really like to see a Python framework that embraces class-based controllers to do away with this problem; beyond that writing a dependency injection system is not too difficult of a task (the last time I did it for a hobby project many years ago, it was around ~150 lines of code).
> Kotlin designers evaluated language
Well, I like scala, and most of the time I understand it, but I can't say the same with Kotlin. I would say quite the opposite is true.
Well, I absolutely disagree with this take. Scala actually builds on top of a couple of its powerful primitives. Especially Scala 3 is a beautiful language.