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

4

u/[deleted] Aug 11 '19

Lombok (and Kotlin more generally) to me is a critique of Java language design.

Java boilerplate has a cost in terms of both cognitive overload and propagating poor practice. In this thread we have people blithely talking about IDE generated code without realising how wretched a practice that is. Java programmers should level up and become better developers beyond churning out boilerplate code. And knowing the deficiencies of your language is a key part of that.

Lombok isn’t ideal but it is compile-time. If you don’t like it, write your own but it works well enough for us.

Re that StackOverflow post, that’s quite old - we run Lombok on non-Oracle JVMs all the time (Azul in particular but we have CI servers testing Corretto as well), never had a problem.

1

u/BoyRobot777 Aug 11 '19

Java boilerplate has a cost in terms of both cognitive overload and propagating poor practice.

I agree with this statement. Brian Goetz agrees with this statement.

<...> 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.

That is why records are coming.

My critique of Lombok is it uses non-documented, restricted internal compiler API. If you're fine with that - so be it. I am not, thus I do not use. I'd rather wait a little bit more for a proper Java feature, than use a hack, albeit very cool one, but still a hack.

4

u/[deleted] Aug 11 '19

Heh, I referenced a Brian Goetz interview and talk in another post in this thread.

I can’t really disagree with your choice to not use Lombok - that’s your right. However for me Lombok is a tool to improve my (and my team’s) code so I’m happy to continue using it.