0

How do you comment/document your CFCs?

ColdFusion

The "CFC Component Doc Static Generator" posted by Christopher Wigginton is a true gift to the CF community.  I hope you didn't miss it.

Although I've been aware of them since they were first available, I haven't really found much use for the introspection docs, viewable in the CFC Explorer of the CF Admin.  I always thought is was *cool* and all, but normally I'm just coding along, and expect (or at least hope against hope) anything non-obvious is commented - in a readable way. 

So, that brings up the point of this entry... earlier today I was discussing with my fellow developers that I never really liked to use the "hint" attribute of cfcomponent or cffunction, because it's very difficult to read. And I asked if any of them actually used the CFC Explorer, and they all said, "no".  So, I pointed out that "normal" comments above any code in the CFC that is doing something non-obvious is my preferred method to comment/document CFCs.  They had no arguments to that...

But I'm curious how others feel on this matter...? 

For me, the "CFC Component Doc Static Generator" may change my mind, since it's a more convenient (and fast) way to access the docs, since they're static and not necessarily tied to the CF Admin.  We'll see if it changes the way I work with CFC in the near future...

tags:
ColdFusion
Sam Farmer said:
 
Hint. For pretty much the reason you state above -- it makes real, easy documentation. I also start each hint with "I" so "I am a userID", etc. I've found that starting with I has made me more consistant.

In particularly complicated code I will also use inline comments but that is used to describe how things work whereas hint is to describe what a cfc and its functions and arguments do.
 
posted 968 days ago
Add Comment Reply to: this comment OR this thread
 
 
I picked up a cool method from a friend that worked at match.com, which was a format they used on their CFCs. I would love to say that I am diligent about this, but in reality I find that I mostly only use it when I know someone else (other than Aaron) is going to look at my work! :) Here is a sample of a piece of code I just submitted to Jacob Munson for his CFFormProtect project:

http://codeshare.ulatu.com/mar0bf0e
 
posted 968 days ago
Add Comment Reply to: this comment OR this thread
 
 
Damn I just noticed that submitted that code to the project with the word "exeption" in it! Greeeeaaatttt... My typo is permanently documented.
 
posted 968 days ago
Add Comment Reply to: this comment OR this thread
 
cfZen said:
 
Thanks Dave and Sam,

So, how did you guys notice my posting? I haven't had luck getting my blog listed on fullasagoog or weblogs.macromedia.com/mxna/ yet, so I'm wondering how you found me?
 
posted 968 days ago
Add Comment Reply to: this comment OR this thread
 
cfZen said:
 
And Dave - The code sample with the hint nicely formatted is an excellent idea. That clears up the readability issue I have with hints. So, out of curiosity what would the hint comments look like within the cffunction and cfargument tags?
 
posted 968 days ago
Add Comment Reply to: this comment OR this thread
 
 
My name is Dave and I am an InstantSpot addict.

(new entries are listed on the home page of http://www.instantspot.com )

Also, you will start seeing google traffic pretty immediately. We are *heavily* indexed in Google. You will find that with almost everything you blog, you will be listed on the top 10 of Google within the week. Example: http://www.google.com/search?q=classic+cf+debuggin...

I will send in a recommendation of your feed to the goog guys for you as well.
 
posted 968 days ago
Add Comment Reply to: this comment OR this thread
 
 
Sorry, I missed the second question. I typically don't do that with the method hints, but I believe it would output the same with self-documentation. I am usually less verbose in the method hints and instead just place comments where necessary
 
posted 968 days ago
Add Comment Reply to: this comment OR this thread
 
Sam Farmer said:
 
cfZen -- From the instantspot.com home page.

I just started my blog yesterday and am going through the same process registering with aggregators myself.
 
posted 964 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Aaron  Longnion

The Hague, NL