NYCPHP Meetup

NYPHP.org

[nycphp-talk] About Human Readable Variable Names Moving Among PHP, HTML and MySQL

Billy Reisinger billy.reisinger at gmail.com
Thu Sep 28 09:03:38 EDT 2006


> Why not be consistent and make the"w" be upper case as well
> $WillGoBackUnderMySteamyPileNow = true;
>

Some people reserve capitalized variables for class names only, so  
that function names and variable names will always start with a small  
letter:

class NutJob {
	var $crazyPerson = "billy";
	function whackCrazyPersonOverTheHead(person) { ... }
}

Seems like a good practice to me.

> I canät tell you how often I borked my
> script by just leaving out an e or an s in a variable name.

I have this same problem.  One thing I have found to help is using an  
auto-complete feature in my text editor.  Not only has it saved me  
typing time, but also I don't spend as much time debugging, only to  
find I misspelled some huge variable name.  I know jEdit has auto- 
complete, probably Eclipse, too...







More information about the talk mailing list