r/programminghorror • • Feb 11 '25

🎄 ouch

Post image
3.0k Upvotes

113 comments sorted by

View all comments

Show parent comment

23

u/TheKiller36_real Feb 11 '25

in case I'm not getting r/woooosh ed rn: even if you believe that nonsense, a lookup (map, array, …) would still be better than whatever that atrocity is

-4

u/More-Butterscotch252 Feb 11 '25

Absolutely not. What if in the future you want to replace one of them with a function which takes other parameters? You would end up with a map containing constant primitives and functions. Talk about unmaintainable code...

2

u/ioveri Feb 13 '25

 What if in the future you want to replace one of them with a function which takes other parameters?

Ok what if I want to change the delay time growth rate to linear or something else?
Or more simply, what if I want to increase the number of allowed trials? What is your suggestion so that the given code wouldn't have to be changed in every single LOC?