On Tue, Jan 19, 2010 at 01:12:49PM -0500, Robert Cummings wrote:


> I would have to agree that OOP is not a fad, perhaps over-hyped at
> times, but definitely not a fad. The argument about class dependencies
> is an invalid argument since functions will also have dependencies on
> other functions from other libraries, quite likely located in multiple
> source files. 

Yes, functions can have dependencies as well, but you simply call the
function you need from within another function. It's been done for
decades in C and any number of other languages. Anyone who's ever
programmed in C (or comparable language) is familiar with having to do
"includes" at the beginning of source files and simply calling functions
now visible or now linked. This practice is frowned upon in OOP, or
"dependency injection" wouldn't have been written about so much.

> In fact, you've argued an advantage for OOP in the context
> of PHP since autoload can be used to mitigate this issue for classes,
> but not for functions. 

Autoloading doesn't mitigate class interdependency unless you build an
autoload function which handles dependency injection transparently.
Again, a complex proposition.

> Another advantage of OOP that is difficult to
> provide via the procedural paradigm is polymorphism.

Agreed. Though the advantages of polymorphism are questionable,
depending on your viewpoint.


Paul M. Foster

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to