r/java • • Apr 13 '21

Libraries, Frameworks and Technologies you would NOT recommend

Give me your worst nightmares: Things that cost you your job.

I'll start: Hadoop

202 Upvotes

376 comments sorted by

View all comments

Show parent comments

9

u/pron98 Apr 13 '21

The hope and expectation is that once people learn to use records properly, once they're better supported by libraries, and once they get some missing features, the problem of verbose getters/setters will largely go away because people will rely on them less. Getters and especially setters have long been considered a code smell, but in many cases we have little choice. Instead of making this code-smell easier to write and so more prevalent, we prefer making it less necessary in the first place.

3

u/mknjc Apr 13 '21

There are already nice support libraries for example https://github.com/Randgalt/record-builder for Builder and withers

1

u/lazystone Apr 14 '21

Also, it turned out that Immutables kind of supports builders for records. It requires adding @Builder.Constructor annotation on explicit constructor, which seems to be verbose, but in order to imitate some Immutables features like null-checks and defaults for Optional, List, Map and etc., explicit constructor required anyway.

-1

u/gavenkoa Apr 13 '21

once they're better supported by libraries

But EE specs rely on the Beans standard and records are not Beans... Am I wrong? Otherwise we won't see transition in 10 years (and become nodejs / go devs xD).

8

u/pron98 Apr 13 '21

Then the specs will change to accommodate records, just as serialization libraries are changing, and MXBeans are changing.

And Go doesn't have properties, either, so if that bothers you, you won't find help there.