Enums Are Evil
There are 1 entries for the tag Enums Are Evil

This is actually about the state pattern. but let me talk first a bit about enums.  A big thing to think about is that "if" statements and especially "switch" statements can sometimes be a code smell.  Enums, in particular, can be a sign that something is wrong with your code. Here's an exercise to see exactly why enums are a problem: take some code you've written (not somebody else's:  other people's code is always bad...) and identify an enum that you've defined.  An enum with a large number of values is particularly promising, but even tri-states can illustrate the problem. ...