Re: Short Names

From: Date: Sat, 25 Sep 2004 23:23:18 +0000
Subject: Re: Short Names
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-36389@lists.php.net to get a copy of this message
IMHO, no -- it makes the code more readable. I'd also recommend making sure that variable names match their purpose (so, for instance, if you have a variable that contains a mailing address, use $mailing_addr, or if you have a variable that contains an array of recipes, use $arr_recipes). The more you can make your code readable, the better. Always keep in mind the other people that may read your code -- this, in general, means commenting and using good sense in variable names. It'll help you later for when you haven't touched the code in a year or two and need to know what you wrote and why... Hope this helps. -- Peter Ellis - pellis@naturalaxis.com Web Design and Development Consultant naturalaxis | http://www.naturalaxis.com/ On Sat, 2004-09-25 at 14:23 -0700, Cole S. Ashcraft wrote: > Is it considered bad / sloppy to define the short names of varibales at > the beginning of your code so you don't have to type out > $_REQUEST[variable] or $HTTP_REQUEST_VARS[variable]? > > Cole >

« previous php.db (#36389) next »