Re: How come Ada isn't more popular?
- From: Charles D Hixson <charleshixsn@xxxxxxxxxxxxx>
- Date: Sun, 28 Jan 2007 00:55:59 GMT
Gautier wrote:
Charles D Hixson:Sorry, I knew I shouldn't have used that example. (Of course, maybe it's the texts I'm looking at for Ada...).
Ada is quite expressive, but it can be very clumsy when you want to write a flexible routine. You can do it, and you can do it with much greater safety, but it takes more work.
Just, for instance, look at the Ada version of:
#include <stdio.h>
void main() { print ("Hello", " ", "World!"); exit(0); }
with Ada.Text_IO;
procedure pied is begin Ada.Text_IO.Put("Hello" & " " & "World!"); end;
Is it so clumsy ?
______________________________________________________________
Gautier -- http://www.mysunrise.ch/users/gdm/index.htm
Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm
NB: For a direct answer, e-mail address on the Web site!
But I was intentionally NOT concatenating the strings. Perhaps if the central string were a number? or an unbounded string instead of a fixed string? Or perhaps my concerns are those of a neophyte...but I've got around 8 texts, and they all use that verbose form...Thus:
with Ada.Text_IO;
use Ada.Text_IO;
procedure pied is
begin
Put("Hello ");
Put(3);
put("World!");
newline;
end pied;
I acknowledge that this vertical separation is optional ... but doesn't the put(3) need to be a separate print statement?
(And now that my C is coming back to me a bit the C print statement should have been:
printf("Hello, %d %s\n", 3, "World");
As shown by the silly mistake that I made in C, it's not my favorite language. But when I compare a book on expert systems written in C and one written in Ada (well, Ada83), the book in Ada is both thicker and has more pages devoted to code than the book in C, and the expert systems are approximately of equivalent power (i.e., toy systems). Well, the type size is a trifle larger, and the paper a bit thicker...so the comparison isn't quite as straightforward as I'm making it out, but basically Ada83 appears to take approx 1.5 times as many lines to do the same thing. (I didn't count the lines. It's a rough estimate. Say somewhere between 1.1 and 1.9 times as many lines.) Possibly this is a comment on the skills of the authors, but the number of extensive comparisons I've encountered is very limited. (Or maybe it's a comment on Ada83, and doesn't apply to Ada95.)
.
- Follow-Ups:
- Re: How come Ada isn't more popular?
- From: adaworks
- Re: How come Ada isn't more popular?
- From: Jeffrey R. Carter
- Re: How come Ada isn't more popular?
- From: Ludovic Brenta
- Re: How come Ada isn't more popular?
- References:
- How come Ada isn't more popular?
- From: artifact . one
- Re: How come Ada isn't more popular?
- From: kevin cline
- Re: How come Ada isn't more popular?
- From: Martin Dowie
- Re: How come Ada isn't more popular?
- From: kevin cline
- Re: How come Ada isn't more popular?
- From: Charles D Hixson
- Re: How come Ada isn't more popular?
- From: Gautier
- How come Ada isn't more popular?
- Prev by Date: Re: Wasteful internationalization
- Next by Date: Re: Wasteful internationalization
- Previous by thread: Re: How come Ada isn't more popular?
- Next by thread: Re: How come Ada isn't more popular?
- Index(es):
Relevant Pages
|
Loading