

Questionable Comments
9 snips Sep 18, 2023
Ben and Matt explore the purpose and characteristics of good comments in code, discuss the management of to-do comments in codebases, and emphasize the role of comments in thread safety and code understanding. They also outline the risks of leaving commented out code and suggest alternatives like source control and refactoring.
AI Snips
Chapters
Transcript
Episode notes
Avoid Comments with Better Code
- Write better code to avoid comments.
- Comments often represent deficits in code clarity.
Comments as Apologies
- Comments sometimes apologize for complicated or unintuitive code.
- They often preface "spooky action at a distance" situations.
Descriptive Variable Names
- Use descriptive variable names instead of comments like "apply interest rate".
- Write
interest_rate = 1.13
andvalue_with_interest = ...
for clarity.