4 ms·
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 sev
by cryptonector 4y ago
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.
- derefr 4y agoWhat'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.
- cryptonector 4y agoYes.