View Single Post
Old 11-07-2007, 12:31 PM   #7 (permalink)
Karl
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 437
Thanks: 22
Karl is on a distinguished road
Default

On the subject of "defines", why arn't people using the PHP5 equivalent, that's, const. I see it all the time, people create a Database class (for example) then place the defines that work with it in the global scope, rather than using class to encapsulate this information.

Another advantage of this is that you don't have to be so strict with your const names, i.e.

Member::ACTIVE_FLAG
Job::ACTIVE_FLAG

rather than

MEMBER_ACTIVE_FLAG
JOB_ACTIVE_FLAG
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Karl is offline  
Reply With Quote