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

    • scurry@lemmy.world
      link
      fedilink
      arrow-up
      27
      ·
      1 year 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
        9
        ·
        1 year 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
          7
          ·
          1 year 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).

      • words_number@programming.dev
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        1 year ago

        Thanks for the insight! I think this kind of convention that once made some sense, is now exclusively harmful, but is still followed meticulously, is often called “tradition” and is one of the high speed engines that let humanity drive towards extinction.

        • scurry@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          1 year ago

          I agree, and these conventions are being followed less over time. Since the 1990s, Windows world, Objective-C, and C++ have been migrating away (to mixed results), and even most embedded projects have been too. The main problem is that the standard library is already like that, and one of C’s biggest selling point is that you can still use source written >40 years ago, and interact with that. So just changing that, at that point just use Go or something. I also want to say, shoutout to GNU for being just so obstinate about changing nothing except for what they make evil about style. Gotta be one of my top 5 ‘why can’t you just be good leaders, GNU?’ moments.

    • mustardman@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      17
      ·
      edit-2
      1 year 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

    • nothacking@discuss.tchncs.de
      link
      fedilink
      arrow-up
      11
      arrow-down
      1
      ·
      edit-2
      1 year 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.

    • NateSwift@beehaw.org
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 year 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