comp.lang.ada
 help / color / mirror / Atom feed
From: claveman@inetworld.net (Charles H. Sampson)
Subject: Re: An alternative to Unchecked Conversion
Date: 1999/12/20
Date: 1999-12-20T00:00:00+00:00	[thread overview]
Message-ID: <1e33lub.2zcr15jx4fayN%claveman@inetworld.net> (raw)
In-Reply-To: 3859701a@rsl2.rslnet.net

Tom Hargraves <tharg@vtcinet.com> wrote:

> Oops. Excuse my English. I meant to express the opinion that
> Unchecked_Conversion _need_ rarely if ever be used, in 'normal' programming
> practice. So I think we are in agreement here. Why disable one of the best
> features of Ada if you don't need to :-)
> 
> I welcome comments re. the technical merits of address mapping vs.
> unchecked_conversion. For me address mapping worked fine, whereas
> unchecked_conversion did a lot of additional data copying. So that's why I
> didn't use it. What did I loose?

     I missed the beginning of this thread, although I was participating
in the other one.  Coming to in a few day late, I'm surprised to see 
that no one has mentioned what I consider the primary shortcoming of 
overlaying, the shortcoming that puts it into my personal list of for-
bidden features.

     Overlaying is one of those features that is very easy to write and
to get working "just as wanted" with little difficulty.  The problem 
with it comes during maintenance and that problem is that modification 
of one of the participants changes the values of the others.  It takes 
very little time after the overlay has been created for even the creator
to forget about it and the maintenance programmer doesn't even have the
luxury of forgetting.  All he knows is that for some reason the value of
a variable is wrong and, as he reads the code, he can't see where the 
incorrect value is being assigned.

     Of course, there are some techniques that reduce this problem.  If
a maintainer's environment supports a "find all references" capability,
then one of those references will be any overlay statements, leaving him
with the job of running down all modifications of the other partici-
pants.   Some debugging environments allow monitoring, to catch  vari-
ables the moment they change.  Unfortunately, unless you have a hardware
assist, monitoring can immensely slow down execution--not very useful in
a real-time program in particular.

     Because of this, because of the amount of time I've spent over a 
long career running down problems caused by overlaying, I'll not use it
unless absolutely necessary.  I'll use UC in preference, even in the 
rare cases when memory copying is involved, unless it can be shown that
this causes an unacceptable execution penalty.

     On the other hand, I would be against forbidding overlaying in a 
programming standard.  My preference would be to allow use only after 
justification and approval.

                                Charlie


     To get my correct email address, replace the "claveman" by
"csampson" in my fake (anti-spam) address.




      parent reply	other threads:[~1999-12-20  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-16  0:00 An alternative to Unchecked Conversion Tom_Hargraves
1999-12-16  0:00 ` Jeff Creem
1999-12-16  0:00 ` Mark A Biggar
1999-12-16  0:00 ` Matthew Heaney
1999-12-16  0:00   ` Richard D Riehle
1999-12-17  0:00     ` Ted Dennison
1999-12-17  0:00       ` Richard D Riehle
1999-12-16  0:00   ` Tom Hargraves
1999-12-16  0:00     ` DuckE
1999-12-16  0:00     ` Matthew Heaney
1999-12-17  0:00       ` Lutz Donnerhacke
1999-12-17  0:00         ` Matthew Heaney
     [not found]     ` <mhrj5s4qckk7rt1j3pu0s3r438e281pu37@4ax.com>
1999-12-17  0:00       ` Simon Wright
     [not found]         ` <g9rr5s84eeov4vvp2v9v70jo9b5uporm0v@4ax.com>
1999-12-20  0:00           ` Simon Wright
1999-12-23  0:00             ` Robert Dewar
1999-12-18  0:00       ` Rex Reges
1999-12-18  0:00         ` Matthew Heaney
1999-12-19  0:00         ` Robert Dewar
1999-12-20  0:00     ` Charles H. Sampson [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox