this post was submitted on 07 May 2024
623 points (97.6% liked)

Programmer Humor

19315 readers
96 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 1 year ago
MODERATORS
(page 2) 50 comments
sorted by: hot top controversial new old
[–] Kolanaki@yiffit.net 5 points 4 months ago (3 children)

Was just talking about gaming genre names being kinda lame (roguelike? Souls-like? Where's the originality?!) and this just furthers my point as programming and video games are intrinsically linked.

load more comments (3 replies)
[–] sirico@feddit.uk 3 points 4 months ago (1 children)

It took me too long to figure out the I in an if statement was just integer

[–] PotatoesFall@discuss.tchncs.de 2 points 4 months ago

In a for statement, it often refers to index

[–] PoolloverNathan@programming.dev 3 points 4 months ago (1 children)

I present to you quality variable names. (and a Mount Rustmore)

(Reconfigure(f), 'c') => {
    let mut p: Vec<&str> = vec![];
    loop {
        match args.next() {
            Some(k) => {
                if k == "=" {
                    match args.next() {
                        None => q("need value for Rc"),
                        Some(v) => u(
                            f,
                            |f| Box::new(
                                |c| {
                                    f(c);
                                    c.set(p.iter().copied(), v);
                                    for e in p {
                                        unsafe {
                                            Box::<str>::from_raw(
                                                std::mem::transmute(e)
                                            );
                                        }
                                    }
                                }
                            )
                        )
                    };
                    break
                } else {
                    p.push(Box::leak(k.into()));
                }
            }
            None => error("need path element or = for Rc"),
        }
    }
},
[–] lseif@sopuli.xyz 1 points 4 months ago (1 children)
[–] PoolloverNathan@programming.dev 2 points 4 months ago

Argument parsing; turning Rc foo = bar into Reconfigure(|c| c.foo = "bar").

[–] JoYo@lemmy.ml 3 points 4 months ago* (last edited 4 months ago)

^- triggered

[–] kromem@lemmy.world 3 points 4 months ago (1 children)

Ok, but what variable is 🐈?

[–] driving_crooner@lemmy.eco.br 2 points 4 months ago

Is the function to con🐈eate and print.

[–] exanime@lemmy.today 1 points 4 months ago

How dare you.... <Eye squint>

load more comments
view more: ‹ prev next ›