this post was submitted on 07 Oct 2025
423 points (99.1% liked)

Programmer Humor

26827 readers
2105 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
top 40 comments
sorted by: hot top controversial new old
[–] 18107@aussie.zone 45 points 4 days ago* (last edited 4 days ago) (3 children)

Is "main" a valid Java identifier?

yes

package main;

public class main {

    static main main;
    String Main;

    main(String main) {
        Main = main;
    }

    main(main main) {
        System.out.println(main.Main);
    }

    main main(main main) {
        return new main(main);
    }

    public static void main(main...Main) {
        main:
        for (main main : Main) {
            main = (main instanceof Main) ? new main(main): main.main(main);
            break main;
        }
    }

    public static void main(String[] args) {
        main = new main("main");
        main.main(main, main);
        main = main.new Main(main) {
            main main(main main) {
                return ((Main)main).main();
            }
        };
        main.main(main);
        main.main(main,main);
    }

    abstract class Main extends main {
        Main(main main) {
            super("main");
        }

        main main() {
            main.Main = "Main";
            return main;
        }
    }
}

[–] luciferofastora@feddit.org 19 points 3 days ago (1 children)
[–] rikudou@lemmings.world 17 points 3 days ago

Main, obviously.

[–] killeronthecorner@lemmy.world 3 points 3 days ago

This is your main on drugs 🍳

[–] whimsy@lemmy.zip 51 points 4 days ago (1 children)

Semantic satiation. Or whatever it's called, i think ive officially lost it after reading this

[–] bytesonbike@discuss.online 4 points 4 days ago

I read the code like half a dozen times and my brain hurts.

[–] UnderpantsWeevil@lemmy.world 40 points 4 days ago
[–] 01189998819991197253 5 points 3 days ago

Plot twist: it returns the bios serial.

[–] HakunaHafada@lemmy.dbzer0.com 20 points 4 days ago
[–] Not_mikey@lemmy.dbzer0.com 21 points 4 days ago* (last edited 4 days ago) (2 children)

I can see how this may be useful. My understanding is that this is go lang and the person created a wrapper type UUID and this function takes the go standard library uuid.UUID and returns the wrapped UUID.

The wrapped UUID could be useful as you can then define methods for it like toInt() or something to make it implement some ID interface you have set up. It's a common pattern in go to create a thin wrapper around an imported type so you can implement all the methods required for some interface you defined. It does make naming those thin wrappers hard because what are you supposed to name the struct that just contains a uuid?

[–] rikudou@lemmings.world 16 points 3 days ago

Yep, that person would be me and that's exactly what I was doing, just found it funny that there was so many uuids in the piece of code.

Originally the function was named FromUuid but I couldn't resist renaming it to make it even better.

[–] ByteJunk@lemmy.world 6 points 4 days ago

Clearly, the answer is uuid.

[–] mushroommunk@lemmy.today 18 points 4 days ago

When you get a new boss at Twitter who ranks people by lines of code written

[–] PattyMcB@lemmy.world 21 points 4 days ago

Where did i put that Spiderman x3 pointing meme?

[–] jbrains@sh.itjust.works 18 points 4 days ago

New Dutch programming language just dropped.

[–] carrylex@lemmy.world 4 points 3 days ago

I've read so many tutorials like this. func Func Myfunc()

If you write textbooks like this you and your family should be boiled in sewage.

Why I love the Into trait in rust

[–] HeyThisIsntTheYMCA@lemmy.world 3 points 3 days ago (1 children)

i've now read UUID so many times i'm starting to think it's some kind of sex disease

[–] rikudou@lemmings.world 2 points 3 days ago (1 children)

That must one awkward conversation... "Can you explain where did you get the uuid from?"

i told you last logic loop NO

[–] xoggy@programming.dev 3 points 3 days ago (1 children)

The feeling you get when searching your codebase for references to your "uid" variable but this cheeky boy keeps popping up.

[–] cbazero@programming.dev 3 points 3 days ago

n, n, n, nn, nnnnnnnnnnnnnnnnnnn, n, nn, n, n,n ....

[–] fubarx@lemmy.world 6 points 4 days ago (2 children)

If this was C:

#define uuID func
#define uuiD return
[–] boonhet@sopuli.xyz 4 points 4 days ago

#define satan fubarx

[–] Cevilia@lemmy.blahaj.zone 4 points 3 days ago (2 children)

Picture isn't loading for me?

[–] mere@lemmy.blahaj.zone 1 points 1 day ago (1 children)

are you from the UK by any chance

[–] irelephant@lemmy.dbzer0.com 9 points 3 days ago (1 children)
[–] Cevilia@lemmy.blahaj.zone 4 points 3 days ago

Thanks, kind stranger. And wow, I haven't seen that much UUID since I coded for Second Life.

[–] paequ2@lemmy.today 4 points 4 days ago* (last edited 4 days ago) (1 children)

Not exactly the same, but this reminded me of the MuffinMail.MuffinHash.MuffinHash talk: https://www.youtube.com/watch?v=o9pEzgHorH0

[–] Randelung@lemmy.world 1 points 4 days ago

A colleague wrote Java style Python. SomethingDispatcher().dispatch() all the way. It's a mess. Poor guy was thrown into the deep end and left alone for a year. I don't blame him for the outcome.

Meanwhile, functools.partial is one of my favorite tools. I wrote a whole SCADA system in which the initialization just builds data pathways using functools.partial so that incoming event callbacks can be handled with all necessary resources already in scope. Any missing data is made apparent at init, not at event time. It's fast and stable (and I'm pretty proud of it lol).

[–] MonkderVierte@lemmy.zip 2 points 3 days ago
[–] four@lemmy.zip 1 points 4 days ago (2 children)

Shouldnt it be return UUID { uuid: uuid.uuid } ?

I think it would make more sense AND more uuid per UUID

[–] rikudou@lemmings.world 3 points 3 days ago (1 children)

The first UUID is a local type, the second is the name of an embedded struct, the third is the name of the variable.

The struct looks something like this (writing this on my phone)

type UUID struct { uuid.UUID }

So, basically, this is a custom wrapper for a third party UUID implementation.

[–] four@lemmy.zip 1 points 3 days ago

Ahh, that makes sense then

[–] boonhet@sopuli.xyz 1 points 4 days ago

I'm assuming it's a map/dictionary notation here, rather than a type hint

[–] tdawg@lemmy.world 1 points 4 days ago

My coworkers also introduce needless additions to the call stack