Re: Object oriented??
| From: | Peter J. Schoenster | Date: | Fri, 26 Jul 2002 05:00:24 +0000 |
| Subject: | Re: Object oriented?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109670@lists.php.net to get a copy of this message | ||
On 26 Jul 2002 at 0:21, Mike Mannakee wrote:
> I'm curious how the OOP features are viewed in PHP. I'm originally a
> C++ guy, and took to PHP because of the similarity. In C++ one wouldn't
> think of not using OOP principles, but frankly I cannot really figure
> out why one would go to OOP methods in PHP. It's not a true OOP
> implementation, though for web stuff it's probably close enough. I've
> written nothing but traditional code in PHP and like it that way. How
> common is this? Do most people write OOP or traditional linear code in
> PHP?
Mike,
I come from Perl :) and I think more modular than OOP. We have linear code in Perl, tons of it. Ever
have to debug or evolve websites written in linear Perl? What's really fun
are the ones that repeat lines of code 4,5,6 or more times in one hugh file. I've had to work
on code written by others since 1998. Let me see, this variable, gee, where does it
come from ... oh that file which includes this file if that variable in that file over there is true
and .... gives me the creeps. So in Perl I organize code in modules, not "thinking in
OO" but organizing my code in hopefully a sensible manner so I can isolate actions, I can trace
actions and variables easily. I use the "OO" features of PHP the same way.
There are a lot of really nice looking apps written in PHP but I won't touch them. They work or
they don't, and if they don't then I never get entangled in them. One thing I'm
trying to work out is an MVC approach with PHP. I've got one in Perl and it works great.
Peter