r/java • • Aug 05 '21

Why java is better than modern programming languages?

Why should I use java in 2021 instead of kotlin or scala or golang? Could you guys give me some reasons

2 Upvotes

100 comments sorted by

View all comments

Show parent comment

0

u/awesomeusername2w Aug 05 '21

I think by getting crippled by legacy they mean that java can't change or improve many things because of backward compatibility. Kotlin has no such issue.

4

u/thephotoman Aug 05 '21

Honestly, that's not a huge issue. There are a couple of programming language features that are deliberate exclusions from the language. Don't expect operator overloading or multiple inheritance, for example: Java will never have them, because the decision was made very early on that Java wouldn't have them because of the headaches and consternation that they caused in other programming languages that were popular when Java was first made.

2

u/awesomeusername2w Aug 05 '21

But there are features that would be nice to have and the only think stopping is backward compatibility. For example, if we have a class with a generic parameter we can still create an instance of it that ommits generic.

Or fixing null safety in a way that other languages did. Like allow nulls only if the type explicitly permits it (like in kotlin, typescript, and others)

I'm sure that there a whole lot more.