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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: bitwise comparators Date: 2000/01/18 Message-ID: <3883A414.8559E641@earthlink.net>#1/1 X-Deja-AN: 574035443 Content-Transfer-Encoding: 7bit References: <3880D375.7E363123@hotmail.com> <38829638.0@news.pacifier.com> <3882FC1C.2BA8C959@hotmail.com> <85vmn2$ki1$1@nnrp1.deja.com> <38836CF2.AB738B8B@hotmail.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: Mon Jan 17 17:22:28 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 948158548 38.29.67.221 (Mon, 17 Jan 2000 17:22:28 PST) Organization: EarthLink Network, Inc. MIME-Version: 1.0 Reply-To: jrcarter@acm.org NNTP-Posting-Date: Mon, 17 Jan 2000 17:22:28 PST Newsgroups: comp.lang.ada Date: 2000-01-18T00:00:00+00:00 List-Id: Alexander Van Hecke wrote: > > This seems like an attack on C/C++! I'm sorry, but I have to react on this It wasn't meant as an attack, merely an enumeration of why Ada takes longer to learn than C. > > > Ada has > > packages, > > C was ment to be used modular and for reuse : put your code in separate .c > and .h files. These do not provide the many benefits of packages. > > > private types, > > C has that! I've never seen them. > > > exceptions, > > you can program exceptions in C. I never said that C has all these things, > but you can program them, and there are masses of libraries available that > have just what you need. This is an unhelpful definition of "powerful". Since all C is translated into machine code, and there are frequently things you can do in machine code that you can't do in C, machine code is more powerful than C by this definition. Is this an argument for using machine code rather than C? The power of a language comes from its readability, expressiveness, and the amount of work it takes off your hands. > > > generics, > > use structs and callback functions and you have perfect generic types! In my experience, you have perfectly unreadable code. > > > tasks, > > threads Not part of C. > > true enumeration types, true arrays, > enumeration types in Ada are no different than they are in C. Just because > you have some fancy attributes (SUCC, PRED) doesn't mean that they are > different or more powerful! You can write functions that do exactly the > same, even more, these functions have already been written numerous times > and are available. A C enumeration merely defines some named integers. An Ada enumeration is a different animal altogether. > With true arrays, do you mean out of bound checking, etc? This can be done > with _proper_ programming in C! C does not have arrays; it only has different notations for address arithmetic. > > none of which are found in C. > ^^^^^^^^^^^^^^^^^^^^^^^ > ahum. > > > C just has integers, floating-point numbers, pointers, and functions, so > > of course Ada takes > > longer to learn. > > > > Ada makes creating and using abstractions easier than C (packages for > > encapsulation and information hiding; private types for information > > hiding). > > Would you agree that C++ is just as good in that as Ada. Don't forget that > ANY C++ code can be easily translated into C? So can any Ada code; Averstar sells an Ada compiler that generates C. This has nothing to do with features of Ada that C lacks. This is not an indictment of C; C and Ada have a different philosophies. It does explain why Ada takes longer to learn than C. > For that matter, everything else you mentioned (namespace control, (easy) > generics, exceptions and exception handlers, typing) is easily achieved in > C++ (and thus C). > > As I have said already a few times, and as I said in my original post : I > THINK IT'S A NICE FEATURE OF ADA THAT YOU CAN WRITE READABLE CODE, BUT THAT > DOES NOT NECESSARILY MEAN THAT THE LANGUAGE IS MORE POWERFUL! It might be > easier to use once you've mastered it, but it also is harder to learn. > > excuse me for being so impolite, but I had to get this off my chest. > > alex If the only definition of "powerful" is "able to implement anything" than all languages are equally powerful, and there is no basis for choosing one over the other. I think we all agree that there are important differences between languages that lead people to choose one over another; in many cases the most important difference is "I learned X first" :) This seems like a useless definition of the power of a language to me. -- Jeff Carter "Hello! Smelly English K...niggets." Monty Python & the Holy Grail