Re: Do you have some standard for defined the variable in program language?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!

~viraj


I 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux