DEV Community

Discussion on: Keeping your code clean by sweeping out "if" statements

Collapse
 
laughingraven profile image
Laughing Raven • Edited

If statements might not be as clever, but they are much more easy to comprehend. Clever code is often not maintainable code. Any developer can step through an if statement, but this other code example requires much more nuance. Furthermore, adding all this extra objects can't help memory consumption. Yeas early optimization is not prudent, but given the choice between options of equal initial implementation burden, choose the more perforemant