• ☂️-@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    comment the code! tell future you why is that needed and what its doing.

    • Tamo240@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Write better code, with good names and sensible interfaces. Comments can get bugs just like code, but it doesn’t have a compiler or unit tests, so only code review keeps it aligned.

  • 𝘋𝘪𝘳𝘬@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Write an ungodly large amount of code-comments - up to a point where you add 20 lines of explanations to a 6 lines long function where two lines are variables assignments.

    Source code is for humans to read. The compiler ignores the comments.