• atheken
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    I agree with the need, but not your rationale, I’m in the “always curly braces” camp for two reasons:

    • when a second line gets added in a condition block, the braces might not get added, a bug.
    • one less decision to make while coding. Anything that removes trivial decision-making can speed up authoring and reading code.
    • rodolfo@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      well, in my rant, the bit about why do I have to add braces to fix stuff is very close to your first point, and the bit about reading while quickly scrolling to your second point, in which you say the right thing: not adding braces is something that one actively does. with no acceptable reason ever, imo.

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

        Well, a couple things:

        My points are related to provable advantages to doing it while writing code. They’re also not argumentative.

        Your points are related to a personal preference of aesthetic while reading code. They are not provable advantages. They’re also quite “ranty,” which is rarely a persuasive way to convince someone of your position.

        If you actually want to get people to change their habits around this, I think you’ll have better luck with my approach than ranting about why you don’t like how it looks.

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

          if aesthetics reason is what gets through, I’m really lost then. for sure that’s a rant. thank you, have a nice day