• xigoi@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    1 year ago

    Tabs let you define how big you want each indent to be

    …except when they don’t. Many common environments have a hardcoded tab size of 8, which is insanely big for using it for indentation.

    • IRQBreaker@startrek.website
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      As an embedded software developer that does linux kernel drivers I’ve come to love the tab size 8 indentation level.

      I’m paraphrasing: “if your indentation level gets too deep, it’s time to rethink/refactor your function.”

      And with tab 8 you’ll notice it rather quick if your function does too much/unrelated stuff.

      A function should be short and do one thing only, if possible. It also makes unit testing easier if that’s a requirement.

      • xigoi@lemmy.sdf.org
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        When you’re operating on such a low level of abstraction, it’s no wonder you don’t need deep nesting.