comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: Software landmines (was: Why C++ is successful)
Date: 1998/08/24
Date: 1998-08-24T14:47:25-05:00	[thread overview]
Message-ID: <6rsg0d$pcj@dfw-ixnews3.ix.netcom.com> (raw)
In-Reply-To: 6rnhhe$e2u$1@nnrp1.dejanews.com

In article <6rnhhe$e2u$1@nnrp1.dejanews.com>,
	dewar@gnat.com wrote:

>... We didn't eliminate
>assignments from Ada, even though they can be (and are all the time)
>horribly misused, and even though we know perfectly well that you can
>write programs with no assignments with no loss in expressive power.

 I cannot imagine writing a large program totally devoid of assignment
 statements.  In fact, I sometimes see people programming around the
 assignment by parenthetical nesting of function returns and find it
 confusing, reminsicent of the German sentences of philosophers who,
 in an attempt to extract every nuance from an idea without leaving any
 possibility for misinterpretation, along with, what seems to be an
 attempt to avoid using an excessive number of periods in their sentences,
 construct long, dependent clause-filled sentences, the effect of which
 is to leave one, if, in fact, one is still reading, without any sense
 of what the original idea might have been from the beginning.

 Don't take away my assignment statements, Robert.  The help me write
 crisp, short code sentences that ordinary mortals can understand. In
 fact, as an old time Fortranner, I sometimes write a function that
 looks like,

       function F ( ... ) return some-data-type is
         Result : some-data-type := initial-value;
       begin
         Result := algorithmic-part;
         return Result;
       end F;

>... most programmers furiously overuse assignments, and it is
>far too common to see a variable assignment used to establish a constant
>value 

  I am not sure what you mean.  If I want to define constants,

          Zero : constant := 0;
          Null_List := some-value;

  how do I set the initial value without assignment.  For private
  members in C++ this is really easy without assignment.  I can use
  (must use) an initialization list.  In Ada we have to have an 
  assignment somewhere to make this happen.

of course languages like traditional C which have no capability
>for defining constants aggravate the problem!)

  But this is not true for C++ where one can use the initialization
  list as shown above and one can even define a function as a const, the
  parameters as const, etc.  In this respect, C++ is a little more
  powerful (read, safer) than Ada especially when using pointers as  
  parameters. For lots of other reasons, I still prefer Ada.

  Richard Riehle
  richard@adaworks.com
  www.adaworks.com

  

 




  parent reply	other threads:[~1998-08-24  0:00 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-22  0:00 Software landmines (was: Why C++ is successful) dewar
1998-08-23  0:00 ` Dale Stanbrough
1998-08-23  0:00   ` dewar
1998-08-23  0:00   ` Andi Kleen
1998-08-24  0:00 ` Richard D Riehle [this message]
1998-08-25  0:00   ` Andi Kleen
1998-08-25  0:00     ` Brian Rogoff
1998-08-25  0:00   ` dennison
1998-08-28  0:00   ` Matthew Heaney
1998-08-28  0:00     ` Richard D Riehle
1998-08-29  0:00       ` Matthew Heaney
1998-08-29  0:00       ` Matthew Heaney
1998-09-06  0:00         ` John G. Volan
1998-09-07  0:00           ` Mats Weber
1998-09-07  0:00             ` dewarr
1998-09-08  0:00               ` Tucker Taft
1998-09-08  0:00                 ` Precalculation of parameters (was: Software landmines) dennison
1998-09-09  0:00                   ` Tucker Taft
1998-09-09  0:00                     ` dennison
1998-09-10  0:00                       ` Tucker Taft
1998-09-10  0:00                         ` dewarr
1998-09-16  0:00               ` Software landmines (was: Why C++ is successful) Matthew Heaney
     [not found]   ` <35eca5d9.4354839@news.geccs.gecm.com>
1998-09-01  0:00     ` Richard D Riehle
  -- strict thread matches above, loose matches on Subject: below --
1998-08-06  0:00 Why C++ is successful Robert Dewar
1998-08-07  0:00 ` harald.mueller
1998-08-07  0:00   ` Brian Rogoff
1998-08-07  0:00     ` Timothy Welch
1998-08-08  0:00       ` Robert Dewar
1998-08-08  0:00         ` Jeffrey C. Dege
1998-08-10  0:00           ` Laurent GUERBY
1998-08-12  0:00             ` Andy Ward
1998-08-14  0:00               ` Robert Dewar
1998-08-14  0:00                 ` Software landmines (was: Why C++ is successful) dennison
1998-08-15  0:00                   ` Thaddeus L. Olczyk
1998-08-16  0:00                   ` Robert Dewar
1998-08-17  0:00                     ` dennison
1998-08-18  0:00                       ` adam
1998-08-19  0:00                         ` Tucker Taft
1998-08-19  0:00                           ` adam
1998-08-19  0:00                       ` ell
1998-08-19  0:00                         ` Charles Hixson
1998-08-19  0:00                         ` adam
1998-08-19  0:00                           ` Dan Higdon
1998-08-20  0:00                             ` adam
1998-08-20  0:00                               ` Dan Higdon
     [not found]                               ` <m33eagru5g.fsf@mheaney.ni.net>
1998-08-31  0:00                                 ` Frank Adrian
1998-08-31  0:00                                   ` Robert I. Eachus
1998-08-31  0:00                                     ` Biju Thomas
1998-08-31  0:00                                       ` Robert Martin
1998-09-01  0:00                                         ` Martin Dowie
1998-09-01  0:00                                       ` Robert I. Eachus
1998-09-02  0:00                                         ` dennison
1998-09-01  0:00                                   ` dewarr
1998-09-06  0:00                                 ` Jonathan Guthrie
1998-08-20  0:00                           ` Ell
1998-08-21  0:00                             ` Ell
1998-08-21  0:00                               ` John Goodsen
1998-08-21  0:00                                 ` Ell
1998-08-21  0:00                                   ` Ell
1998-08-21  0:00                               ` Larry Brasfield
1998-08-21  0:00                                 ` Jeffrey C. Dege
1998-08-20  0:00                                   ` Phlip
1998-08-21  0:00                                   ` Larry Brasfield
     [not found]                                   ` <DOSXjHE9T6DM9Jw9nAyaPxfz@news.rdc1.bc.wave.home.com>
1998-08-22  0:00                                     ` dewar
1998-08-24  0:00                                       ` Martin Dowie
1998-08-24  0:00                                         ` Martin Dowie
1998-08-24  0:00                                           ` Mark A Biggar
1998-08-25  0:00                                             ` Martin Dowie
1998-08-25  0:00                                               ` Mark A Biggar
1998-08-26  0:00                                                 ` Martin Dowie
1998-08-25  0:00                                         ` adam
1998-08-24  0:00                                       ` dennison
1998-08-28  0:00                                         ` Matthew Heaney
1998-08-28  0:00                                           ` dennison
1998-08-30  0:00                                             ` Matthew Heaney
1998-09-06  0:00                                               ` John G. Volan
1998-08-31  0:00                                             ` Robert I. Eachus
1998-09-22  0:00                                       ` Charles H. Sampson
1998-08-21  0:00                                 ` Ell
1998-08-21  0:00                                 ` Bob Collins
1998-08-20  0:00                         ` Gerry Quinn
1998-08-16  0:00                   ` Jay Martin
1998-08-17  0:00                     ` Robert Dewar
replies disabled

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