File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ TITLE: C++ Comments Coding Conventions
2+
3+ Good comments
4+ =============
5+ Generally, it's best to let the code itself explain what it does, whereas
6+ the comments are there to describe why it's like that. Do not write comments
7+ that don't add to the reader's understanding of what's going on.
8+
9+ XXX comments
10+ ============
11+ Oftentimes, when you're in the middle of implementing something and you don't
12+ want to distract on the details that should be implemented or improved in
13+ future, add an XXX comment:
14+
15+ strcpy_s(params, sizeof(params), GetCommandLine());
16+ // XXX: allocate dynamically to handle long command lines
17+
18+ For one thing, this tells anyone reading your code that it's still unstable,
19+ and also points out where the known problems are. For another, if you don't
20+ mark the problems now, they'll be a lot harder to find a week or a year from
21+ now, when you're ready to revisit your old code.
You can’t perform that action at this time.
0 commit comments