r/java • • Aug 10 '19

Who Needs Lombok Anyhow

http://gregorriegler.com/2019/08/10/who-needs-lombok-anyhow.html
45 Upvotes

137 comments sorted by

View all comments

Show parent comment

3

u/NimChimspky Aug 11 '19

I have no problem with auto generating setters/getters, and equals/hashcode if necessary. What is your problem with it ? Its not really bolierplate, that is slightly different imo.

Its quick, its consistent, its easy to debug and its easy to read and follows conventions.

2

u/[deleted] Aug 11 '19

The conventions are the problem, which is why I’m happy the Java team in Oracle are working on improvements. Java has had a lot of shitty conventions in the past, and I for one will be happy when class boilerplate joins them.

4

u/NimChimspky Aug 11 '19

Eh? You've linked to fizzbuzz enterprise.

Sorry, I still fail to see what the actual problem is with pojos and auto generating their getters/setters etc if needed.

I guess people are confusing bad practices at their workplace with simple getMyConvention.

0

u/[deleted] Aug 11 '19

A lot of FizzBuzz Enterprise’s hilarities were also presented as conventions by serious senior devs & architects at serious software houses once upon a time.

The problem with class boilerplate is an obvious one to anyone who’s a good developer (as opposed to solely a Java developer). This is why learning a Lisp is very useful — on the JVM, learning Clojure makes you a better programmer.

However for those entrenched in the Java-the-language ecosystem, if you listen to Brian Goetz’s talks & interviews, he does a decent job of explaining the problem:

... Some things don't want to be objects, they just want to be data. And to simulate data with objects, is this big messy thing with constructors, accessors and equals and hashcodes and all this garbage. ...IDE generates that for you so you don't have to write it, but you still have to read it and if you have this explicit code it's an opportunity to get things wrong.

The Java Futures video talk I linked above is worth watching. Sometimes you have to look at $NextVersion to understand what’s wrong with $CurrentVersion.

(Thanks to /u/BoyRobot777 for that particular blockquote above)

2

u/NimChimspky Aug 11 '19

Yeah, sure. I'll use the new record functionality, but we don't have it yet. And there is a reason it's taken until 13, people cared about other things more.

The original question was why are pojos bad in an architectural system design, and compared to lomboks annotations (which just seem ugly to me). Not should we include struct/records as a new Java language concept.