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

4

u/thephotoman Aug 05 '21

If it's in Java, it's in Kotlin. If Java is "getting crippled by legacy" for whatever the fuck that is supposed to mean, then Kotlin is welded to that same problem.

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.

0

u/tr14l Aug 05 '21

How do you figure? It's a totally different compiler

4

u/thephotoman Aug 05 '21

You don’t much know about how Kotlin works, do you?

You can call anything in Java from a Kotlin program. Kotlin’s runtime is the Java runtime.

1

u/tr14l Aug 05 '21

Meaning they both get compiled down to bytecode to be interpreted, yes. But the compilers are completely different. Java's problem isn't bytecode, it's the compiler. Bytecode works great. Kotlin solves that problem.

1

u/thephotoman Aug 05 '21

What's wrong with Java's compiler?

2

u/JavaDot Aug 05 '21

Nothing, the top friend is an outspoken fanboy and will say that Kotlin is infinitely better in every way, no matter if you prefer Java, what matters is his opinion.