this post was submitted on 12 Sep 2025
440 points (98.9% liked)

Programmer Humor

26299 readers
2002 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] cupcakezealot@piefed.blahaj.zone 47 points 2 days ago* (last edited 2 days ago) (5 children)
bool isOdd(int num) {  
	const oddNumbers = [];  
	for (let i = 1; i <= 10000000; i += 2) {  
  		oddNumbers.push(i);  
	}  
	if (oddNumbers.includes(num) {  
		return true;  
	}  
}  
[–] Malix@sopuli.xyz 16 points 2 days ago (1 children)
[–] moseschrute@piefed.social 11 points 2 days ago* (last edited 2 days ago)

Maybe memo just to be safe, but LGTM!

[–] dependencyinjection@discuss.tchncs.de 8 points 2 days ago (1 children)

this incident has been reported

[–] marcos@lemmy.world 4 points 2 days ago

You should make it oddNumbers.includes(num%10000000)...

[–] schema@lemmy.world 1 points 2 days ago

And if not, unicorns!