this post was submitted on 15 Jul 2025
459 points (94.9% liked)

Programmer Humor

37249 readers
10 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
(page 3) 50 comments
sorted by: hot top controversial new old
[–] ClathrateG@hexbear.net 7 points 3 days ago* (last edited 3 days ago) (1 children)

apart from everything else, have they never heard of a switch statement

load more comments (1 replies)
[–] WraithGear@lemmy.world 1 points 2 days ago* (last edited 2 days ago) (4 children)

Would this be a case of modulo saving the day?

Like: If Number modulo 2 = 0, true

This has to be taken out of context

load more comments (4 replies)
[–] Packet@hexbear.net 3 points 3 days ago

The end user yearns for their machine to be utilized fully, so instead of that, you can import full deepseek model to do the task

[–] Midnitte@beehaw.org 5 points 3 days ago

When did Thor become the dev for Yandere Simulator?

[–] FunkyStuff@hexbear.net 4 points 3 days ago* (last edited 3 days ago)

Throwback to when someone shared the OG version of this meme to my uni chat, I replied with "Oh you can simply do

def is_even(n: int) -> boolean:
    if n > 0 return not is_even(n - 1)
    elif n < 0 return not is_even(n + 1)
    else return True

And instead of laughing at the joke the TA in the chat said "When you start getting internships you'll do n % 2" like I was being serious.

[–] Valmond@lemmy.world 1 points 2 days ago
[–] dsilverz@calckey.world 2 points 3 days ago (1 children)

@sirico@feddit.uk

private bool isEven(int number){
    	bool result = true;
    	while (number > 0){
    		number = number - 1;
    		if (result == true)
    			result = false;
    		else
    			result = true;
    	}
    	return result;
    }

(P.S.: Only works for positive numbers)

[–] jaupsinluggies@feddit.uk 3 points 3 days ago

This works for both positive and negative numbers:

private static bool isEven(int number)
{
	bool result = true;

	while (number < 0)
	{
		number = number - 1;
		if (result == true)
			result = false;
		else
			result = true;
	}
	while (number > 0)
	{
		number = number - 1;
		if (result == true)
			result = false;
		else
			result = true;
	}
	return result;
}

Output:

isEven(4) = True
isEven(5) = False
isEven(-4) = True
isEven(-5) = False
[–] jerkface@lemmy.ca 2 points 3 days ago (6 children)

what's the humour supposed to be

load more comments (6 replies)
[–] tulliandar@lemmy.world 2 points 3 days ago (1 children)

Why is it all in italics?! I’d reject the PR just for that. Otherwise LGTM

load more comments
view more: ‹ prev next ›