this post was submitted on 15 Jul 2025
267 points (94.1% liked)

Programmer Humor

25059 readers
810 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
 
(page 2) 7 comments
sorted by: hot top controversial new old
[–] _cnt0@sh.itjust.works 3 points 2 days ago (1 children)

Not to take from all the funny answers ... but

bool IsEven(int i) => (i & 1) != 1;

(C#)

[–] _cnt0@sh.itjust.works 2 points 2 days ago (1 children)

Though, obviously I had to come up with some ridiculous solutions:

bool IsEven(int i) => ((Func<string, bool>)(s => s[^1] == 48))($"{i:B}");

This one works without conditionals :)

bool IsEven(int i)
{
    try
    {
        int _ = (i & 1) / (i & 1);
    }
    catch (Exception)
    {
        return true;
    }

    return false;
}
load more comments (1 replies)

Try coding chess next time

See ya in a few years

[–] Typewar@infosec.pub 1 points 1 day ago

Lol the amount of bullying this guy is getting lately. I've seen similar spins and bends that looks somewhat legit, making people believe he suck at coding

load more comments
view more: ‹ prev next ›