News for hackers. Stuff that matters.
Re:Best practices for writing code comments by marcos100 on Friday December 24, 2021 @03:45PM (#29677565)
Function comments should explain what it does, and comments inside functions should explain the how.

  // Receives n >= 0 and returns the n'th fibonacci number
  int fib(int n) {
      // We use the memoized version of the algorithm.
  }
Re:Best practices for writing code comments by gergi on Friday December 24, 2021 @04:30PM (#29677925)
The code should explain what it does. In-line comments should provide explanation for any non-intuitive code that can’t be refactored to an intuitive state. The function comments should be about the intent of the code.