465
Peak code reuse (eviltoast.org)
you are viewing a single comment's thread
view the rest of the comments
[-] cupcakezealot@piefed.blahaj.zone 56 points 1 month ago* (last edited 1 month ago)
bool isOdd(int num) {  
	const oddNumbers = [];  
	for (let i = 1; i <= 10000000; i += 2) {  
  		oddNumbers.push(i);  
	}  
	if (oddNumbers.includes(num) {  
		return true;  
	}  
}  
[-] cupcakezealot@piefed.blahaj.zone 21 points 1 month ago

this incident has been reported

[-] moseschrute@piefed.social 11 points 1 month ago* (last edited 1 month ago)

Maybe memo just to be safe, but LGTM!

[-] marcos@lemmy.world 4 points 1 month ago

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

[-] schema@lemmy.world 1 points 1 month ago

And if not, unicorns!

this post was submitted on 12 Sep 2025
465 points (100.0% liked)

Programmer Humor

26898 readers
487 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