Justin James
Mar 6, 2022

Not only have you not actually proven it's faster, you've failed to mention the trade off (now you have more stuff in memory), *and* on top of that, the code is so much less readable... all for what, exactly? Let's imagine this was faster... how much faster could it be? Enough to justify this? How many apps hit an if or a switch so frequently that this is where we choose to do our optimization? How much extra time does it take to instantiate this rather than just follow the if or switch?

This is the very definition of a premature optimization. I would be absolutely horrified to see this tangled mess of spaghetti code on an actual application in the quest to shave a millisecond or two of actual run time operation.

J.Ja

Justin James
Justin James

Written by Justin James

OutSystems MVP & longtime technical writer

No responses yet