6 ms·
I feel like this comes up here and there, and generally what I think is these probably aren't good functions. Enums won't save you from all the twisting and tur
by camgunz 2y ago
I feel like this comes up here and there, and generally what I think is these probably aren't good functions. Enums won't save you from all the twisting and turning you're doing in a function that takes 3 booleans.
Rules like this aren't that useful IMO. What if you have like a SetActive(bool active) method? Does this also get an enum? Should this be two methods? Blah blah blah. You can only cultivate taste with experience and consideration, not with rules. Everyone's seen codebases that followed all the rules but were still total messes. Or as Tool said: think for yourself; question authority.
- yellowapple 2y ago> What if you have like a SetActive(bool active) method? Does this also get an enum? I'd be inclined to do away with the argument entirely, instead going with separate SetActive() and SetInactive() methods.
- camgunz 2y ago>> I'd be inclined to do away with the argument entirely > Should this be two methods? Blah blah blah.