Xref: utzoo comp.lang.eiffel:219 comp.lang.c++:3527 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ucsd!ames!elroy!gryphon!sarima From: sarima@gryphon.COM (Stan Friesen) Newsgroups: comp.lang.eiffel,comp.lang.c++ Subject: Re: Eiffel vs. C++ Message-ID: <16423@gryphon.COM> Date: 4 Jun 89 16:23:08 GMT References: <2689@ssc-vax.UUCP> Reply-To: sarima@gryphon.COM (Stan Friesen) Organization: Trailing Edge Technology, Redondo Beach, CA Lines: 53 In article <2689@ssc-vax.UUCP> dmg@ssc-vax.UUCP (David Geary) writes: > > I've been programming in C for about 5 years, and >just recently started using C++. I would like to >start a discussion of Eiffel vs. C++. I understand >that both languages use C as a base language, and >that both implement OOP features, and it seems as >though the two have much more in common, aside from >syntactic differences, than they have differences. > >... I may as well put in my two cents worth. My impression is that Eiffel is a "higher level" language than C++. That is Eiffel is a very strongly typed OOP language, with a very simple, limited implementation of objects, whilc C++ is a very flexible language that allows you to get into the guts of the system when you need to. Thus, as someone else stated, Eiffel feels like Pascal and C++ feels like C. Eiffel is very simple syntactically, at the cost of requiring you to do everything its way. In particular, except for the basic scalar types, *everything* is a class. There are no seperate derived types, such as pointers and arrays. A class instance is essentially always a pointer, but without the ability to do pointer arithmetic, or in fact anything except allocate, deallocate, and dereference. Thus it acts like a dynamically allocated instance of an object. (In fact this is what Meyer would call it, rather than a pointer). Because of this there are a number of things not possible in the language. For instance the standard library class ARRAY, used to make array objects via inheritence, had to be implemented in C and grafted into the language using the "foreign" language import capability. This limitation is not often important, since most of the common cases where going outside of Eiffel have been anticipated and included in the standard library. C++, on the other hand, is more complex because it allows you to decide how you want to implement something. It has built in all of the scalar and derived types from C, thus allowing direct manipulation of low-level implementation details when necessary. It still has all of the class features that facilitate OOP. It has dynamic allocation, when needed, and it allows run-time typing (using virtual functions). But if you don't need them you don't have to take them. Thus the trade-off is a simpler, easier to understand language versus one that gives you more control. > > About the only difference that I can discern is the >fact that Bertrand Meyer posts more often to comp.lang >.eiffel than Bjarne Stroustrup posts to comp.lang.c++ >;-) ;-) > Well, Bjarne Stroustrup used to post here occasionally, but he claims to be too busy now. So Andrew Koenig has taken over posting here for him. -- Sarima Cardolandion sarima@gryphon.CTS.COM aka Stanley Friesen rutgers!marque!gryphon!sarima Sherman Oaks, CA