3 ms·
Why not describe your decisions in the code?
by heavenlyblue 6y ago
Why not describe your decisions in the code?
- eindiran 6y agoThe behavior of your code changes, so comments need to be regularly updated to reflect the current reality. You do want context there (in the comments), but often greater context (detailed information, that may go out of scope, or not reflect the current implementation of something) should be preserved elsewhere so you know a year from now why you made a decision. You could keep all the information in the comments and be disciplined about updating them. But when you want to understand something that has changed, you end up needing to remember to go looking in the correct commits for the comments you made at that time. I personally just prefer dated, static notes that won't change and are easy to grep.
- heavenlyblue 6y agoI mean keeping the history of decisions in code.