r/programming • • May 21 '20

Java programming language celebrates 25 years

https://www.infoworld.com/article/3544229/java-programming-language-celebrates-25-years.html
95 Upvotes

73 comments sorted by

View all comments

0

u/[deleted] May 21 '20

[deleted]

0

u/[deleted] May 21 '20

[deleted]

4

u/[deleted] May 21 '20

How is kotlin a meme language? And how is modern java amazing? I can’t really think of anything modern java has that kotlin doesn’t.

0

u/[deleted] May 21 '20

[deleted]

1

u/florinp May 21 '20

I don't think you understand Kotlin or Java.

1

u/slowpush May 21 '20

Are you not aware of what Android Java is?

1

u/DoListening2 May 22 '20 edited May 22 '20

Non-nullable by default.

throw/return are expressions, so you can do

val email = user?.email
    ?: return null

Lot more convenient stuff in the standard library.

1

u/slowpush May 22 '20

So just use Lombok if that is it important to you.

1

u/DoListening2 May 22 '20

But why would I? I gain nothing by avoiding Kotlin and sticking with Java. In fact, I'd still lose out on some of the nice-to-haves.

2

u/slowpush May 22 '20

Good luck debugging the generated nonsense Kotlin builds.

0

u/DoListening2 May 22 '20 edited May 22 '20

I don't understand what you mean. Debugging regular code works exactly like with Java - you can step through the code, see the values as usual, evaluate stuff, etc. I only very rarely care about reading the raw JVM bytecode if that's what you mean.

With asynchronous code and coroutines, there are some caveats (https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/debugging.md) for now, but you would have similar issues when using e.g. RxJava (very popular on Android) and wanting to step through a chain of operations. Or anything else where control flow basically turns into data flow.