“It’s just easier to type” and other lies you believe

    • mustardman@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      2 years ago

      I worked with a complier that would assume only compare the first 8 characters and would treat it the same afterwards.

      Compiler copyright was around 1990.

      Edit: This was for function names in C

    • scurry@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      Yes. Memory and storage were at a very high premium until the 1990s, and when C was first being developed, it wasn’t uncommon for computers to output to printers (that’s why print() and co are named what they are), so every character was at a premium. In the latter case, you were literally paying in ink and paper by the character. These contributed to this convention that we’re still stuck with today in C.

      • zqwzzle@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        IIRC older DOS versions were also limited to 8.3 filenames, so even filenames had a max limit of 8 characters + 3 extension. May it was a limitation of the file system, can’t quite remember.

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

          At one point it was both. At one point they internally added support for longer file names in DOS, and then a later version of the filesystem also started supporting it. I think that on DOS and Windows (iirc even today), they never actually solved it, and paths on Windows and NTFS can only be 256 characters long in total or something (I don’t remember what the exact limit was/is).

    • NateSwift@beehaw.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      I’ve heard arguments that back in ye old days each row only had 80 characters and variable names were shortened so you didn’t have to scroll the page back and forth

      • Knusper@feddit.de
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        I’ve already felt like I should choose shorter names in a (shitty) project where the customer asked us to use an auto-formatter and a max line-width of 120 characters.

        Because ultimately, I choose expressive variable names for readability. But an auto-formatter gladly fucks up your readability, breaking your line at some random ass point, unless your line does not need to be broken up.

        And so you start negotiating whether you really need certain information in a variable name for the price of badly broken lines.

          • Knusper@feddit.de
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            Yeah, I meant it as an example, where I was still granted relatively luxurious conditions, but even those already caused me to compromise on variable names.

            I’d say, 95% of my lines of code do fit into 120 characters easily. It’s those 5% that pained me.

    • nothacking@discuss.tchncs.de
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      2 years ago

      They did, with core you could be paying for many dollars per bit of memory. They also often used teletypes, where you would pay in ink and time for every character.