Re: marking mystery code

Ted Dennison <dennison@escmail.orl.mmc.com>
14 Feb 1996 21:26:15 -0500

          From comp.compilers

Related articles
Re: Possible to write compiler to Java VM? ncohen@watson.ibm.com (1996-01-29)
Re: marking mystery code dewar@cs.nyu.edu (1996-02-13)
Re: marking mystery code dennison@escmail.orl.mmc.com (Ted Dennison) (1996-02-14)
Re: marking mystery code jmccarty@spdmail.spd.dsccc.com (1996-02-14)
Re: marking mystery code jgj@ssd.hcsc.com (1996-02-16)
Re: marking mystery code hagerman@ece.cmu.edu (1996-02-16)
Re: marking mystery code mnp@compass-da.com (Mitchell Perilstein) (1996-02-16)
Re: marking mystery code toon@moene.indiv.nluug.nl (Toon Moene) (1996-02-16)
Re: marking mystery code preston@tera.com (1996-02-17)
[3 later articles]
| List of all articles for this month |
From: Ted Dennison <dennison@escmail.orl.mmc.com>
Newsgroups: comp.compilers
Date: 14 Feb 1996 21:26:15 -0500
Organization: Lockheed Martin Marine Systems
References: 96-01-116 96-02-138
Keywords: design

Robert Dewar wrote:
>
> Incidentally, the practice of marking suspicious code seems a good one
> to me. If code is being read by more than its author (often sadly not
> the case), then a reader will often wonder what something means, and
> not necessarily be able to tell if it is a bug, or if it needs more
> documentation, or perhaps some invariant that is assumed is not 100%
> right etc.


It seems like a good practice to me as well. But an even better
practice it to leave a comment describing what the code does
when you write it.


> In GNAT we use ??? for this purpose, and there are quite a few ???
> around the place. I suspect that nearly all large projects have
> numerous instances of code which merits the ??? mark, but they don't
> get marked.


When ever I come across such code, I figure out what it does and
either comment it, or rewrite it more clearly (or remove it). Is
this an uncommon practice?
--
T.E.D. (Structured programming bigot)
                                | Work - mailto:dennison@escmail.orl.mmc.com |
                                | Home - mailto:dennison@iag.net |
                                | URL - http://www.iag.net/~dennison |
[It's uncommon in programs as large as GCC. -John]


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.