home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.software-eng
- Path: sparky!uunet!pmafire!mica.inel.gov!whg
- From: whg@inel.gov (Bill Gray)
- Subject: Re: C Code Layout
- Message-ID: <1992Dec17.171815.1699@inel.gov>
- Sender: news@inel.gov
- Organization: Idaho National Engineering Laboratory, Idaho Falls, Idaho
- References: <1992Dec15.023235.17090@seq.uncwil.edu> <45360002@hpcuhe.cup.hp.com>
- Date: Thu, 17 Dec 92 17:18:15 GMT
- Lines: 46
-
- In article <45360002@hpcuhe.cup.hp.com>, defaria@hpcuhe.cup.hp.com (Andy DeFaria) writes:
- |> ...
- |> if (condition) {
- |> statement;
- |> } /* if */
- |> ...
- |>
- |> if (condition) {
- |> statement;
- |> } else {
- |> statement;
- |> } /* if */
-
- My $0.02:
-
- if ( condition ) {
- stuff;
- }/* if */
- ^ ^^
- The closing comment lines up with "stuff".
- The closing "}" lines up with the opening "if".
-
-
- if ( condition ) {
- stuff;
- }/* if */
- else {
- more_stuff;
- }/* else */
-
- Sometimes, if it's longer and more complex than it should be, the
- closing comment includes the condition:
-
- }/* if ( condition ) */
- ========== long legal disclaimer follows, press n to skip ===========
-
- Neither the United States Government or the Idaho National Engineering
- Laboratory or any of their employees, makes any warranty, whatsoever,
- implied, or assumes any legal liability or responsibility regarding any
- information, disclosed, or represents that its use would not infringe
- privately owned rights. No specific reference constitutes or implies
- endorsement, recommendation, or favoring by the United States
- Government or the Idaho National Engineering Laboratory. The views and
- opinions expressed herein do not necessarily reflect those of the
- United States Government or the Idaho National Engineering Laboratory,
- and shall not be used for advertising or product endorsement purposes.
-