• outer_spec@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      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?

    • trolololol@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      Ha

      You should hear of the method of pretending you’re at breakfast or some other anthropomorphized situation, where you name things as butter and cheese, knife and bread, tea and teapot

      Then there’s Hungarian notation which is actually used seriously. But I can’t give an entertaining example only s boring and probably inaccurate one.

  • FrostyCaveman@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    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

    • Cethin@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      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.

    • nicky7@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

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

    • Mikelius@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      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@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        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@lemmy.zip
          link
          fedilink
          English
          arrow-up
          0
          ·
          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.

    • BleatingZombie@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      Variable names should be “self defining” meaning you should be able to understand what its doing from the name. The name also shouldn’t be too long. Combining those together makes it difficult to come up with an “elegant” name

    • KillingTimeItself@lemmy.dbzer0.comBanned
      link
      fedilink
      English
      arrow-up
      0
      ·
      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…

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        0
        ·
        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.

  • steventhedev@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 years ago

    Older C compilers would truncate a variable name if it was too long, so VeryLongGlobalConstantInsideALibraryInSeconds might accidentally collide with VeryLongGlobalConstantInsideALibraryInMinutes.

    Legend says that they used to do it after a single letter with Dennis declaring “26 variables ought to be enough for anyone”.

    • olutukko@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      I had this problem in my job as a drafter. I was wondering why the hell Tekla would complain about the same object name already being in use despite everything having its own name. took me way too long to realize there wad some stupidly max name length and the program did nothing to alarm the user about trying to put too long name. it just cut the overflow away.

  • RandomVideos@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    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

  • JATtho@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    2 years ago

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

  • Malix@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    2 years ago

    installing operating system: 15 minutes, give or take.

    give a name to the computer: 45 minutes

    • SturgiesYrFase@lemmy.mldeleted by creator
      link
      fedilink
      arrow-up
      0
      ·
      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@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        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@lemmy.mldeleted by creator
          link
          fedilink
          arrow-up
          0
          ·
          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.

  • DarkSurferZA@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 years ago

    Gotten even easier after X became a registered trademark. Now the only choice we have left is i. Or ii if you need more variables