comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst-u@mib.org>
Subject: Re: What is Delta??
Date: Mon, 22 May 2006 20:57:11 GMT
Date: 2006-05-22T20:57:11+00:00	[thread overview]
Message-ID: <lnhd3hok0p.fsf@nuthaus.mib.org> (raw)
In-Reply-To: 1ffb2$4471d0f7$45491254$22925@KNOLOGY.NET

"Marc A. Criley" <mcNOSPAM@mckae.com> writes:
[...]
> An experienced Ada programmer knows what Ada code should look like, in
> terms of definitions, structures, and interactions.  A system that was
> dumped in my lap to port to a new OS version and compiler included the
> following:
>
> - A set of project-standard integer types were defined for 8, 16, and
> 32 bit items.  _Every_ other integer type was defined as a subtype of
> one of those.  Totally eliminated integer type conflicts--and checking.
> - In several packages record type definitions were defined using the C
> idiom for struct definitions, to the point of having the term "struct"
> as part of the type name, AND defining a subtype of the record for
> public use--ala the practice of having a typedef for struct
> definitions.
> - Handling message buffers by interfacing to the strcpy() function and
> using it to move bytes from memory buffer arrays to and from record
> components.
> - Used tasks where virtually all the work of the task was performed
> during task rendezvous, _including_ making entry calls on other
> tasks. This resulted in the world's most computationally expensive
> procedure calls.
>
> Clearly there were no experienced Ada hands on the project, and it showed.

Most of these sound horrendous, but one of them may not be.

C's strcpy() function copies a C-style string, terminated by a NUL
character.  If a NUL-terminated string format is imposed by some
external interface, then interfacing to strcpy() might be the most
reasonable approach.  Hand-written code to do the same thing, either
in C or in Ada, could easily be less efficient and more error-prone; a
C library's implementation of strcpy() is free to use system-specific
performance tricks and is likely to be thoroughly tested.

On the other hand, if the NUL-terminated string format *wasn't*
imposed by an external interface, imposing it on an Ada project seems
like a bad idea.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.



  parent reply	other threads:[~2006-05-22 20:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-11  8:20 What is Delta?? Sathish Veluswamy
2006-05-11 12:49 ` Martin Krischik
2006-05-12 11:12   ` Sathish Veluswamy
2006-05-12 13:49     ` Martin Krischik
2006-05-12 13:57       ` impslayer
2006-05-12 16:38       ` Georg Bauhaus
     [not found]       ` <0bd9625e9e1eg27a2140e8jp1mli25k61n@4ax.com>
2006-05-12 19:27         ` Björn Persson
2006-05-13  6:52           ` Martin Krischik
2006-05-13 12:39             ` Spelling and netiquette (was: What is Delta??) Ludovic Brenta
2006-05-13  6:26         ` What is Delta?? Martin Krischik
2006-05-13 19:47           ` Jeffrey R. Carter
2006-05-14  2:29             ` Keith Thompson
2006-05-14 18:21               ` Jeffrey R. Carter
2006-05-15 23:14                 ` Keith Thompson
2006-05-15  7:33             ` Martin Krischik
2006-05-13 16:25         ` Craig Carey
2006-05-13 21:59 ` Craig Carey
2006-05-14 11:46   ` Martin Krischik
2006-05-17 14:46     ` M E Leypold
2006-05-18 11:40       ` Ludovic Brenta
2006-05-18 18:08         ` M E Leypold
2006-05-22 14:55           ` Marc A. Criley
2006-05-22 15:22             ` Dmitry A. Kazakov
2006-05-22 16:33             ` Jeffrey R. Carter
2006-05-22 20:57             ` Keith Thompson [this message]
2006-05-23 14:10               ` Marc A. Criley
2006-05-23 20:34                 ` Keith Thompson
replies disabled

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