From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: What is Object Oriented Programming? Is C doomed?
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Sat, 12 Dec 1992 14:13:31 GMT

In article <rmartin.724084666@ctbu> rmartin@ctbu.Rational.COM (Bob Martin) writes:
>peter@ferranti.com (peter da silva) writes:
>
>|In article <ByuwDL.2Ln@news.cso.uiuc.edu> jrpg8255@uxa.cso.uiuc.edu 
>|(Jeremy Payne ) writes:
>
>|> for example -- but OOP makes it easier to take your concept of your
>|> programming problem and write code that expresses some of the underlying
>|> structure of the problem.
>
>|Yes, it certainly does. But it's not necessary, nor sufficient. You can
>|write object-oriented code in Fortran if you want, or in assembly. It just
>|takes more work.
>
>Yes.  Probably too much work to make it worthwhile!  And the
>propensity for error would be enormous.  I don't suggest it as a
>viable methodology.  I don't suggest attempting to write object
>oriented code in any language which does not directly support OO
>concepts.
>
>I am often asked the following question: "Can you use object-oriented
>design techniques to design a project, and then implement the project
>in a procedural language such as C?"  My answer is that it is not
>worth the effort.  Most of the concepts of OO that really provide
>benefit in design, are very difficult to implement in non-OO
>languages.  Things like inheritance, polymorphism, abstract classes,
>multiple inheritance, etc.

	You would be surprised. Suppose you had to write code in
assembler for a microcontroller. Now surely thinking OO would
help the design here, even if you had to code in assembler?
I mean, what alternative is there?
>
>IMHO, an OO language is an essential ingredient to implementing an OO
>design.

	No, it just makes it easier, it makes it possible
to reap programming rewards. A good OO design, even in assembler,
might still be a 'Good Thing'. Would you suggest NOT using OO
design techniques, and if so what else?

>
>|Personally, I think object-oriented languages are a distraction from the real
>|goal of good software component design.
>
>I disagree.  Granted that some people are distracted!  Somem engineers
>think they will write better programs just because they are using an
>OO language.  This is certainly a fallacy.  

	No, it is not. Many programmers *will* write better code
when constrained by, say, strong typing in C++, or mandatory
class orientation as in Eiffel.

>There is no substitute for good design.  

	Of course. But it helps if the language allows simple
concepts to be expressed as such, and expressed as such *once*
and forgotten. Thus the language can relieve mediocre
designers from the task of remembering every time how to
insert into a singly linked list :-) This leaves
extra brain power available for the real problem.


>But I think that OOD is at the forefront of software
>design.  Some of the best techniques for designing applications are
>being discovered by the OO community and are being incorporated into
>the framework of OOD.  And these techniques really require an OO
>language for their implementation.
>
	Only comparatively. As I said, if you're really stuck
in assembler, this shouldn't stop you using OO design techniques.
If you have to use C, you can imagine the C++ code and then
do a mental 'cfront' on it. This is surely an effective
technique in such circumstances, since the algorithm is reasonably
well understood... right down to the vtbl if necessary.

	Hope I never have to go this far in assembler though ...

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