Highlights - Code Commentsâš‘
- If the code is confusing – I try to refactor the code so that it’s not confusing anymore.1
- If a refactoring is not possible, I document the “why”, not the “how”. The “how” is already documented: that’s the code.1
- The majority of my time as a developer will be spent reading and deciphering existing code. I need to be able to do this as quickly as possible to be efficient. If a comment helps me grok something quickly due to some weird edge-case complexity, then the comment is worth its weight in gold.1