DEV Community

Discussion on: Which contentious opinions in programming actually matter?

Collapse
 
jdsteinhauser profile image
Jason Steinhauser

There are some cases where comments are absolutely necessary. Some examples from my career:

  • Manually unrolling nested for loops for decreasing processing time
  • Implementing Ordinary Differential Equation solvers
  • Implementing algorithms from scientific whitepapers and having a customer that requires links to the whitepapers and explanations for any variations from the original algorithm (usually for performance).
  • Having comment-to-code ratio as a quality metric.

In general, though, most code I've written or reviewed has been pretty self-documenting. It gets tricky with numerical methods though, since we haven't fully embraced symbolic computing yet.