Making code cleaner by replacing multiple conditionals with a strategy dictionary
If you're on a road with no forks, there's no way to get lost. But the more forks you hit, the easier it is to take the wrong path. Code works the same way. In this post, I present a strategy for handling variations in your code without relying on any forks.