Another Reason To Use Classes Instead of Functions
Posted: Fri Jan 08, 2010 2:27 pm
Here's reason # 1001 to use a class instead of a list of functions:
A function without a class container or a namespace is kind of like a global variable. You read a passage of code, see this function, and go, whoa! where did this baby come from? Is this some new PHP function I never heard of yet? At least with a class you have some kind of understanding what it belongs with and might be able to find the class file usually.
A function without a class container or a namespace is kind of like a global variable. You read a passage of code, see this function, and go, whoa! where did this baby come from? Is this some new PHP function I never heard of yet? At least with a class you have some kind of understanding what it belongs with and might be able to find the class file usually.