Re: OOP slow -- am I an idiot?
| From: | Stut | Date: | Thu, 12 Oct 2006 19:12:37 +0000 |
| Subject: | Re: OOP slow -- am I an idiot? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243047@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
I *still* don't see OOP as a Right Answer for spitting out HTML web pages in optimized minimalist time frames... Maybe my brain just got warped by all that AI/Lisp work I did for a couple decades, but it feels to me like a bad selection of weapons for the task at hand, most times I see it in PHP. [shrug]There are different levels of applications that are 'spitting out HTML web pages'. If you're developing a system where each script is independent and simply makes use of shared code then OOP is almost certainly not worth it. When you get to a system of the size I deal with (several thousand files with several hundred classes and a single entry point) it becomes a lot easier to deal with that in an OOP fashion. As for your other posts about have a class that represents a single customer not being a good idea if you are going to be dealing with potentially large sets of customers, I would have to agree whole-heartedly. And I apologise if I read your post as an absolutely anti-OOP opinion when it was not. I came from a C/C++ background and feel that I understand the good and the bad effects of using OOP very well. In a PHP environment you generally need to take more care with how you architect the system to take into account the build and tear-down that occurs with each request, but OOP can still be used to great effect in large PHP sites. I do take issue with your 'free advice' when you say you should base your OOP code on your existing code. One of the things OOP does is allow/force you to think about the way you deal with data in your application from a different angle. That's definitely worth doing. In my experience developers get stuck in their habits far too easily and anything that causes you to re-evaluate the way you to things has to be worthwhile. Anyways, some of that probably didn't make much sense, so I need to write some code now. -Stut