Page 1 of 1
namespaces?
Posted: Fri Aug 09, 2002 12:50 pm
by afeick
Does PHP have such a thing as namespaces? I found
this article from Zend. It's pretty old (over a year), and there's really no other info.
My guess is that the answer will be no... So how do you avoid collision of names? Is there a good naming convention? Should I just write code with horribly obfucated names?
-Tony
...
Posted: Fri Aug 09, 2002 3:44 pm
by Takuma
Not that I know of....
Posted: Fri Aug 09, 2002 3:57 pm
by MattF
If you are refering to the naming of variables and functions then there are recommended ways of doing it, it is often suggested that for functions with more than one word names eg checkuserisadmin() you should capitalise the first letter of each word except the first, like this: checkUserIsAdmin() this makes it easier to read and see errors. Similarly with variables clear names should be given but I think they should not be too long, for example $x is not a good variable unless it is an x co-ordinate in a graph or actually means something in itself. Is this what you meant?
Posted: Fri Aug 09, 2002 4:39 pm
by BDKR
I believe namespaces is something that may be included in PHP5, but I've been wrong before.
Anyways, I like to use underscores, but I'm also one of the few PHP proggers that uses the "#" style of comments. I hope they never get rid of it or a lot of my stuff is going to come to a screeching halt.
Later on,
BDKR