I recently had the opportunity to work with some code developed by [NAME WITHHELD TO PROTECT THE INNOCENT] The code is absolutely great code, does some interesting things however…. it was just TOO well organized and way to verbose. Now normally if I’m going to criticize someone’s coding style, (which I generally do not do) it would be for the exact opposite reason as this. However this code was so well structured as to make it difficult to follow, and understand, much less fit on a screen.
Every argument for every CF tag began on it’s own line with every new tag separated by at least one line. Thus causing a single cffunction definition header (without any actual code in) to run to 40+ lines. As here
[VARIABLE AND METHOD NAMES HAVE BEEN MODIFIED IN THE FOLLOWING CODE TO PROTECT THE AUTHORS IDENTITY]
<cffunction
name=”functionName”
access=”public”
returntype=”any”
output=”false”
hint=”provides blah blah blah blah.”><!— Define arguments. —>
<cfargument
name=”Name”
type=”string”
required=”true”
hint=”some name.”
/><cfargument
name=”Type”
type=”string”
required=”true”
hint=”sometype.”
/><cfargument
name=”Location”
type=”string”
required=”false”
default=”here”
hint=”some location”
/>ETC…..
Additionally inside of a CFswitch statement … every case statement was preceded by the exact same comment and more than sufficiently spaced apart.
<cfswitch expression=”#whatsittype#”>
<cfcase value=”1″>
<!— exact same comment create a type of whatsit—>
<cfset scope.var = {
x = x,
y = y
} /></cfcase>
<cfcase value=”2″>
<!— exact same comment create a type of whatsit—>
<cfset scope.var = {
x = x,
y = y
z = z
} /></cfcase>
<cfcase value=”3″>
<!— exact same comment create a type of whatsit—>
<cfset scope.var = {
x = x,
b = b
e = e
z = z
} /></cfcase>
<cfcase value=”4″>
<!— exact same comment create a type of whatsit—>
<cfset scope.var = {
d = d,
y = y
z = z
} /></cfcase>
ETC….
Now don’t think that I believe that code needs to be short… I am a big fan of white space where needed… however if I need to scroll the screen to just read the method definition, there is a little too much verbosity in the code.
Coding is very much a matter of personal preference however when publishing code to the public it is generally accepted to follow some general guidelines on form. If you code in this style and share your code with the world… please take the time to condense your code prior to posting.
If you code in this style… why? What are your opinions on this coding style, is it helpful or does it make more work for the next programmer? What kind of style do you program in?

heh heh, I do this with my sql. Granted it is well indented but I hate having to hunt params horizontally in my stored procs.
That said, my CF code is not at all like that. I like to keep one tag on a line unless there are so many attributes that I bring it down a line and indent.
To each their own I guess. At least he is organized. I have dealt with some people who code like spaces and carriage returns are memory demons.
You’re right… it does depend on the language. My SQL always tends to be more vertical and like you I tend to keep params one per line. I think I’ve realized where the difference is. I’ve been working a lot with MXML lately and I think this type of thing could become a problem there as well. In fact I tend to think that it is one of the issues with tag-based languages. Because tags can be nested but also have properties the layout of nested tags and named properties causes the issue. My preference is for readability over the tag, not the properties. I want to be able to quickly match up the start and end tags. This to me is more important than being able to quickly enumerate visually over the configuration properties for the tag. This means that ideally the tag pairs should be on the same screen with aligned indents. In code based languages, vertical layout considerations don’t need to be made to help locate tag pairs so there is more flexibility to use it to help readability in other areas such as parameters.