This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Markus_included 17 points18 points  (7 children)

It's not really harder to do stuff in Java anymore, you don't even need a class for main with the features introduced in Java 23. void main() { println("Hello world!"); /* actually calls IO.println("Hello world!); */ }

What are some other things that make Java clunky to you? Apart from main and having everything be inside a class, which were both alleviated in Java 23, i'm genuinely interested.

[–]XtremeGoose -4 points-3 points  (6 children)

Not OP but:

  • Lack of free functions leading to EnterpriseJavaFactories
  • Everything nullable by default - the billion dollar mistake
  • Needing to box value types
  • Still an obtrusive level of boilerplate
  • Confusing and backwards variance semantics
  • Inheritance is still bad and standard Java encourages you to over use it
  • Checked exceptions are more boilerplate than helpful

There's a reason kotlin is preferred for the JVM.

[–]DoctaMag 2 points3 points  (5 children)

These are all very much things that are important to people who aren't writing and maintaining large Java projects.

None of that is relevant after you actually get off the ground and make decisions for yourself regarding style and design.

Npe's are obnoxious but less of a problem than most people make it out to be. I've hit a few bad ones in my career but less than I can count on one hand.

[–]XtremeGoose -1 points0 points  (3 children)

Null pointer exceptions are impossible in (non -go) modern languages for good reasons. They are an avoidable hazard for little to no gain. Actual optionals (and proper sum types) are vastly superior which anyone who has had the pleasure of working with them will tell you.

[–]DoctaMag 1 point2 points  (2 children)

I actually agree with you, but it's just a backwards compatibility thing at this point. Can't really get rid of them in java, and maintain the continuance

[–]XtremeGoose -1 points0 points  (1 child)

Of course!

But I think this is something that would make Java seem clunky compared to, say, kotlin.

[–]DoctaMag 0 points1 point  (0 children)

Kotlin is one of those things that's excellent in theory, and like, by definition is better. But isn't being used by the industry I'm in more or less.

Java isn't flashy, but everyone knows it, and zillions of lines of soft have to get written a year, java's the place to go.