• marlowe221@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    18 days ago

    “Why” comments make more sense as application complexity grows.

    You also have to consider interaction of the code with other external systems - sometimes external APIs force you to write code in ways you might not otherwise and it’s good to leave a trail for others on your team (and your future self…) about what was going on there.

    • something_random_tho@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      18 days ago

      100%. I also like to leave comments on bug fixes. Generally the more difficult the fix was to find, the longer the comment. On a couple gnarly ones we have multiple paragraphs of explanation for a single line of code.