Re: Another question about classes..

From: Date: Fri, 23 Jun 2000 15:03:35 +0000
Subject: Re: Another question about classes..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2804@lists.php.net to get a copy of this message
----- Original Message ----- From: Jason Stechschulte <jpstech@nc.edu> To: PHP - GENERAL <php-general@lists.php.net>; <owlcat@prodigy.net> Sent: Friday, June 23, 2000 8:26 AM Subject: RE: [PHP-GENERAL] Another question about classes.. > Ok, I too am trying to grasp all this class stuff. I have been > coding basic apps for about 3 months, and after reading a bit and > playing around a little, I think I have a good handle on how it works, > and why classes are "cleaner" and all,... BUT, here is what I dont > understand - In PHP, this "page-scoped" variable thing - of what > real use are classes/objects, if everything in PHP is always > page-scoped (Sessions aside, I mean...) and the objects cannot be > carried around? The "page-scoped" variable thing is not from PHP, it is from HTTP. Each page is stateless - that's the spec. The main use of classes is spelled out in all the books on OOP - encapsulation of data - ease of design etc. If you are working by yourself on a project, and will do so forever - really no need to worry about it. However, if you are in a busy environment, and need to add functionality to a project, or you are working with 5 or 6 other coders, then objects are great - just to keep functionality separate. Using the basic OOP in PHP, you can design a project for multiple programmers, some very familiar with the project, and some who just got hired that day, and have everyone contribute in a hurry. Productivity goes up. Business gets better. The coders get together for drinks and fun. They notice that since productivity is up and business is better and they have more time, that they are making the same amount of money as before. Time to ask for a raise :)

« previous php.general (#2804) next »