MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » February 1998

Re: >>> Chris Rehm <Mr.AS400@xxxxxxx> 02/20/98 08:37am >>>



fixed

re: OO versus Procedural coding...

I get the feeling that no one who does OO code believes that Procedural
Programmers re-use -any- code at all!

Consider the Tea Machine:

If I had previously programmed a Coffee Machine, I would most likely have
routines (not necessarily coded as a subroutine or a separate program, but
identifiable as "This section of code determines if the user wants cream,"
and "This section dumps cream into the container") that could be re-used as
part of a Tea Machine.

If I had no inkling that I would need both Coffee and Tea machines, I might
not have coded things as subroutines or separate programs.  However, I
would quickly recognize that (1) serving Coffee and Tea are basically the
same activities, and (2) it would be well worth the overhead to smash the
Coffee Machine Program into a number of sub-programs (linkage overhead be
damned!) so that both Coffee and Tea programs would call the same
sub-program for "Add Cream."

It's how I think and code:  "A nifty piece of code is a thing of beauty and
a joy forever."

True, the inheritance is not automatic, and I have to link things together
by hand, but how automatic is linking things in the OO world?  You can
point and click, but you still have to build the initial 'Beverage Machine'
before you can make a 'Tea' or 'Coffee' machine...

--Paul E Musselman
PaulMmn@ix.netcom.com


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact