|Re: Possible to write compiler to Java VM? email@example.com (1996-01-29)|
|Re: marking mystery code firstname.lastname@example.org (1996-02-13)|
|Re: marking mystery code email@example.com (Ted Dennison) (1996-02-14)|
|Re: marking mystery code firstname.lastname@example.org (1996-02-14)|
|Re: marking mystery code email@example.com (1996-02-16)|
|Re: marking mystery code firstname.lastname@example.org (1996-02-16)|
|Re: marking mystery code email@example.com (Mitchell Perilstein) (1996-02-16)|
|Re: marking mystery code firstname.lastname@example.org (Toon Moene) (1996-02-16)|
|Re: marking mystery code email@example.com (1996-02-17)|
|Re: marking mystery code firstname.lastname@example.org (1996-02-19)|
|Re: marking mystery code email@example.com (James Kanze US/ESC 60/3/141 #40763) (1996-02-21)|
|Re: marking mystery code firstname.lastname@example.org (1996-02-24)|
|From:||email@example.com (John Hagerman)|
|Date:||16 Feb 1996 23:42:17 -0500|
|Organization:||Carnegie Mellon University|
|References:||96-01-116 96-02-138 96-02-156|
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.
Ted Dennison <firstname.lastname@example.org> writes:
> 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?
I remember seeing something related to this in comp.risks. (I tried
to find it in the archives without success -- is there a web site
providing such ability? http://catless.ncl.ac.uk/Risks gave nothing.)
As I recall, a programmer on a large project found some dead code and
deleted it; for some reason this caused a failure at a future date, so
the company adopted a policy of "Never delete code."
Sorry for the lack of details -- help me out here.
My style is (1) never be shy about adding comments, (2) always make
comments painfully clear, and (3) leave history -- code or comments,
as appropriate, with annotations. Number (4) would be to only replace
erroneous code and comments when I'm really sure I know what was wrong
and how to fix it, but I don't want to include this in the main list
because it has bitten me more than once.
[My recollection was that the code was something like this:
if(a<0) goto A;
if(a=0) goto B;
if(a<0) goto C;
halt; -- cannot happen
and it happened. -John]
Return to the
Search the comp.compilers archives again.