Updated the standard a little

This commit is contained in:
jengo 2001-05-19 03:59:04 +00:00
parent 6b3a39b639
commit a1491eda4a

View File

@ -11,29 +11,36 @@ It should look like this:
6) Do not document every bit of code in comments. PHP is an interpreted language and it will be nasty on performance
7) Use switch statements where many elseif's are going to be used. Switch is faster and I like it better!
8) If statement formats
Choice 1:
if ($var == 'example'){
8) If statement need to follow the following format
if ($var == 'example')
{
echo 'This is only an example';
}else{
}
else
{
echo 'This is not a test. This is the real thing';
}
Choice 2:
Do NOT make if statements like this
if ($var == 'example'){ echo 'An example'; }
(I prefer that choice 2 should not be used when there is an else involved.)
All other styles are not to be used. This is it. Use it or I will personally come and nag you to death.
9) class/function format
class testing
{
function print_to_screen() {
function print_to_screen()
{
global phpgw, phpgw_info;
if ($var == 'example'){
if ($var == 'example')
{
echo 'This is only an example';
}else{
}
else
{
echo 'This is not a test. This is the real thing';
}
}