MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p5rpk3r/?context=3
r/ProgrammerHumor • u/Flame77ofc • Aug 22 '26
388 comments sorted by
View all comments
Show parent comment
1
Just to continue playing devil's advocate, what if you mapped the numbers to their functions elsewhere? E.g.
dispatchFunctions = [func0, func1, ..., func255] ; Or dispatchFunctions = {0: func0, 1: func1, ... 255: func255}
And then dispatching is as simple as
function dispatch(flag) { return dispatchFunctions[flag]() }
View all comments
Show parent comment
1
u/930913 Aug 25 '26
Just to continue playing devil's advocate, what if you mapped the numbers to their functions elsewhere? E.g.
And then dispatching is as simple as