• Traister101@lemmy.today
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    10 months ago

    Looking at code on somebody else’s screen is entirely missing the point of using tabs over spaces. The entire point is that mine looks like how I want and theirs looks like how they want even though the file is identical. We can each have wildly different tab width and it’ll look wildly different to each of us when we program. That’s again the point.

    Code formatters are great! I love them. Using tabs over spaces is objectively a better formatting option. One of my favorite features in code formatters is that they’ll swap out spaces to tabs for you insane people who insist on mashing the space bar to indent.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      edit-2
      10 months ago

      Umm, you do realize no one manually enters all of the spaces, right? Basically all editors support an expandtab feature which inserts the amount of spaces you want whenever you hit the tab key.

      Code formatters behave exactly the same regardless if you’re using tabs or spaces, so not sure what you’re talking about.

      I did not miss the point. I fully understand that’s why people want tabs. I just think it’s a pretty stupid and petty reason to make for a worse experience when viewing code in places you don’t control. I still don’t know why using spaces is an issue when we enforce standards in literally every other facet of contributing to a codebase. We enforce coding styles. Indentation is part of the coding style.

    • lemmyng@lemmy.ca
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      10 months ago

      No, it’s not missing the point. The premise that you’re always looking at code on the same screen is false, and you don’t always have control over how all screens are configured.