2 ms·
I use Haskell, where the syntax to "copy but change one member" is: let newObj = oldObj { member = newMember } In Java, you use the builder pattern, which
by mrkeen 4y ago
I use Haskell, where the syntax to "copy but change one member" is:
let newObj = oldObj { member = newMember }
In Java, you use the builder pattern, which is not built in. So you use Lombok to generate it for you, and then you get in a fight with your team lead about not using Lombok because he heard about this-one-guy-who-had-a-problem-with-it-just-do-your-own-research-I-can't-be-bothered-explaining-it-to-you, so then you roll (and maintain) your own Builder object for every value class.