Re: class usage

From: Date: Tue, 03 Oct 2006 18:38:22 +0000
Subject: Re: class usage
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-242568@lists.php.net to get a copy of this message
On Fri, September 29, 2006 1:21 pm, Robert Cummings wrote: > #3 In PHP > PHP has no namespaces, use classes to improve your chances of avoiding > namespace collisions. > > And I realize Richard will call this the wrong answer, but when you > don't have the tools you need, you make use of the ones you do have. Nope. Right Answer. #3 Code Releases If you are releasing your PHP code to "the world" wrapping it all up in a WELL-DESIGNED class so that you minimize the risk of namespace collision is a Good Thing. It's just that I am more of a "here's my home-brew code you can have" kind of an Open Source guy than a "here's the code I spent an extra 10 X amount of time making it bullet-proof so you could mindlessly install and use it" Open Source guy... :-) Obviously if you want to be the latter kind of OSS guy, you need to use classes to release your code instead of just slapping an "ln -s foo.php foo.phps" into your web tree to let it all hang out. YMMV :-) #3 Caveat There are *way* too many really badly-architected files out there that the author thinks are #3, but they aren't. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#242568) next »