From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6ec8df5df532a28f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!hwmnpeer01.lga!hwmedia!news.highwinds-media.com!news-server.columbus.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!tornado.socal.rr.com.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada Subject: Re: What is Delta?? References: <1147335626.779489.9240@j73g2000cwa.googlegroups.com> <2914908.GvrD7n1EFI@linux1.krischik.com> <1147952419.008146.149720@j55g2000cwa.googlegroups.com> <1ffb2$4471d0f7$45491254$22925@KNOLOGY.NET> From: Keith Thompson Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:VbKaWh5vhO/dlrvLjvgWvjwGShI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 22 May 2006 20:57:11 GMT NNTP-Posting-Host: 66.75.136.120 X-Complaints-To: abuse@rr.com X-Trace: tornado.socal.rr.com 1148331431 66.75.136.120 (Mon, 22 May 2006 13:57:11 PDT) NNTP-Posting-Date: Mon, 22 May 2006 13:57:11 PDT Organization: Road Runner High Speed Online http://www.rr.com Xref: g2news2.google.com comp.lang.ada:4348 Date: 2006-05-22T20:57:11+00:00 List-Id: "Marc A. Criley" 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 San Diego Supercomputer Center <*> We must do something. This is something. Therefore, we must do this.