Coding Standards

As far as code goes, I don't care if you use Tabs or 4 spaces. If you use Tabs, make sure your editor is set to display tabs as 4 spaces though. :)

Camel Case is key in most cases.

Class Names

I prefer class names be named using a first Upper case, such as:

class SiteManager {
/*..code..*/
}

It's just an easy way to say "hey! that's a class, not a function."

Function Names

I prefer function names to have a first !lowerCase letter.

function thisIsMyFunction() {
/*..code..*/
}

Variable Names

I also prefer variable names to have a first !lowerCase letter. They should be descriptive and meaningful. Usage of short names ($i, $x) should be kept to minimal usage (for loops only, really.) They should never be found outside a function.

If you think this confuses with function names, well, the $ usually gives it away, also the lack of () is easy to decifer. ie:

$this->variableName;   /* vs */
$this->functionName(); /* the difference is clear. */

Database and Forms

I use a funny naming convention for those, and it annoys most people. That's why I'm keeping it. It's fairly simple though.

tbl_my_table
fld_some_name
frm_some_name

tbl_my_table is the table in the database, fld_some_name is a field/column name and frm_some_name is a value from a web form which is destined to end up in fld_some_name

Got it?

Lower case, split with underscores, prefixed with what it is. tbl, frm, fld.

Comments

I'm not too picky, yet. A nice block describing the task at the top of any php file and brief descriptions above functions would be nice though.

See Also: File Naming Conventions

more to come...