The Psychology of Quality and More |
CHAPTER 4 : Commenting
4.9 The preprocessor and commentsComments are typically removed by the preprocessor. Thus, they can be put virtually anywhere, except inside quoted strings (although some compilers have trouble with this!). 4.9.1 Nesting commentsComments do not nest, although some compilers still allow it. It is simply bad practice to ever do this (even if you did, it could be difficult to find matching start and end tokens). Complete areas of code can still be 'commented out' (a practice which can be useful during debugging) by using conditional compilation. '#if 0...#endif' works, but is a little unclear. '#ifdef UNDEFINED...#endif' is better. The non-compiled code can be isolated further from the rest of the code by using comment bars to delimit the commented-out section:
#ifdef UNDEFINED /** COMMENTED OUT CODE #ifdef UNDEFINED /** COMMENTED OUT CODE
*************************************/ --------------------------------------------
|
Site Menu |
Quality: | Quality Toolbook | Tools of the Trade | Improvement Encyclopedia | Quality Articles | Being Creative | Being Persuasive | |
And: | C Style (Book) | Stories | Articles | Bookstore | My Photos | About | Contact | |
Settings: | Computer layout | Mobile layout | Small font | Medium font | Large font | Translate | |
You can buy books here |
And the big |