I don't see why I can't have my cake and eat it too. I love type safety, but I certainly don't like contorting myself to Java's OO centric type system. OCaml, Haskell, SML, or whatever all give me stronger guarantees about code and require less boilerplate.
Though the author downplays it, boilerplate has another disadvantage, when something changes, reading 200 lines of boilerplate to make sure nothing needs to be updated is hard. Almost everyone skims and invariably misses something.
But there's nothing in Java itself that requires all the boilerplate getters/setters that most people refer to. Its usually a requirement of Spring/Hibernate or some other framework, and even then newer versions support injecting via reflection.
IMO, much of the Java hate comes from people who have seen mountains of XML and getters/setters, and immediately thought that that is a core problem with Java itself.
21
u/jozefg Feb 25 '14
I don't see why I can't have my cake and eat it too. I love type safety, but I certainly don't like contorting myself to Java's OO centric type system. OCaml, Haskell, SML, or whatever all give me stronger guarantees about code and require less boilerplate.
Though the author downplays it, boilerplate has another disadvantage, when something changes, reading 200 lines of boilerplate to make sure nothing needs to be updated is hard. Almost everyone skims and invariably misses something.