News for hackers. Stuff that matters.
Re:Flags Are a Code Smell (2014) by cryptonector on Sunday May 22, 2022 @03:56PM (#31472086)
It starts with one flag. A couple of years later, developments you didn't forecast have led you to adding two more flags, and now you suddenly see you need seven more and wish you'd used an enum.

This happens. It's not code smell. It's failure to forecast. An enum for one flag can be silly. Five flags instead of an enum is also silly. The latter doesn't just happen because the programmer didn't know about enums -- it happens organically over time.

Re:Flags Are a Code Smell (2014) by derefr on Sunday May 22, 2022 @04:41PM (#31472529)
What's not smelly about it? It doesn't smell of inexperience, sure; but it certainly smells like it needs a refactoring schema-migration to introduce that explicit FSM-state column.
Re:Flags Are a Code Smell (2014) by cryptonector on Monday May 23, 2022 @07:56PM (#31486336)
Yes.