• xmunk@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    2 个月前

    Not everything needs a comment - knowing when comments add value is the key… “what” vs “why” is usually a good indicator but some code just doesn’t need a comment.

    • darklamer@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      2 个月前

      Doesn’t need any comment:

      int getCount() { return count; }

      Absolutely needs a very extensive comment:

      double getBojangleFlux { return fubar * .42; }