Is Odd Or Even

Is Odd Or Even
code-quality-memes, bad-code-memes, iseven-memes, modulo-memes, if-else-hell-memes | ProgrammerHumor.io

Someone tried to give André life advice about not needing an else after a return statement when checking odd/even numbers. André's response? "Dumb people nowadays." And honestly, he's got a point when you see Wes's masterpiece below.

Wes created a 40+ line isOdd() function that literally hardcodes every single number from 0 to 39 with individual if-else statements. You know, instead of just using n % 2 === 0 like a normal human being. It's the programming equivalent of counting on your fingers when someone asks you what 2+2 is.

The irony is beautiful: André gets lectured about code optimization while Wes is out here writing code that would make a CS101 professor weep into their keyboard. Also, what happens when you pass in 40? Does the function just... give up on life?

More Like This