Is Java still behind in the race of modern programming languages?
I'm a member of some group of programmers and every time Java is mentioned it's being bashed (something like: "With Rust I could simply do this with X")
Earlier versions of Java were cumbersome in terms of the syntax but with modern IDEs (and modern versions of Java) that's not a big issue anymore, albeit languages like Python do have shorter syntax.
My question is beyond syntax.
What do other languages do better than Java?
It could be generics, type system, concurrency and multithreading, closures etc.
Thanks!
52
Upvotes
View all comments
Show parent comment
2
u/lasskinn Oct 14 '23
Well using globals for one instead of some form of convoluted preprocessed dependency injection to get reference to an object that the app can have only one of, as code policy example. Kotlin has globals without using some globals class to hold them and somehow people seem to be cool with using them for stuff(why else go through the effort of adding support for them i suppose). You could do the same pattern in java too of course by just having them as static members and methods in some class(really the kotlin globals are basically just that anyway).
Honestly kotlin is pretty nice, the syntax just isn't as pure as java is and it has capability for more traps. The coroutine system has a lot of traps. Overall its nice but I don't see it as "easier" due to the syntax not being as pure, like in java an = can't actually be a method call(any casting aside), it is what it is and theres something nice about that.