Class names

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Class names

Post by Luke »

What's the standard way of naming classes?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

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 :?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I was just wondering if there was a standard. I'm trying to make things as easy to read as possible.

Burrito:content edited.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

(unable to delete this.ignore this post)
Last edited by Charles256 on Fri Nov 11, 2005 2:30 pm, edited 2 times in total.
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

OK, charles... I'll refrain from using this site for its purpose. Thanks buddy.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

awww.don't be like that. where's the smiley that looks like a hug ? :( I apologize if I sincerly hurt your feelings.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I love you charles.. let's make out.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

slow your role..let's not get carried away with ourselves now..
Post Reply