I find I'm in the minority with this, but I use some variant of HN on nearly
all my projects.  I originally came from a C++ world (working on video
games) and it was used heavily on those projects.  Nowadays, even when I
work with ColdFusion, I find the visual reminder of the data type to be very
helpful.

If I use HN, I'm guaranteed not to use a reserved word as a variable name by
accident (see Ray Camden's blog post a few months back).

If I have to deal with files that are incredibly long, I may not see the
initial (for example) CFQuery, or ArrayNew() or other "clue" as to what the
data type is.  Without scrolling up to the top of the screen (and losing my
place), I may have no idea what "foo" is storing (okay, I may have SOME
idea, but I'm still having to do a bit of guess work).  But if it's
"arrFoo", I know it's an array; "qryFoo" is probably a query and "pFoo" is
probably a pointer (as was the convention I used in C++ for pointers).

Quick! What's the variable "User" storing? An object? A struct? A string?
There's no way to tell without looking at other code.  Now, what's "strUser"
storing?

(Joelonsoftware.com has a great article on naming conventions, prefixing
variables based on if they're safe (i.e. the data has been tested), or
unsafe (just submitted by an unknown user via a web form) and so on.  It's
well worth reading.)

2 cents.

-nolan




On Wed, Sep 17, 2008 at 5:51 PM, Alan Livie <[EMAIL PROTECTED]> wrote:

> My pet hate is cfc METHODS with fn in front of the method name.
>
> I admit to the occasional lapse with HN. We use it as a coding standard for
> a company I work for and it has bled into other projects for other clients
> but I'm working on it :-)
>
> I spend so much time making my unit tests test method names read like
> English then lapse in my actual code and do things like bIsAdministrator ...
> DOH!
>
> Alan
>
> ----- Original Message ----
> From: Sammy Larbi <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Wednesday, September 17, 2008 5:21:12 PM
> Subject: [CFCDEV] Re: Hungarian notation is for numpties - discuss!
>
>
>
> On Wed, Sep 17, 2008 at 5:03 AM, Tara Mclean <[EMAIL PROTECTED]>wrote:
>
>>
>> I will admit that I have questioned my self as to whether this is
>> needed since arPerson would do just fine. Do I need to know what the
>> array contains? And arPerson looks a bit neater.
>>
>>
> What about dropping the "ar" too (is this Person a pirate?) and just call
> it "people." Plurals in variable names mean collections of variables,
> assuming there are some sanity-preserving conventions the writer is
> following. =)
>
> In other words, I'm with Barney on that aspect.
>
> Sammy Larbi
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to