[nycphp-talk] About Human Readable Variable Names Moving Among PHP, HTML and MySQL
Warren Myers
volcimaster at gmail.com
Thu Sep 28 09:08:38 EDT 2006
I personally like to use compact variable names, and keep them as tightly
scoped as possible. In fact, I don't recall the last time I used a variable
whose length was more than 10 characters - it's just not necessary in my
opinion.
I also come from a C/C++ background, so I tend to think of everything in
lowercase - only capitalizing when using external libraries that someone
else wrote.
WMM
On 9/28/06, Billy Reisinger <billy.reisinger at gmail.com> wrote:
>
> > 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...
>
>
>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
--
http://warrenmyers.com
"God may not play dice with the universe, but something strange is going on
with the prime numbers." --Paul Erdős
"It's not possible. We are the type of people who have everything in our
favor going against us." --Ben Jarhvi, Short Circuit 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060928/5a641674/attachment.html>
More information about the talk
mailing list