VirtualBox

Changeset 62704 in vbox


Ignore:
Timestamp:
Jul 29, 2016 8:12:40 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
109278
Message:

CodingGuidelines: do-while-false-goto-avoidance-loops are now officially frowned upon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/VBox-CodingGuidelines.cpp

    r62703 r62704  
    461461 *      - That Dijkstra is dead is no excuse for using gotos.
    462462 *
     463 *      - Using do-while-false loops to avoid gotos is considered very bad form.
     464 *        They create hard to read code.  They tend to be either too short (i.e.
     465 *        pointless) or way to long (split up the function already), making
     466 *        tracking the state is difficult and prone to bugs.  Also, they cause
     467 *        the compiler to generate suboptimal code, because the break branches
     468 *        are by preferred over the main code flow (MSC has no branch hinting!).
     469 *        Instead, do make use the 130 columns (i.e. nested ifs) and split
     470 *        the code up into more functions!
    463471 *
    464472 *
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette