-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pavel Kovalenko
committed
Oct 1, 2014
1 parent
4d21154
commit db37986
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
TITLE: C++ Comments Coding Conventions | ||
|
||
Good comments | ||
============= | ||
Generally, it's best to let the code itself explain what it does, whereas | ||
the comments are there to describe why it's like that. Do not write comments | ||
that don't add to the reader's understanding of what's going on. | ||
|
||
XXX comments | ||
============ | ||
Oftentimes, when you're in the middle of implementing something and you don't | ||
want to distract on the details that should be implemented or improved in | ||
future, add an XXX comment: | ||
|
||
strcpy_s(params, sizeof(params), GetCommandLine()); | ||
// XXX: allocate dynamically to handle long command lines | ||
|
||
For one thing, this tells anyone reading your code that it's still unstable, | ||
and also points out where the known problems are. For another, if you don't | ||
mark the problems now, they'll be a lot harder to find a week or a year from | ||
now, when you're ready to revisit your old code. |