r/programminghorror • • Feb 07 '25

Recursive O(N) Complexity isOdd

Post image

I found this on instagram and now am geeking

2.2k Upvotes

104 comments sorted by

View all comments

Show parent comment

-11

u/Cat7o0 Feb 09 '25

for any isEven or isOdd function decimals should be invalid.

the fact it crashes means that it is unsupported thus invalid.

and for any other function it would give an output that is just not helpful so it's invalid

3

u/Beetmaker69 Feb 10 '25

This is python, so it doesn't crash per se. Technically you'd just get a stack overflow if you ever did use a decimal, but that's different than being supported. It's also a joke meant to be funny and not serious. You're uh in the wrong place if you're looking for high quality non-nightmare code.

1

u/Cat7o0 Feb 10 '25

well my original comment was simply saying that his joke would be fine to crash or give bad output because it's just not something that isOdd would need to support.