2008/9/16 Brian Sadler <[EMAIL PROTECTED]>

>
> Apologies if this has been done to death before but...
>
> Whilst reviewing some code written by a colleague, my hackels were
> raised by the presence of HN gems such as arr_str_mimeattach (to
> signify an array of structures called mmimeattach apparently).  Am I
> alone in finding this stuff abominable?
>
> However, I've been quite happy to use things like qryGetCustomer and
> customerIdList which opens me up to the gravest of charges of being
> hypocritical...
>

Have you had a look at Ben Nadel's Clear Code Standards project?
<http://www.bennadel.com/blog/391-My-Coding-Methodology-Understanding-The-Madness-And-The-Man-Behind-It.htm>
http://www.bennadel.com/blog/391-My-Coding-Methodology-Understanding-The-Madness-And-The-Man-Behind-It.htm

While I understand the reasoning behind his code formatting I, personally,
find it hard to work with, but I already did some of the things he notes
and have taken on board few extra points that he mentions.

Code layout isn't the reason I'm mentioning this though.  The naming
conventions is more what I would draw your attention to.  Again, I don't
agree with everything, but its certainly a good start for clear naming of
variables including the data type.

Barney, I also use , i, j, k as iterators, but I wouldn't go up to m and n.
 "n" particularly.  Not entirely sure why, but using "n" as a variable just
makes me uncomfortable. As using just "s" for a struct in a loop.....  I
kinda understand, but stop it!!!  Its just not nice... Show your variable
some love! Give it a name! ;oP

Sam,  I don't agree with postfixing data type on the end of a variable.
Postfixing datatype would mean that it would merge into the variable name,
unless you used an underscore.  Personally, I find it cleaner and more
readable to prefix datatypes to variable names, plus I only really prefixes
"complex" types :

 oVarName : java object or component
 stVarName : struct
 aVarName : array
 lVarName : list of simple values
 qVarName : query object

As long as the variable is suitably english in its naming, then you should
be able make an educated guess as to its content, be it numeric or string.

Alan, bIsAdministrator! lol I know where you're coming from. I've typed it
and then thought - "what the hell are you doing stephen!?" and it either
becomes isAdministrator or bAdministrator.  Both of which says this is a
true/false variable.


Basically, I think I fall in to the Sean camp - naming that makes the code
read like english.

Anyway, that's my 2p...

Stephen

--~--~---------~--~----~------------~-------~--~----~
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