• hstde@feddit.de
      link
      fedilink
      arrow-up
      13
      ·
      1 year ago

      There’s a comment for you to explain the why.

      Rule of thumb: code explains the how and what, comments explain the why.

    • magic_lobster_party@kbin.social
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      Those cases are rare. Often the most basic solution is good enough.

      If you have to write complex code, then you should write a comment (write the name of the algorithm for example).