Commenting Control Structures

  • if, case, loops , or long blocks of statements are natural insertion points for summary comments

  • Comment the end of control structures that span more than one page in the editor, this allows matching of begin/end more easily
     while (!bDone) {
        ...  // very long sequence of instructions here
     } // while (!bDone)

  • Treat end of loop comments as a warning indicating complicated code that should be refactored into it's own sub-routine, simplifying the parent routine

  • Rewrite any complicated code that requires tedious documentation so the tedious documentation is no longer necessary

-- ShawnDB - 16 Jun 2008

Revision: r1.1 - 16 Jun 2008 - 02:31 - Main.guest
TModeling > Software > CodeGuide > StyleGuide > Comments > CommentingControlStructures
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback