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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public From: mike Subject: Re: Ada vs C++ vs Java Date: 1999/02/08 Message-ID: <79mn6h$bls@drn.newsguy.com>#1/1 X-Deja-AN: 441961946 References: <369C1F31.AE5AF7EF@concentric.net> <369DDDC3.FDE09999@sea.ericsson.se> <369e309a.32671759@news.demon.co.uk> <77ledn$eu7$1@remarQ.com> <77pnqc$cgi$1@newnews.global.net.uk> <8p64spq5lo5.fsf@Eng.Sun.COM> <77t3ld$nou$1@nnrp1.dejanews.com> <79ce4s$lfq$1@nnrp1.dejanews.com> <79chc7$ko6@drn.newsguy.com> Organization: Newsguy News Service [http://www.newsguy.com] Newsgroups: comp.lang.ada,comp.lang.c++ Date: 1999-02-08T00:00:00+00:00 List-Id: In article , Brian says... > >> I dont think Ada is more read'able. I think wordy languages for me >> are harder to read. too much words makes thing less hard to understand. > >This doesn't parse. I know what you're trying to say, but your final >sentence above says the opposite! > I guess what I meant to say is that to express something in Ada requires too many words. At least more than in C++. specially for the more advanced constructs. I find that it is easier to read and understand anything when things are shorter, requiring less words, and more terse. If you read a book on mathematics that was written say 400 years ago, and translate that using today's language of mathematics, you'll find the book shrink to more than half its size, becuase modern mathematics language uses more terse expressions and symbols to represent the same things that used to take pages to represent, and it is far easier to understand too. This is what I mean. I dont think langauges with more bigger words makes them easier to read as the claim always be made for Ada. > >C++ cannot express concurrency, so how is it more expressive? If anything, >I can express much more in Ada than in C++! > OK. C++ does not have threads. So, I use pthreads library. it is no big deal for me. (plus threads/tasks are oversold, they are only suitable in limited applications. Even the Apache web server does not use them). >> C++ now, after becoming a standard, and with the standard library is a >> very safe language. > >No, sorry, Tucker Taft had it right. With hard work, you can make write >relatively safe C++, but the defaults are all unsafe. With a bit of >effort, you can write unsafe Ada, but the defaults are safe. I prefer the >Ada way. > Yes, I understand this. But Tucker and youself agree that using the standard C++ library makes C++ applications safe( safer?). So, then it becomes a matter of each group requiring that every programmer on the project must use C++ standard library classes and containers. problem fixed :) no more array out of bounds problems, no more of the silly errors encountered before. when I program in C++ now, I only use standard library things. I finish faster, less bugs than before, and I feel my code is more robust now. >I think what many Ada proponents missed in this post was that this example >demonstrates how automatic instantiation can lead to short and *readable* >code sections. > So far, no one has been able to come up with an Ada example to do the same as below using the only STANDARD Ada library and even with twice as much code as shown below. The famouse Robert Dewar complained that this is a silly example. But where is the Ada example to do the same? If this was such a silly example, then it would have been trivial to write one that does the same in Ada95. The only reason no one has been able to do it is that it would require pages and pages on Ada code to write something that does the same as those 8 lines of C++ code below. > >> #include >> #include >> #include >> #include >> >> int main() >> { >> cout << "Please enter a list of words to be sorted: "; >> >> vector v; >> string buffer; >> while (cin>>buffer && buffer!="END") v.push_back(buffer); >> >> sort(v.begin(),v.end()); >> >> for (vector::iterator i = v.begin(); i!=v.end(); ++i) >> cout << *i << endl; >> >> return 0; >> } >> mike