Class names
Moderator: General Moderators
Class names
What's the standard way of naming classes?
Pick a name.. use it.
Is this really that hard to work out?!
Take a look through http://pear.php.net to get an idea, if it's really that difficult
Is this really that hard to work out?!
Take a look through http://pear.php.net to get an idea, if it's really that difficult
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
(unable to delete this.ignore this post)
Last edited by Charles256 on Fri Nov 11, 2005 2:30 pm, edited 2 times in total.
In a similar vein to functions, some name which offers a description of what that class does.
It's all matter of personal preference, some people prefer to capitalise the first letter of there class name, others prefer a CamelCase style i.e. a class which handles sessions may be called SessionHandler or Session_handler or variations of. There is (as far as I'm aware) no real standard.
PEAR have documented their coding standard/style although I'm not sure if this extends to naming conventions but it may be worth a look to get a general idea of at least one style. Personally I don't adhere to PEAR standards but as I said it's all down to personal preference.
It's all matter of personal preference, some people prefer to capitalise the first letter of there class name, others prefer a CamelCase style i.e. a class which handles sessions may be called SessionHandler or Session_handler or variations of. There is (as far as I'm aware) no real standard.
PEAR have documented their coding standard/style although I'm not sure if this extends to naming conventions but it may be worth a look to get a general idea of at least one style. Personally I don't adhere to PEAR standards but as I said it's all down to personal preference.
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm