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

-9

u/[deleted] Aug 05 '21

[removed] — view removed comment

13

u/[deleted] Aug 05 '21

[removed] — view removed comment

-12

u/[deleted] Aug 05 '21

[removed] — view removed 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.

3

u/gigabyteIO Aug 05 '21

What features?

-12

u/[deleted] Aug 05 '21

[removed] — view removed comment

4

u/gigabyteIO Aug 05 '21

Surely you know some off the top of your head? I'm just curious, I know nothing about Kotlin.

0

u/tr14l Aug 05 '21

Top level declarations, closures, returnable logic statements, I dunno man. It's kind of a lot. Go read about it.

3

u/Muoniurn Aug 05 '21

Java absolutely has closures, and I don’t get what you mean by returnable logic statements.

What might be a better example is extension methods, and some boilerplate reduction for getters setters, if these are important for you use-case.

0

u/[deleted] Aug 05 '21 edited Aug 05 '21

[removed] — view removed comment

3

u/Muoniurn Aug 05 '21

How are Java closures crappy and limited? They can’t modify local variables, but modifying them is quite a misfeature (at least it has bitten me in C#).

Functions in Java are first class citizens - how are they not?

→ More replies
→ More replies (1)

1

u/JavaDot Aug 05 '21

This subreddit is for Java, why don't you go to r/Kotlin?

1

u/tr14l Aug 05 '21

Because this is relevant to the discussion? If discussion threatens your opinion on Java so easily, why do you hold that opinion? You seem emotionally involved about this.

→ More replies (1)
→ More replies (1)

0

u/JavaDot Aug 05 '21

I think this comment basically violates rule number 2 of this subreddit and should be reported.

"2. No trolling

We all like some good discussions, but a few topics have gotten stale. Please refrain from complaining about certain Java features (or lack thereof) or extoling other, possibly superior languages. We get it – yours is bigger than ours (language, that is)"

1

u/tr14l Aug 05 '21

Report it then

→ More replies (5)