3 ms·
I think when I've heard people saying Java sucks, they mean its type system allows defects that the type system of F# or Scala can prevent. Those reasons given
by JackMorgan 11y ago
I think when I've heard people saying Java sucks, they mean its type system allows defects that the type system of F# or Scala can prevent. Those reasons given for Java being better than Python or Ruby are also why F# is better than Java.
- SamReidHughes 11y agoIt's a lot more than that. For example, it's really annoying to define new types in Java.
- AnimalMuppet 11y agoCould you be more specific? How is it really annoying to define new types in Java?
- SamReidHughes 11y agoYou have to manually define its constructor, manually provide getters if you want the value to be immutable, put each class in a separate file (or namespaced inside another class), and if your type has finitely many alternatives you have to set up the whole visitor pattern thing. Compare that with C#'s properties and readonly, Scala's case classes, Swift's enum types.
- bcg1 11y agoMaking immutable structures in Java truly does suck... this is the most valid complaint that I've heard in a long time about the language. It would be extremely easy to implement properties as syntactic sugar in the language or via built-in annotations without changing the class file spec at all.