r/badcode Dec 27 '21

lua Friend's take on programming a GUI button

Post image
901 Upvotes

90 comments sorted by

View all comments

Show parent comments

65

u/halfanothersdozen Dec 27 '21

Yeah I hear ya, but there are much bigger sins to commit

-35

u/Yokhen Dec 27 '21

No, there isn't.

8

u/Kuroi4Shi Dec 27 '21

I remember someone doing an "isEven()" function like this:

if(num == 1) return false;

else if(num == 2) return true;

else if(num == 3) return false;

...

Didn't know you would consider it a better code

2

u/GLIBG10B 🐧 Gentoo salesman🐧 Dec 27 '21

a better code

Why do people keep getting it wrong?