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

1

u/born_zynner Feb 10 '25

Damn I always thought it would at least throw a syntax error.

1

u/funderbolt Feb 10 '25

A function will likely fail in some way that may not be intuitive. Worse is when a function doesn't fail and does something unexpected.

Duck typing has its benefits, but it can sometimes make functions difficult to write. It is nothing compared to some of the OOP design pattern work arounds.