Design Patterns · Junior · Question 60 of 75
Which comments are most valuable?
- ✓Correct answer: Those that explain why something is done (a constraint, a workaround), not what the code does
- 2Comments repeating every line
- 3Commented-out old code
Explanation
If a comment explains what code does, clearer names or an extracted function usually make it unnecessary.