• CameronDev
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      Your link doesn’t seem to weigh super heavily on the “tabs for indentation” as a rule, only that tabs should never be for alignment.

      Tabs for alignment is definitely a recipe for madness.

      Interestingly, tabs for alignment is the correct method for word processors, so it’s backwards for code :/

      • spartanatreyu
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        1 year ago

        True, the link doesn’t go through tabs for indentation, but tabs should already be used for indentation for accessibility

        • CameronDev
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

          That could be argued for years, ill leave your preference up to you :) I’m personally in the spaces for indent camp, but realistically, as long as you match the existing codebase, it doesn’t matter.

          • spartanatreyu
            link
            fedilink
            arrow-up
            3
            arrow-down
            1
            ·
            1 year ago

            I don’t think there’s any new arguments anymore, it was all settled long ago.

            • Tabs were always useful for accessibility and DX.
            • Spaces were useful 2-3 decades ago when not all editors could handle tabs yet.

            But now all editors handle tabs.

            • CameronDev
              link
              fedilink
              arrow-up
              2
              ·
              1 year ago

              And yet, the debate still rages :D I am not sold by the tab arguments, and your probably not gonna be sold on the spaces arguments. As long as we don’t fuck with each-others codebase, it really doesn’t matter too much.

              The accessibility argument is interesting, but setting your code style to use a sufficiently large amount of spaces, and avoiding horrifically nested code seems a valid solution there as well (XML would be a strong case for tabs, other languages less so). Maybe when my eyes start to age I’ll care more about adjustable tabs :/

              • spartanatreyu
                link
                fedilink
                arrow-up
                2
                ·
                1 year ago

                There isn’t a debate anymore, the points have already been stated.

                The only reason people still talk about it is that there’s always developers learning the points for the first time.

                Don’t worry about your own eyes in some vague future, worry about other’s eyes now.

                • CameronDev
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  1 year ago

                  I think the reason that people still talk about it is that there isn’t a compelling reason on either side. There is just a series of slight benefits and drawbacks. Tabs are slightly better on braille readers, spaces are easier for consistency (when tools don’t respect .editorconfig), blah blah blah. No one is being entirely excluded due to either option being used, so it’s really a personal/team style decision.

    • kus
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      I don’t ever bother alignment. That is nuts.

    • victron
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I have some serious refactoring to do.

  • Radical Kitten Wannabe
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    The best indentation should be like any style rule chosen by the project team.

    So, I guess it should be defined in the source repository