RE: [Grouptime-developers] Coding Standard - is it ready?
Status: Pre-Alpha
Brought to you by:
sauanimal
From: Jan U. <ja...@ko...> - 2002-09-09 14:22:45
|
> what about my proposals > 1) to have C as prefix in the class names. no C prefix, there's no point > 2)to use PHPDoc compatible comments - for file and functions. > Constants will self explain them. Nope, we use comments as they are described in our standard 3)I see that there is no > proposal for variable names : $some_var or $someVar. I think > the former is better because the second is the way the > methods are named. So by using the former it will be easier > to track errors for using an property instead of calling > method. ($s->updateThing vs > $s->updateThing() ). variable names are also used as $someVar, $someOtherVar > 4)Strict typing : > If one var is used as int it will be int to the end of the > script. In conditions IMO it is better to use === and !== to > check and type. Otherwise problems can be faced. Consider > this : <?php $str_val = '0'; if ($str_val) echo "one"; else > echo "two"; ?> This will output "two" no matter that > strlen($str_val) is not 0. This is type juggling. So use === > to check. 5)Casting : I prefer this : $i_var = > (int)$some_str_val; Others are (string), (float) I've told you, both can be used, it's not a matter of standard as I see it. > New ones : > 1)POSIX regex(ereg_* ) or PCRE regex(preg_*) I preffer ereg_*. Jan |