Re: Do you have some standard for defined the variable in program language?
| From: | tedd | Date: | Tue, 27 Jul 2010 16:52:47 +0000 |
| Subject: | Re: Do you have some standard for defined the variable in program language? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307178@lists.php.net to get a copy of this message | ||
At 3:12 PM +0530 7/27/10, viraj wrote:
$firstName is the most readable.. for variables. does anybody have negative thoughts on using the same naming format for method/function and for class names? i guess it's worth sharing! many thanks! ~virajI like using $first_name. I don't have any problems with using that convention for method/function/class names. The only problem I have found (regardless of naming convention) is in using $_SESSION[]'s. Sometimes: $first_name = $_SESSION['first_name.']; will cause problems. The solution is to use an index that's named different than the variable name, such as: $first_name = $_SESSION['session_first_name.']; Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com