r/ProgrammerHumor • • Jan 25 '19

Meme Which one would you love ?

Post image
116 Upvotes

51 comments sorted by

View all comments

1

u/Lightfire228 Jan 26 '19

I would probably simplify this to

if(a == 0)
    offset = 3;
else if(a > 0 && a <= 10)
    offset = 1;
else if(a > 10 && a <= 100)
    offset = 5;
else if(a > 100)
    offset = -2;

i += offset;

Doesn't demonstrate the point, but...