Xref: utzoo comp.lang.eiffel:268 comp.lang.c++:3642 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!etive!lfcs!db From: db@lfcs.ed.ac.uk (Dave Berry) Newsgroups: comp.lang.eiffel,comp.lang.c++ Subject: Re: Eiffel vs. C++ Message-ID: <2330@etive.ed.ac.uk> Date: 12 Jun 89 20:55:42 GMT References: <2689@ssc-vax.UUCP> <150@eiffel.UUCP> Sender: news@etive.ed.ac.uk Reply-To: db@lfcs.ed.ac.uk (Dave Berry) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 40 In article <150@eiffel.UUCP> bertrand@eiffel.UUCP (Bertrand Meyer) writes: > C++ has a notion of friend function which, as I understand it, makes >it possible to define routines outside of the object-oriented framework. >There is nothing equivalent in Eiffel. This facility is not missed. In C++ a class A may define other classes to be its friends; these classes can access all attributes and members of A. From the book (OOSC), Eiffel does seem to have an equivalent, namely the facility where members may be exported to certain named classes only. Both mechanisms allow A to control access to part of itself. The Eiffel mechanism gives finer control. I don't know if this finer control will matter in practice. Friend functions in C++ are similar, but allow the integration of object oriented software with non-OO software, in keeping with the rest of the language. >Compatibility with C means that in C++ you still have pointers, type casts, >pointer arithmetic, function pointers, malloc, free. I strongly disagree >with this approach if the goal is to obtain software quality. In Eiffel, >the choice has been made. None of these low-level features are present; >needless to say, they are not missed. Except by all the people asking for them on USENET ( semi :-) ). I would say that languages don't encourage software quality if they require the use of low-level features unnecessarily. C & C++ undoubtably do so, although C++ will improve when type parameterisation and multiple inheritance are available. This doesn't mean that such features should not be provided. Sometimes some people need low-level control. What is important is that they should be able to hide their use of such features from the rest of the program. I find it odd that Meyer considers function pointers "low-level". There was some discussion of function parameters in Eiffel a couple of months ago, and they seemed to offer neater solutions (IMAO) to some problems than the alternative techniques. Treating functions as first order objects (or "nearly firat order" objects) is usually considered high level. Dave Berry, Laboratory for Foundations db%lfcs.ed.ac.uk@nsfnet-relay.ac.uk of Computer Science, Edinburgh Uni. !mcvax!ukc!lfcs!db Britain without the Queen is like a democracy without a monarch.