It is SO STUPID that spaces are widely preferred for indentation in code.

For the past, I don’t know, two hours I’ve been trying to fix YAML formatting issues that could have been fixed without any human intervention if only tabs were used. (It’s a big file, hence the duration.) (I know YAML doesn’t support tabs. That’s kind of my point.)

I even reluctantly asked Gemini (forced upon me by work; I was hoping it would change my mind in this case) why anyone would prefer spaces. It said the same irrelevant thing most people say: because some tools don’t support tabs properly.

Know what that sounds like to me? A problem with the fucking tool.

I don’t know if this is the right place to post this, but I can’t think of a better option.

  • HubertManne@piefed.social
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 days ago

    I mean I feel your arguing against yourself here. its more precise to specify using a space or two spaces or three spaces, etc. like in python the formatting is the structure becasue it does not use brackets and such. File formats are exactly like they sound. specific formats. consistancy is paramount.

    • toynbee@lemmy.worldOP
      link
      fedilink
      arrow-up
      5
      ·
      3 days ago

      I acknowledge that consistency is beneficial, but Python works with both tabs and spaces. The difference, in this context, is that if you like two spaces for indentation, but I like four, your code will always have sections of two when I look at it. I can make configurations that change it and so can you, but why is that needed?

      Meanwhile, in this hypothetical, if we were to use tabs, you could set your tab to represent two spaces and I could set mine to represent four and we’d both be happy with the same, unchanged code.

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

          Consistency in how many indents used is very important.

          Consistency in how many pixels that indentation takes up on the screen between two users is completely irrelevant.

          Tabs give you consistency and simplicity, one tab per indent. We each decide how we want them to look on our screens and it doesnt matter if they don’t look exactly the same.

          What you probably mean though is alignment, which is not indentation. Tabs to indent, followed by spaces to align, gives every user the same alignment no matter what their tab-width is set to.