comp.lang.ada
 help / color / mirror / Atom feed
From: RTOAL@lmumail.lmu.edu (Ray Toal)
Subject: Strings
Date: Wed, 25 Jan 1995 15:08:45
Date: 1995-01-25T15:08:45+00:00	[thread overview]
Message-ID: <RTOAL.12.000F25C7@lmumail.lmu.edu> (raw)

I was impressed by Robert Firth's note in response to the claim made
by a previous poster who claimed

  *p++ = *q++

is more readable than

  loop
    P(I_ := Q(I);
    I := I + 1;
    ...

Rober said a real Ada programmer would write

  P := Q;

True! Touche!  Ada is more terse and more readable than C on this one!

To be fair to the C folks, C++ now features a "language-defined"
string class, so one string can be assigned to another with "=":

  s1 = s2;

My concern is with many in the C "culture" who would probably avoid
the use of this class and stick with "char*"s, on account of some
probable (real or imagined) loss of efficiency.  The vastly improved
clarity of program text that deals with complex objects as single
entities (as opposed to constantly fiddling with their internals)
is a strong point of Ada and a reason why Ada programs are more
readable and far less error prone.

At least the C++ "committee" is realizing this.  Perhaps some day
we can look forward to a **real** array class.  But of course, in C++,
if you WANT safe arrays or safe pointers, you can always code them
yourself.

My preference is to have safety by default, as in Ada, and be specific
when I need Unchecked things.

Ray Toal




             reply	other threads:[~1995-01-25 15:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-01-25 15:08 Ray Toal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-05-27  0:00 Strings Karlene
2000-05-27  0:00 ` Strings MaggieJohn
2000-05-28  0:00   ` Strings Robert Dewar
2000-06-03  0:00     ` Strings Robert I. Eachus
2000-05-27  0:00 ` Strings Robert Dewar
2000-05-27  0:00 ` Strings Robert Dewar
2000-05-27  0:00 ` Strings David C. Hoos, Sr.
2000-12-21 17:45 Strings Jef Kelmo
2000-12-21 18:01 ` Strings Jef Kelmo
2000-12-21 18:47 ` Strings mark_lundquist
2000-12-21 18:47 ` Strings mark_lundquist
2000-12-21 23:31   ` Strings gdemont
2000-12-21 19:03 ` Strings David C. Hoos, Sr.
2000-12-21 21:09 Strings Beard, Frank
2000-12-22 14:19 ` Strings Jef Kelmo
2000-12-22 14:49   ` Strings Larry Kilgallen
2000-12-22 16:35   ` Strings Marin David Condic
2000-12-23 21:04   ` Strings Georg Bauhaus
replies disabled

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