05-07-2008, 02:29 AM
|
#13 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
It really all depends on what you're trying to do. Is it a project for yourself, or one intended for the open source community? or one to be sold? Is it something you want other people to be able to extend, or is it going to be a complete package? Is it huge, as in enterprise scale, or is it small, home page kind of stuff?
There's a lot of different reasons to implement things in various ways. I've been bitten by the OOP bug, but I do recognize there's cases when procedural code is just as good, so be careful you don't completely come over to the dark side. There's always more than one way to do something.
At the same time, classes aren't only useful for code you plan to reuse in different projects, so I have to disagree with Orc on that one. They're a great way for methods and properties to co-exist that all rely on one another or that work together in some fashion.
Personally, I have all my classes in seperate files, because I find it functional and organized. The downfall to this, is the overhead created by include()ing each class file individually as necessary. Including one file each time would be way less overhead, but the downfall there is, what if you don't need each class everytime? Then the overhead comes in the total filesize of each script the user is loading.
So it all comes down to what you're doing, and what the most important objective of your project is.
-m
|
|
|
|