GunCAD Index Forums
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Rikudou_Sage@lemmings.world to Programmer Humor@programming.dev · 3 days ago

I'm not sure, but it might be something about UUIDs

lemmings.world

message-square
25
link
fedilink
291

I'm not sure, but it might be something about UUIDs

lemmings.world

Rikudou_Sage@lemmings.world to Programmer Humor@programming.dev · 3 days ago
message-square
25
link
fedilink
alert-triangle
You must log in or # to comment.
  • 𝕸𝖔𝖘𝖘@infosec.pub
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    Plot twist: it returns the bios serial.

  • 18107@aussie.zone
    link
    fedilink
    English
    arrow-up
    31
    ·
    3 days ago

    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;
            }
        }
    }
    
    • Hupf@feddit.org
      link
      fedilink
      arrow-up
      15
      ·
      2 days ago

    • luciferofastora@feddit.org
      link
      fedilink
      arrow-up
      13
      ·
      2 days ago

      Who hurt you?

      • Rikudou_Sage@lemmings.worldOP
        link
        fedilink
        arrow-up
        10
        ·
        2 days ago

        Main, obviously.

  • whimsy@lemmy.zip
    link
    fedilink
    English
    arrow-up
    37
    ·
    3 days ago

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

    • ByteOnBikes@discuss.online
      link
      fedilink
      arrow-up
      2
      ·
      3 days ago

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

  • Not_mikey@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    16
    ·
    edit-2
    3 days ago

    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_Sage@lemmings.worldOP
      link
      fedilink
      arrow-up
      13
      ·
      2 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.

  • HakunaHafada@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    12
    ·
    3 days ago

    UwUIDs

  • mushroommunk@lemmy.today
    link
    fedilink
    arrow-up
    16
    ·
    3 days ago

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

  • jbrains@sh.itjust.works
    link
    fedilink
    arrow-up
    11
    ·
    3 days ago

    New Dutch programming language just dropped.

  • xoggy@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 days ago

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

    • cbazero@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      n, n, n, nn, nnnnnnnnnnnnnnnnnnn, n, nn, n, n,n …

  • Captain Aggravated@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    7
    ·
    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.

  • ExperimentalGuy@programming.dev
    link
    fedilink
    arrow-up
    6
    ·
    3 days ago

    Why I love the Into trait in rust

  • Cevilia (she/they/…)@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 days ago

    Picture isn’t loading for me?

    • irelephant [he/him]@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      7
      ·
      2 days ago

      • Cevilia (she/they/…)@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 days ago

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

  • paequ2@lemmy.today
    link
    fedilink
    arrow-up
    3
    ·
    3 days ago

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

  • MonkderVierte@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    https://makimo.com/blog/scientific-perspective-on-naming-in-programming/

  • four@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 days ago

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

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

    • Rikudou_Sage@lemmings.worldOP
      link
      fedilink
      arrow-up
      3
      ·
      2 days ago

      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
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 days ago

        Ahh, that makes sense then

    • boonhet@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

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

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.6K users / day
  • 2.41K users / week
  • 2.42K users / month
  • 2.43K users / 6 months
  • 1 local subscriber
  • 26.8K subscribers
  • 74 Posts
  • 608 Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org