From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: comparing object-oriented platforms
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Sun, 4 Oct 1992 13:31:46 GMT

In article <92Oct1.173658edt.47938@neat.cs.toronto.edu> tlai@cs.toronto.edu (Tony Wen Hsun Lai) writes:
>
>I guess a major concern is how much one can trust the C++ code written by
>other programmers, even if one's own code is perfectly good.  I'm not an
>Eiffel enthusiast, but some Eiffel advocates will argue that a more
>restrictive language helps if it encourages consistency and discourages
>practices that aren't conducive to trustworthiness and reusability.

The single biggest problem in C++ is probably dangling pointers
and their converse, memory leaks. Eiffel's big strength in this
area is GC. Conversely, C++'s constructor/destructor scheme
is more powerful than Eiffel's more simplistic scheme.

Secondly, I like Eiffel's assertion facility. However although
C++ doesn't have one (the closest it comes is the assert macro
and expection specifications), one could be added if the
designers wanted to enough. A proposed design, A++,
appears to me to be more advanced than the scheme presented
in OOSC, although because C++ is so complex cf. Eiffel
Eiffel might be able to optimise many of the assertions
away at compile time where C++ would struggle with aliasing
and other nasty problems. 

Thirdly, Eiffel has much nicer sytax/lexicology. In particular,
C++ separate header (.H) and implementation (.CPP) files
are a bit of a pain, and all those {} get hard to read.

There's no doubt that Eiffel is a cleaner language than C++,
few C++ advocates would try to claim C++ is nice. 
It has inherited from C, and that is both an advantage
and disadvantage.  The biggest advantage is that
it provides a path for working programmers to learn
new and better techniques, and keep being productive.
If they were already writing good ANSI C, the boss
could secretly switch the compiler to C++ and they
main thing they'd notice would be improved type checking
and better diagnostics.

And even if they were superprogrammers and could learn
Eiffel and OO in one day, it would be difficult
to just rewrite a huge C project in Eiffel in 
the next 6 days. With C++, you wouldn't have to.

---------------------------------------------------------
I'm interested in some anecdotal evidence on Eiffel Use.
When I switched to C++, my pattern of programming changed
radically. Most programs, if they dont work the very first
time, work by the second or third time. By 'work',
I mean execute cleanly. So I do not spend much time
getting programs to run anymore. (Chasing bugs)

On the other hand, I spend much much more time on design.
C++ classes are supersensitive to correct design, 
if I stuff up a class I may have to rework a good fraction
of the system. Once a class is heavily used (and reused),
it is very hard to change it's interface.

So I estimate say 70% time on design, more than twice for
C or Pascal. A typical program takes LONGER to write
in C++, unless I just hack C. There are benefits
for classes that get reused---but most dont.

DO others experience this change in practice in Eiffel?

[I'm particularly interested in Eiffel because its so
similar to C++ :-) }


-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.object