• takeda@lemmy.world
    link
    fedilink
    arrow-up
    54
    arrow-down
    10
    ·
    1 year ago

    I’m Bill I don’t comment my code (except complex parts), instead I try to make code clear, including using proper variable and function names and try to keep functions short. I don’t think I ever got lost in my own code in my 20+ years of experience. Even got complements about it.

    The programming language is meant for humans to read/write, if you need to put comments to understand your code then your code sucks.

    • NuXCOM_90Percent@lemmy.zip
      link
      fedilink
      arrow-up
      35
      arrow-down
      3
      ·
      1 year ago

      Commenting is an art. Too much and it is outright misleading after the first hotfix. Too little and only the original developer can maintain it

      But uncommented code is a dick move. And, more importantly, it means you can’t punt bug fixes to the intern

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

      Use comments to describe the philisophy of the code, the why. And any non obvious extended relationships. Risk. Etc.

      Comments on function are typically a waste of space.