News for hackers. Stuff that matters.
Re:Automated Unit Test Improvement Using Large Language Mode... by raverbashing on Saturday February 17, 2024 @02:42AM (#39407308)
Java is the only place where (non-automatic/non-syntax-sugared) getters and setters are though as important and valuable

Only goes to confirm my view of them that the language is deficient

Re:Automated Unit Test Improvement Using Large Language Mode... by CraigJPerry on Saturday February 17, 2024 @03:41AM (#39407625)
I don’t think it’s accurate to label that as a language problem.

That is very squarely a people problem.

It’s not as bad today - many Java juniors don’t have the “bean” affliction burned into their brains so they don’t object to public fields on data carriers (today you’d just use a record) but even the bean generation (mostly people my age) can usually be won over these days by negotiating with them on cases where getters/setters can be eliminated (e.g. start with value objects, then suggest maybe DTOs then you can go for the kill - why do we need the stupid Java bean convention?)

Re:Automated Unit Test Improvement Using Large Language Mode... by hubraumhugo on Saturday February 17, 2024 @02:43AM (#39407313)
Record types solved this in JDK 14
Re:Automated Unit Test Improvement Using Large Language Mode... by groestl on Saturday February 17, 2024 @05:12AM (#39408122)
I mean public final was there before as well.
Re:Automated Unit Test Improvement Using Large Language Mode... by drowsspa on Saturday February 17, 2024 @09:36AM (#39409760)
Cries in Java 8
Re:Automated Unit Test Improvement Using Large Language Mode... by Slartie on Saturday February 17, 2024 @05:22AM (#39408167)
Modern Java projects either use records, org.immutables or Lombok. Manual getter/setter creation is the exception nowadays.
Re:Automated Unit Test Improvement Using Large Language Mode... by srvaroa on Saturday February 17, 2024 @08:17AM (#39409158)
I don’t find they are valued like that. IME most devs who use them perceive them as annoying boilerplate. Proof being how Lombok or Records are generally well received among the younger gen.

The problem on this topic is that they cargo cult getters/setters by inertia, usually because more experienced engs pass it on as good practice.

It’s not an inherent problem to the language.