diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-02 15:54:21 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-02 15:54:21 +0000 |
commit | 4e4880beb683da452471448d25b1ff10a763e0d9 (patch) | |
tree | dd2149a8c3b696cb6412a1e17980596cdeac2524 | |
parent | 09ae335f48fc5378b8e09a1900840555ff795f45 (diff) | |
download | ATCD-4e4880beb683da452471448d25b1ff10a763e0d9.tar.gz |
added non-negated condition guideline
-rw-r--r-- | etc/ACE-guidelines.html | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/etc/ACE-guidelines.html b/etc/ACE-guidelines.html index 28978806ca1..e339cdcb4f1 100644 --- a/etc/ACE-guidelines.html +++ b/etc/ACE-guidelines.html @@ -264,6 +264,33 @@ to Graham for providing the OSE tools!<p> declaration is seen. Of course, we should avoid using static variables at all.<p> + <li>It is usually clearer to write conditionals that have + both branches without a negated condition. For example,<p> + + <pre> + if (test) + { + // true branch + } + else + { + // false branch + } + </pre><p> + + is preferred over:<p> + + <pre> + if (! test) + { + // false test branch + } + else + { + // true test branch + } + </pre><p> + <li>If a cast is necessary, avoid use of ANSI-style casts, <em>e.g.</em>, <code>int (foo)</code>. Instead, use the ACE_static_cast macro: @@ -383,7 +410,7 @@ to Graham for providing the OSE tools!<p> <hr> <!-- hhmts start --> -Last modified: Mon Nov 10 18:27:08 CST 1997 +Last modified: Tue Dec 2 09:54:01 CST 1997 <!-- hhmts end --> </body> |