On Wed, 2002-04-17 at 16:48, Vincent Oostindie wrote:
> On Wed, 17 Apr 2002 16:25:32 +0200, Jason Lotito wrote:
> > First, sorry for the somewhat rather harsh comments. That should teach
> > me to comment on stuff soon after getting up, and then not double
> > checking what I wrote. Please don't take anything personal by any of my
> > comments, as they are merely comments of a person still needing his
> > morning coffee.
>
> I never take anything personally. If I would do that, I would be a real
> mess. That's not to say many people make harsh personal comments about
> me, of course... ;-)
>
> > I still
> > find it somewhat a tradeoff for PHP to follow strict OO standards.
>
> Except that PEAR doesn't: no total encapsulation, returning different
> types from the same method... That's not 'standard' OO, if there ever
> was such a standard.
PHP is not Java, C++, Python or Smalltalk. Designing PHP code like you
would with Java will make your application horribly slow. PHP is
loosely typed, Java has method overloading. Having different types in
parameters and return values makes perfect sense in PHP, because that's
what the language is designed for.
Another big difference is that creating an object in PHP takes at least
an order or two of magnitude longer than in Java. Should PHP coders
ignore that fact when designing class libraries, or go on implementing
low-level classes such as "String" in PHP? That simply makes no sense.
There are general OO principles, and there are techniques that are
useful and common in specific languages. I have a feeling that what you
refer to as 'standard' OO is a set of rules that make perfect sense for
other languages, but not necessarily PHP.
- Stig
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|