Subject: RE: Abusing OO languages (was: Re: [hackers-il] Re: Applying TOC to the profession of programming?)

From: Omer Musaev <[email-masked]>
Date: Thu, 7 Mar 2002 09:57:18 +0200

> -----Original Message-----
> From: Omer Zak [mailto:[email-masked]]
> Sent: Wednesday, March 06, 2002 3:39 PM
> To: Hackers-IL
> Subject: Abusing OO languages (was: Re: [hackers-il] Re: 
> Applying TOC to
> the profession of programming?)
> 
> 
> 
> On Wed, 6 Mar 2002, guy keren wrote:
> 
> > here is where you simply don't grasp the basic idea of OO - data
> > abstraction. its a tool to allow you NOT to have to 
> remember too many
> > details at once. this is where OO _helps_ you. if it 
> distracts you - then
> > you haven't done your OO design properly. OO's abstraction 
> means you take
> > a set of details, and turn all of them into a _single_ 
> object. then, you
> > do the same for another object. then you take a few 
> objects, and abstract
> > them under another single object. while doing this - you 
> only need to hold
> > 3-4 objects in memory, rather then all the data that 
> _they_, in turn,
> > hide.
> >
> > if you don't do it this way - then you're not doing OO. all 
> the other
> > features (inheritance, polymorphism and the like) are just 
> extentions of
> > OO.
> 
> Data abstraction helps if you can find out everything you need to know
> about an object from glancing at a single class declaration (C++
> terminology) in a single header file.

I do not agree. Not at all. Data abstraction helps you to construct 
more protected and more robust programs. The layout of inheritance tree
can vary, and its variations do not affect the basic fact that data 
is boxed into opaque blocks.

> However C++'s implementation of inheritance makes this 
> impossible in the
> general case.  In a deep inheritance chain, you may have to browse
> arbitrary number of header files, just to find if a function 
> was declared
> as virtual somewhere in the inheritance chain.

I am not so sure that enforcement of good programming style by language
design can prevent spaghetti code, be it spaghetti functions or spaghetti
inheritance chains. However I may err.

On the other hand, note that C++ supports multiple inheritance, 
hence you can live without deep inheritance chains. 

Another point that should be taken is that inheritance is the strongest 
relation of entities in C++. When you set inheritance relation, 
you can not move out. In this sence overuse of inheritance is more of a 
pain than a gain in C++. Other means of modularisation come to mind, 
and considering variety of styles and paradygms supported by C++, 
it is possible to create stable and solid code without overuse of
inheritance.

> Other OO languages, commit this sin, too.  The common 
> denominator is that
> those languages fail to require that any method inherited 
> from ancestors
> is private (not even protected) unless otherwise re-declared in the
> present class's interface declaration.

Are you aware of OO language that puts that requirement? 
 
> In other words, Shlomi does have a point.  Maybe not about 
> the original OO
> idea, but about the way it is implemented in most OO languages.

>                                              --- Omer
> There is no IGLU Cabal.  Their flagship project - The 
> Magnificent Tower of
> Inheritance was built up, like the Tower of Babel.  However, 
> TMTI met the
> same fate of the Tower of Babel, due to abuse of data abstraction
> principles in the language used (which was based upon OO, patterns,
> Demeter's Principle, anti-patterns, principles of thought, theory of
> neuronic data processing, and quantum computing based NP-complete
> oracles), each of the workers in the project lost understanding of his
> interfaces with his fellows.
> WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

There is no IGLU Cabal. The Cabal was sent to learn OO/C++ in a high school.
Come back next year.

> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> ---------------------~-->
> Tiny Wireless Camera under $80!
> Order Now! FREE VCR Commander!
> Click Here - Only 1 Day Left!
> http://us.click.yahoo.com/nuyOHD/7.PDAA/yigFAA/saFolB/TM
> --------------------------------------------------------------
> -------~->
> 
> To unsubscribe from this group, send an email to:
> [email-masked]
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/