Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
PotatoesFall ( PotatoesFall@discuss.tchncs.de )  to Programmer Humor@programming.dev · 2 years ago

The easiest problem

discuss.tchncs.de

message-square
51
link
fedilink
363

The easiest problem

discuss.tchncs.de

PotatoesFall ( PotatoesFall@discuss.tchncs.de )  to Programmer Humor@programming.dev · 2 years ago
message-square
51
link
fedilink

https://mastodon.social/@lovegame/112402050452885908

alert-triangle
You must log in or # to comment.
  • henfredemars ( henfredemars@infosec.pub ) 
    link
    fedilink
    English
    arrow-up
    86
    ·
    2 years ago

    I worked with a developer who insisted on using the shortest names possible. God I hated debugging his code.

    I’m talking variable names like AAxynj. Everything looking like matrix math.

    • redcalcium ( redcalcium@lemmy.institute ) 
      link
      fedilink
      arrow-up
      46
      ·
      2 years ago

      Ah, must’ve been a fortran developer. I swear they have this ability to make the shortest yet the least memorable variable names. E.g. was the variable called APFLWS or APFLWD? Impossible to remember without going back and forth to recheck the definition. Autocomplete won’t help you because both variables exist.

      • henfredemars ( henfredemars@infosec.pub ) 
        link
        fedilink
        English
        arrow-up
        29
        ·
        2 years ago

        He did write some Fortran in his past! What made you think it was Fortran influence?

        • T (they/she) ( Templa@beehaw.org ) 
          link
          fedilink
          arrow-up
          7
          ·
          2 years ago

          I’d say because fortran is often used for calculations such as numerical analysis where you have x, y and z for example.

          I have written fortran code in the past and it was mainly for that.

        • redcalcium ( redcalcium@lemmy.institute ) 
          link
          fedilink
          arrow-up
          3
          ·
          2 years ago

          Your first few programming languages usually influence you the most for the rest of your career.

      • BoscoBear ( HaywardT@lemmy.sdf.org ) 
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        And the rest of you are COBOL programmers.

    • dan ( dan@upvote.au ) 
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      shortest names possible

      This film from 1975 is still relevant today: https://www.youtube.com/watch?v=7hdJQkn8rtA

  • Malix ( Malix@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    35
    ·
    2 years ago

    installing operating system: 15 minutes, give or take.

    give a name to the computer: 45 minutes

    • SturgiesYrFase ( SturgiesYrFase@lemmy.ml ) 
      link
      fedilink
      arrow-up
      13
      ·
      2 years ago

      I’ve got that shit on lockdown man.
      I name all my devices “Fuck0ff” followed by a 3 letter descriptor of what it is. E.g. - my windows install is Fuck0ffDTW for Desktop Windows, my Garuda install is Fuck0ffDTG for Desktop Garuda(it’s a flavour of Arch, btw)

      • OfficerBribe ( OfficerBribe@lemm.ee ) 
        link
        fedilink
        arrow-up
        6
        ·
        2 years ago

        What if you would have 2 devices of same type with same OS or just with OS that starts with same letter? Will you use numbers, if yes, how much leading zeroes if any you will use? If you don’t use numbers, will you add a room name? But what if there are 2 devices with same OS in the same room?

        • SturgiesYrFase ( SturgiesYrFase@lemmy.ml ) 
          link
          fedilink
          arrow-up
          6
          ·
          2 years ago

          Luckily I’m not responsible for naming my wife’s devices, otherwise the whole scheme would be up shit creak. As it stands I have a dual-boot desktop, a daily laptop, a surface pro4, and an old laptop running Ubuntu server for various self hosted stuff. I’ve managed to just use 3 letters, I assume as I amass more tech I’ll need to start adding numbers, if I have to label for rooms I’ll have more than a data hording problem.

  • MentalEdge ( MentalEdge@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    28
    ·
    2 years ago

    FullSentenceExplainingExactlyWhatItDoes(GiveThisVariable, SoItCanWork)

  • FrostyCaveman ( FrostyCaveman@lemm.ee ) 
    link
    fedilink
    arrow-up
    23
    ·
    2 years ago

    Single character variable names are my pet peeve. I even name iterator variables a real word instead of “i” now… (although writing the OG low level for loops is kinda rare for me now)

    Naming things “x”… shudder. Well, the entire world is getting to see how that idea transpires hahah

    • Mikelius ( Mikelius@lemmy.ml ) 
      link
      fedilink
      arrow-up
      17
      ·
      2 years ago

      I hate short variable names in general too, but am okay with them for iterators where i and j represent only indices, and when x/y/z represent coordinates (like a for loop going over x coordinates). In most cases I actually prefer this since it keeps me from having to think about whether I’m looking at an integer iterator or object/dictionary iterator loop, as long as the loop remains short. When it gets to be ridiculous in size, even i and j are annoying. Any other short names are a no go for me though. And my god, the abbreviations… Those are the worst.

      • FrostyCaveman ( FrostyCaveman@lemm.ee ) 
        link
        fedilink
        arrow-up
        6
        ·
        2 years ago

        That’s very reasonable, I can get behind that. (my stance is a partly irrational overreaction and I’m totally aware of it lol)

        Abbreviations are definitely annoying. My least favourite thing to do with them is “Hungarian notation”. It’s like… in a statically typed context it’s useless, and in a dynamically typed context it’s like… kind of a sign you need to refactor

        • Cethin ( Cethin@lemmy.zip ) 
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 years ago

          Hungarian notation makes sense in a dynamically typed usage (which I despise, but this essentially makes them notationally typed at least) or where you’re editor/IDE is so simple it can’t give you more information, which I can’t see ever being the case in the modern day.

        • Redkey ( Redkey@programming.dev ) 
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          Most people use the term “Hungarian Notation” to mean only adding an indicator of type to a variable or function name. While this is one of the ways in which it has been used (and actually made sense in certain old environments, although those days are long, long behind us now), it’s not the only way that it can be used.

          We can use the same concept (prepending or appending an indicator from a standard selection) to denote other, more useful categories that the environment won’t keep straight for us, or won’t warn us about in easy-to-understand ways. In my own projects I usually append a single letter to the ends of my variable names to indicate scope, which helps me stay more modular, and also allows me to choose sensible variable names without fear of clashing with something else I’ve forgotten about.

    • Cethin ( Cethin@lemmy.zip ) 
      link
      fedilink
      English
      arrow-up
      8
      ·
      2 years ago

      X, y, and z should only be used when working with things with dimensions larger than 1. Indexing into a 2D array, x and y are great uses. I’m also totally fine with i and j for indexer/iterator when appropriate, but I hate when people try to make short variable names for no good reason. We have auto-complete just about everywhere now. Make the names descriptive. There’s literally no reason not to.

      • Hazzia ( Hazzia@discuss.tchncs.de ) 
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        2 years ago

        deleted by creator

        • Bobbettes ( Bobbettes@lemm.ee ) 
          link
          fedilink
          arrow-up
          7
          ·
          2 years ago

          Vim can have autocomplete.

        • sparkle ( sparkle@lemm.ee ) 
          link
          fedilink
          arrow-up
          3
          ·
          2 years ago

          Everywhere CIVILIZED*

        • PoolloverNathan ( PoolloverNathan@programming.dev ) 
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          Press XN, I dare you.

    • nicky7 ( nicky7@lemmy.ml ) 
      link
      fedilink
      arrow-up
      3
      ·
      2 years ago

      Same, except for list comprehension in python, I prefer sinlge character var names there.

  • lars ( lars@lemmy.sdf.org ) 
    link
    fedilink
    arrow-up
    21
    ·
    2 years ago

    An important professor constantly and frustratingly said

    we can call this variable whatever we want, so we’ll call it Fred

    Made me panic and irate and focus on the wrong part of the problem. Every. Single. Time.

  • Aisteru ( aisteru@lemmy.aisteru.ch ) 
    link
    fedilink
    arrow-up
    18
    ·
    2 years ago

    There are only two hard things in computer science: cache invalidation and naming things.

    • gudu ( gudu@programming.dev ) 
      link
      fedilink
      arrow-up
      28
      ·
      2 years ago

      And off by one errors

      • apotheotic (she/her) ( apotheotic@beehaw.org ) 
        link
        fedilink
        English
        arrow-up
        8
        ·
        2 years ago

        Yeah, there are 2 hard things.

        0: off by one errors 1: cache invalidation 2: naming things

      • jonsnothere ( jonsnothere@beehaw.org ) 
        link
        fedilink
        arrow-up
        4
        ·
        2 years ago

        And DNS issues

  • JATtho ( JATtho@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    16
    ·
    2 years ago

    name your function as malloc() and see to world burn and generate bugs at factorial rate.

  • some_guy ( some_guy@lemmy.sdf.org ) 
    link
    fedilink
    arrow-up
    15
    ·
    2 years ago

    Why is no one giving credit to my friend n?!

  • RandomVideos ( RandomVideos@programming.dev ) 
    link
    fedilink
    arrow-up
    13
    ·
    2 years ago

    Since a lot of the english words i know i learned from minecraft, in a farming simulator i named tilled soil"hoed"

    I had multiple variables like int isHoed

    • velvetThunder ( velvetThunder@lemmy.zip ) 
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 years ago

      There’s some hoed in this house If you see 'em, point 'em out

  • Homosexual sapiens ( Strawberry@lemmy.blahaj.zone ) 
    link
    fedilink
    arrow-up
    13
    ·
    2 years ago

    mathematician here, where is the joke?

    • KillingTimeItself ( KillingTimeItself@lemmy.dbzer0.com ) Banned
      link
      fedilink
      English
      arrow-up
      7
      ·
      2 years ago

      in the linux community it’s really common to have applications like MPD, music player daemon, or MPC, music player client, and ncmpc, ncurses music player client, and ncmpcpp the aforementioned one with ++ tacked onto the end.

      Cmus, which from what i can recall is literally “c music player”

      etc…

      • PoolloverNathan ( PoolloverNathan@programming.dev ) 
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        fia? fir? fib (part of fia)?

        • KillingTimeItself ( KillingTimeItself@lemmy.dbzer0.com ) Banned
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 years ago

          exercise left up to the developer!

    • humbletightband ( humbletightband@lemmy.dbzer0.com ) 
      link
      fedilink
      arrow-up
      6
      ·
      2 years ago

      This joke is funny only if placed in Arnold-Atyah manifold if Kolmogorov-Ramachandran-Yu metric is defined

      • CanadaPlus ( CanadaPlus@lemmy.sdf.org ) 
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        2 years ago

        So don’t use it in non-KRY-definite AA situations, or you could get erroneous results. QQX is fine though, as long as you have non-vanishing ABCD. /s

        I wonder if Lean proofs become the new peer review like I’ve heard suggested, if mathematics might break from this, and look more compsci-ish in the future. That way non-specialists could get up to speed quickly.

  • gandalf_der_12te ( gandalf_der_12te@discuss.tchncs.de ) 
    link
    fedilink
    arrow-up
    12
    ·
    2 years ago

    How to write spaghetti code:

  • MonkderDritte ( MonkderDritte@feddit.de ) 
    link
    fedilink
    arrow-up
    6
    ·
    2 years ago

    No, that’s math.

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 🏆 ( Kolanaki@yiffit.net ) 
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 years ago

    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.

    • outer_spec ( outer_spec@lemmy.blahaj.zone ) 
      link
      fedilink
      arrow-up
      13
      ·
      2 years ago

      floats, doubles, etc are decimallikes. object-oriented programming languages are c++likes. a string that is just the word “false” is a boollike. any language easier to learn than c++ is a pythonlike. any language harder to learn than c++ is a asmlike. don’t like it? then you’re a naglike. you don’t want to be known as a naglike, do you?

      • PoolloverNathan ( PoolloverNathan@programming.dev ) 
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        Haskell, my favorite pythonlike!

  • ILikeBoobies ( ILikeBoobies@lemmy.ca ) 
    link
    fedilink
    arrow-up
    5
    ·
    2 years ago

    Am I being gaslit?

    • Ricky Rigatoni ( rickyrigatoni@lemm.ee ) 
      link
      fedilink
      arrow-up
      3
      ·
      2 years ago

      Gasboss gatelit girlkeep

  • Destide ( sirico@feddit.uk ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

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

    • PotatoesFall ( PotatoesFall@discuss.tchncs.de ) OP
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      In a for statement, it often refers to index

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
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

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

  • 422 users / day
  • 1.38K users / week
  • 3.2K users / month
  • 7.37K users / 6 months
  • 463 local subscribers
  • 33.4K subscribers
  • 1.52K Posts
  • 25K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code