From: Andreas A. <a.a...@th...> - 2001-05-14 10:44:54
|
Hi 1.) Variable and method names: mixed case with lower case leading, with leading or trailing underscores to signify private or global. > e.g. $userName seems to be favored and $_userName for a local and > "private" variables, $userName_ for global and for "public". I'm with you. But there is still the problem with the extra namespace for variables from the outside. So with the underscore there is a clear distinction between globals from the outsite $myName_ (passed in the url via script.php?myName.=value) and "internal" globals like $myName. On the other hand we have a "namespace" for varibales that are, and functions that should be considered as privat: $_privateName and _privateMethod();. So I would only use the leading "_" for private methods/vars and the trailing "_" for globals from the outside. Possibly a good solution I think (and there are not to many _'s than prepending or appending to each and every variable/mehtod). Andi |