- Making it hard to see what the business logic is through the routing logic.
- It’s all too easy to increase coupling by bringing things together than don’t need to be. Making code harder to read and change.
- The third problem with if statements is that you have to simulate execution in your own head. That’s taking away from your mental energy, energy that would be better spent thinking about solving the problem, rather than how the intracate code branches weave together.
Pattern 1: Boolean Params
Pattern 2: Switch to Polymorphism
Pattern 3: NullObject/Optional over null passing
Pattern 4: Inline statements into expressions
Pattern 5: Give a coping strategy