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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6b6619eb9cada212 X-Google-Attributes: gid103376,public From: whraven@msn.fullfeed.com (Richard Pinkall-Pollei) Subject: Re: Help me to chose between ADA 95 and C++ Date: 1999/12/15 Message-ID: X-Deja-AN: 561082343 References: <01bf37fb$a91afb60$0564a8c0@IS-D2D04C.test> <829rbv$a8m$1@nntp6.atl.mindspring.net> <01bf3e32$0b9dc880$022a6282@dieppe> <385112AE.7E2CFA9@rdel.co.uk> Organization: FullFeed Madison (newsmaster@msn.fullfeed.com) User-Agent: slrn/0.9.5.7 (UNIX) Newsgroups: comp.lang.ada Date: 1999-12-15T00:00:00+00:00 List-Id: With some trepidation, I'm throwing my "int cents = 2;"/"cents: integer range 0..99 := 2;" worth in. I use both languages at work and at home. I don't care to argue specific language features, since such preferences are very much tied to personal taste and familiarity; both languages are general-purpose so that essentially any programming task can be written in either language with some differences in effort required. When comparing Ada to C++, I look at the overall language design in relation to three general categories: programming effort (cost), portability, and transition from design specification to actual code. As far as programming effort goes, Ada programs are much easier to write in general. The Ada philosophy of strict typing along with various other consistency checks relieve the programmer of doing these tedious checks himself; if the program compiles correctly, an Ada program is much more likely to execute correctly than a C++ program unless the programmer has been *very* careful. Likewise, C++ is more of a "build it yourself" language -- some of the standard Ada language features such as multi-threading (POSIX threads), protected types (mutex's), and exceptions (an exception type must be defined before it can be used) must be hand-coded when using C++ (of course, this is an advantage for those who like to build their own -- it can be done in Ada, but it's easier in C++). As well, whenever a scalar type of a certain accuracy is required, a C++ programmer must know the machine representation of the built-in types before deciding which type to use, as opposed to direct specification of accuracy in Ada. Finally, repeated studies have confirmed that it costs less to write and maintain non-trivial Ada programs. C++ compilers run on more machine architectures and operating systems than Ada compilers, but C++ requires a little more effort to create truly portable programs. Various tools have been developed, such as automake and it's relatives, that compensate for differing header file and library implementations among various systems. Ada source code, on the other hand, will run unchanged on multiple architectures (unless one uses the C language hooks or non-standard, implementation specific features that *must* be documented). Part of the reason I'm jumping in is that I'm facing a portability dilemma involving C++ and Ada. I recently acquired an Alpha-based machine running Linux. There are not pre-built GNAT binaries for this particular CPU/OS combination, and since GNAT is written in Ada, I am trying to build a cross compiler that will allow me to port GNAT to that machine. That way, the programs I write in GNAT will be easily portable to that system. The problem is that GNAT is based on the old GCC 2.8.1 release, and I'm having some porting problems, so I have to decide whether the time spent porting GNAT is more important than converting to C++ for these particular programs. Finally, for me, program specification and design precede coding for any non-trivial program I write. While I can think in both C++ and Ada, I find that when I write specifications and design interfaces, the text resembles Ada -- so much so that I can use the specs almost directly as Ada code. As a last comment, there are a lot more C++ programmers than Ada programmers. This strikes me as another example of the "nobody ever got fired for using " syndrome. IBM was one of the first examples. Our shop uses Unisys hardware for our largest and most critical applications because it's better designed and more powerful than equivalent IBM hardware. Yet, IBM is still the best-selling hardware. The same is true of Micro$oft -- it's not the best OS by a long shot, but people tend to stick with what their comfortable with. Ada now seems in the same boat -- for my money, it is generally the best programming language available for most purposes. Yet, as things stand, it will not overcome C++'s popularity in the foreseeable future. So, I'll just keep pluggin' away at promoting it, and hope someday it will become the next Linux phenomenon. Rich Pinkall-Pollei Team Ada Ada for Linux Team --- A computer lets you make more mistakes faster than any other invention, with the possible exceptions of handguns and Tequilla. -- Mitch Ratcliffe