Filed under: — Scott @ 11:50 pm
Running notes on my coding style. The older the script the more likely I didn’t use a guideline:
- I always test for a positive value. This means that when I am testing for a condition and I never use the “inverse of” operator.
What I avoid:
if( ! $varname)
{
# then do something
}
What I do: if( $varname) { # then do nothing } else { # then do something }I believe this make for easier reading for less experienced programers.
- class and object names are prefaced with lower case c or o respectively and use the camel notation.
What I do: class cClass { function __construct() { } } $oMyClass = new cClass(); - Variables that are not objects use underscore notation.
What I do: $counter_for_loop = 1;
Popularity: 1% [?]






No comments yet.