In article <385112AE.7E2CFA9@rdel.co.uk>, Chris Powell wrote: >Pascal Obry wrote: >> >> Richard D Riehle a �crit dans l'article >> <829rbv$a8m$1@nntp6.atl.mindspring.net>... >> > Smalltalk is certainly a nicely designed language. However, >> > if one is serious about object-oriented programming, >> > Ada is an excellent choice. The only appropriate alternative >> > to Ada, for serious OOP, is probably Eiffel. >> >> I second that. For me the 2 bests designed languages for serious >> (read industrial) OO development are Ada and Eiffel. >> >> Pascal. >> > >I would not recommend Ada 95 for OO development. Okay, it has all the >benefits of Ada 83 for type safety, etc, but the syntax of its class >programming constructs seems to make the code long winded, obscure and >error prone. I can give examples if anyone is interested/disagrees. Since this is a response to something I said, I suppose I must say something. 1) Type safety This is a real benefit of Ada that is not as well represented in C++. The default in Ada, for every construct, is type safe. The default, in the C family of languages, including C++, is type unsafe. It is true that one can make C++ a little more type safe, but this requires additional effort, an understanding of which class to use (smart pointers, etc.) and a great deal of careful programming. Even with that care, a C++ maintenance programmer has all the tools to easily violate the type safety another programmer has diligently developed. 2) Long-winded Speaking as a person reknowned for being a little long-winded, at times, I do not find this to be a bad thing. Seriously, Ada seems long-winded because of the very rules that support the default for type safety. Among these rules one finds a very strict model for scope versus visibility, a language feature that C++ has tried to adopt, but which falls far short of that already integrated into the Ada language. I can teach someone unfamiliar with Ada to read it more easily than I can teach the same skill to someone unfamiliar with C/C++. 3) Obscure Sure this falls into the category of what clinical pyschologists call "projection." One of my favorite columns from the magazine, "C++ Report," is at the end of each issue and titled, "Obfuscated C++." One create C++ code that is so mangled that even the most expert of C++ practitioners is hard-pressed to explain the exact outcome. It is far easier to write obfuscated C++ that obfuscated Ada. 4) Error Prone Here we go with the projection again. The notion that Ada is more error-prone than C++ reflects either an ignorance of Ada, an ignorance of C++ or both. I can't imagine anyone who knows both languages _well_ making such a statement. >I suppose C++ is a swear word in this newsgroup, but I prefer it, even >though I preferred Ada 83 to C. C++ is more type safe than C, the >Standard Template Library (if used) can protect from memory leaks, array >bounds checking, etc; the sorts of problems that made C unsuitable for >'industrial strength' development. (Ironically, C has been used for lots >of very serious software, though). No, C++ is not a swear word. C++ is a language with much to recommend it for certain circumstances. However, anyone who would choose C++ over Ada for safety-critical software, especially DoD weapon systems, is suffering from a failure to understand the relative virtues of both languages. One of my colleagues, who shall remain unnamed, says that picking C++ over Ada is irresponsible. While I might consider his opinion a little over-stated, he is not without some knowledge of this issue. As to the STL, you are kidding, of course. The fundamental ideas of STL are important and many of those components are excellent. I still hear from colleagues here in Silicon Valley who grumble about their reliability and the level of support offered by compiler publishers. Add to that your parenthetical qualification, "(if used)," and you have another interesting problem. Rarely do I seen anyone using smart pointers or smart array classes as implemented in STL. This is sad since these are among the more important STL components available. Even when they are used, it is often so sparingly that one continues to find pointer problems scattered merrily through the rest of the code. C++, when used correctly and responsibly, is an excellent language for many kinds of software development. It is not appropriate for safety critical software, the application domain best served by Ada. It is a stupid choice for business data processing software except where one is interfacing to some kind of GUI environment, since it does not have inherent support for financial data types (a la COBOL and Ada). It it is not particularly well-suited to software that needs to be modified a lot. Not that I have an opinion about this. :-) Richard Riehle P.S. Example code fragments could be thrown back and forth over the transom, but it would be an endless dialogue of example and counter-example that would lead nowhere.