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
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?
1
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
Replying to @McJty
oh well. That is painful for you, but I guess if the scope is limited then you've got the best you can have.

Dec 29, 2021 ยท 10:21 AM UTC

1
Replying to @dsilverstone
Why is it painful? I don't really see a problem with that to be honest. Class/records with several booleans in it are VERY common
1
the record is fine. Its the function arguments which I find uncomfortable. Sequences of true/false withno surrounding semantics hurt my brain.
2