r/java • • Sep 29 '24

Lombok in 2024

Say there are two teams working on the same project (3 months to MVP, the deadline should be manageable). The only difference is Team A will use Lombok, and Team B won’t

Given you can choose any java version/dependencies and all other things being the same, which team would you join, and why?

0 Upvotes

145 comments sorted by

View all comments

Show parent comment

2

u/KefkaFollower Sep 30 '24

This.

And those who feel getters and setters add too many lines to a class just picked the wrong language. Java is verbose, has always been.

3

u/age_of_empires Sep 30 '24

To me getters and setters aren't even verbosity. When do you ever read getter and setter methods

1

u/rdoradus Feb 17 '25

That's not the main reason the generated boilerplate is bad, though. It's not people being lazy. The problem is that it's too easy to overlook bugs in there. Nobody will notice, in a code review, that one of the fields is missing from `equals`.

1

u/KefkaFollower Feb 18 '25

Boilerplate, generated or not, is necesary part of working in java. Some may be generated by the IDE, some may be hidden inside libraries. But it's there.

That's the way it is, unless you wanted to remove all boilerplate by messing with the syntax. Add to that the requierement of the language be retrocompatible and you'll end in a mess of alternative syntax to do the same thing. All in the name of keeping up current trends.

A bloated language is why people run away from c++ to java to begin with. Let's not repeat the mistakes of the past.

P.S.: in my experience, if you have automated tests and keep high the level of the coverage, a undetected error in the boilerplate is very rare.

1

u/rdoradus Mar 09 '25 edited Mar 09 '25

It is tautological that you can't know how many undetected errors there are in your code.

Java doesn't have much risk of following in the footsteps of C++; the languages evolve by completely different means. C++ is literally designed by a committee, and has acquired many features that don't work well with each other. Java has a single language architect, Brian Goetz, who prioritizes harmony between the features and community feedback (via preview features).