Refactoring If Statements to Lookup Tables
This is the first in a series of posts that explore refactoring if statements. In this one, I’ll cover refactoring if statements to lookup tables. These are if statements that you can also model as a key/value pair lookup. You may know lookups by another name such as dictionaries, hash sets, maps or object literals. This depends on which language...