Re:Please stop saying Java sucks
by JackMorgan on Wednesday June 24, 2015 @11:17AM
(#9772173)
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.
[ Parent
| on HN ]
Re:Please stop saying Java sucks
by SamReidHughes on Wednesday June 24, 2015 @11:39AM
(#9772344)
It's a lot more than that. For example, it's really annoying to define new types in Java.
Re:Please stop saying Java sucks
by AnimalMuppet on Wednesday June 24, 2015 @12:17PM
(#9772607)
Could you be more specific? How is it really annoying to define new types in Java?
Re:Please stop saying Java sucks
by SamReidHughes on Wednesday June 24, 2015 @01:05PM
(#9772959)
You 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.
Making 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.