• BaardFigur@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    edit-2
    7 months ago

    Comment smart, don’t comment every line like this

    int i = 5; // Assigns the value 5 into the variable i.

    • Maalus@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      Comment only in extraordinary situations, when something you read can confuse someone. And by that I mean the business logic, not that you used a method that’s confusing to people since they only know the basics of the language.

    • stebo02@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      I usually comment on whole groups of lines of code, so the goal of each part of the code is clear