291
Infallible Code (feddit.uk)
you are viewing a single comment's thread
view the rest of the comments
[-] Ebber@lemmings.world 12 points 2 weeks ago

I removed the tail recursion for you:

private book IsEven(int number) {
    if(number > 1) return IsEven(number - 2) == true;
    if(number == 0) return true; 
    if(number == 2) return false;
}
[-] Ferk@programming.dev 3 points 2 weeks ago

What'd be the result for IsEven(1)?

[-] Ebber@lemmings.world 5 points 2 weeks ago

Stack overflow

this post was submitted on 15 Jul 2025
291 points (100.0% liked)

Programmer Humor

25407 readers
1617 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS