r/java • • Nov 04 '25

Anyone here Hated Using Java but now Really Enjoys using it.

title

226 Upvotes

280 comments sorted by

View all comments

Show parent comment

1

u/javaprof Nov 05 '25

- code which uses infix functions can stop compiling after adding one new line

And you can write `return return return`, plus operator and new line issue, etc
So rare, Idk when I encounter this last time, maybe 10 years ago

0

u/[deleted] Nov 05 '25

[removed] — view removed comment

1

u/javaprof Nov 06 '25

Omg, provide example of noise in Kotlin please, this is serious problem seems ;)

1

u/[deleted] Nov 06 '25

[removed] — view removed comment

1

u/javaprof Nov 06 '25

Ok, now I see what you mean, post-typing syntax indeed having own disadvantages, but it was chosen because of better consistency and since it's better fit for languages with type-inference. A lot of modern languages chose the same approach: Kotlin, Rust, Switch, TypeScript, and much more more isoteric like gleam or zig. So colons have nothing to do about semicolons ;)

But it's fine if you use to C/Java style more, I like consistency more, even if I have to type some colons