POV-Ray : Newsgroups : povray.off-topic : Hypothesis: OO does nothing for reusability : Re: Hypothesis: OO does nothing for reusability Server Time
7 Sep 2024 03:21:29 EDT (-0400)
  Re: Hypothesis: OO does nothing for reusability  
From: somebody
Date: 20 Aug 2008 15:24:33
Message: <48ac6f71$1@news.povray.org>
"Darren New" <dne### [at] sanrrcom> wrote in message
news:48ac49b3$1@news.povray.org...

> Has anyone ever actually found an OO library to be more "reusable" than
> the same thing would be (say) organized procedurally? Has anyone made
> significant reuse of classes by overriding methods the original authors
> hadn't intended to be overridable? I'm not saying OO is a bad way of
> organizing something that has "objects" in it (like a windowing system
> or a simulation), but that it doesn't automatically lead to greater
> "reusability" as so many promised when it first got popular. (I count
> "reuse" as the ability to take code already written and use it in ways
> not anticipated when it was written.)

I tend to agree with you. A procedural library with proper standards and
documentation is much easier to use *and* extend. Problem with OO is just
what you mention, "anticipation". If the authord of an OO library did not
anticipate a usage pattern that you wish to employ, it's
unusable/unextendable at worst, and inefficient at best.

A great majority of the time, I write procedural libraries. I still use and
extend libraries I've written 15 years ago. For a new project, I write OO
wrappers around those libraries. I rarely, if ever, re-use those objects
outside that particular project.

OOP is only an improvement over using global variables in procedural
programming. It's *not* an improvement over procedural programming. If one
can wrap everything in procedures, that's the ideal, if you ask me.


Post a reply to this message

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