• vinnymac@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 hours ago

    These days it’s very common to write whatever code you want, and a formatter automatically rewrites it to conform to the projects rules during precommit.

    Which is great because it allows you to focus on intent instead of format, and completely avoids any team disagreements or change rejections for trivial bullshit.

    • Zarobi@aussie.zone
      link
      fedilink
      English
      arrow-up
      4
      ·
      6 hours ago

      My favourite part is when your style or the auto formatter changes over time and you have to decide between:

      • running the auto formatter on 200,000 12 year old code files
      • doing them one by one
      • formatting them when you have to change that file
      • or ignoring all the warnings forever (it’s this one, this is what you do)

      Plus it doesn’t fix the problem of auto formatters writing ugly code. You can’t easily tell the auto formatter that early returns can be bracketless for brevity, but nothing else can be. Unless you add a comment like \\ ignore-rule-2753674 which makes me want to throw up