Java 16+ records are so nice! Let's say you have this code:
5
6
1
53
What about replacing it with:
3
2
26
Replying to @McJty
Functions/constructors/whatever which take a number of booleans greater than one upset me. Does this record make sense if something is false, X, true, X ? If not, then perhaps a enumeration of not/can/is generating would be better?

Dec 29, 2021 ยท 9:21 AM UTC

1
Replying to @dsilverstone
yes in this case it does. It's used as a key for my baked model which has a few booleans that determine it's shape. So this is the best solution here IMHO. Otherwise you just get an explosion of binary combinations and that's ugly
1
oh well. That is painful for you, but I guess if the scope is limited then you've got the best you can have.
1