POV-Ray : Newsgroups : povray.off-topic : Hypothesis: OO does nothing for reusability : Re: Hypothesis: OO does nothing for reusability Server Time
7 Sep 2024 09:24:54 EDT (-0400)
  Re: Hypothesis: OO does nothing for reusability  
From: Warp
Date: 21 Aug 2008 15:26:57
Message: <48adc180@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> >   Specific algorithms are not good examples of OOP. Data containers are.

> OK. And yes, I'm stretching the argument a bit to see how far it can go. :-)

  I think we can all agree that there's no silver bullet.
http://en.wikipedia.org/wiki/No_Silver_Bullet

  We can also agree that OOP did not bring the panacea it was supposed to,
after all, although it *did* bring a whole lot nevertheless. It's just not
the *ultimate* solution to all problems.

  The two main aspects of OOP are modularity and inheritance. Modularity
is a hugely useful paradigm, but inheritance, while sometimes useful, was
not after all the panacea it was supposed to be. Practice has diminished
the importance of inheritance as a tool quite a lot in the past ~20 years.

  What more or less surpassed inheritance in importance is generic
programming (by whatever means and paradigms you like). While some aspects
of generic programming are perhaps somewhat similar to inheritance, it has
nevertheless resulted to be more useful and efficient than pure inheritance
in many areas.

  Of course the definition of "generic programming" can be a bit fuzzy.
Perhaps it could be argued that C++ template metaprogramming and Haskell
functional programming are both different approaches at generic programming.
In general it could be said, perhaps a bit simplistically, that generic
programming is a way to write algorithms which will work for (almost)
any data type which meets certain criteria, without the algorithm having
to explicitly know what the data type in question is. In OOP this has
classically been achieved through inheritance, but generic programming is
often even more powerful and expressive than that (and often leads to
faster and more efficient code, both speedwise and memorywise).

  Of course this doesn't mean OOP is dead. Modularity is still, and will
always be, a hugely useful design tool. (Yes, also for reusability.)

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.