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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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