ColdFusion Debugging Can Be Painful

Wouldn't it be nice to be able to use break points, variable watch lists, and code stepping in CF? While ColdFusion does have some nice things for debugging sites, the problem is that it mostly happens at the end of a page execution. So if you want to see what the app looks like at a particular point in time, you have insert manual breaks and dumps.

Before becoming a CF developer I did some Delphi coding. I loved being able to set a break point, run the app, and it stops where I told it to. I could then view variables in their current state, and then step through the code one line at a time. This is awesome when you have a nagging bug, and you need to see exactly what your app is doing at a point in time.

Of course, using cfdump, cfabort and similar tags, you can duplicate what was mentioned above. But this is cumbersome and time consuming. I asked a local software developer group about debugging in ASP.Net, and I was told that breakpoints, stepping etc. works if you are using Visual Studio. So then I brought this up on the CFEclipse contributors list, and we decided that the best thing to do is wait for Adobe to update ColdFusion with APIs and hooks for debugging. I guess CF 5 had this, so I'm really hoping we see this in a future version. If we want to attract more developers to CF, we've got to make debugging easier. As Randy from BSDG said, "VS has excellent debugging features...my hair would be completely gray (as opposed to partially) if it weren't for these features!"

Related Blog Entries

Comments
Yes, earlier versions of CF had this if you used CF Studio; however it never worked right and as such was rarely used and it never made it to the CFMX priority list.

I heard an inkling once that "Better Debugging" capabilities would be on the list for the next version. I don't remember when I heard that, though, so we can mock it up to wishful thinking.

The "dump / abort" combo can be pretty powerful, although it's no debugger replacement. I bet a full featured debugger built in to dreamweaver might stop the 'exodus' over to CFEclipse (and/or speed the exodus away from homesite)
# Posted By Jeff Houser | 3/24/06 4:39 PM
The most interesting debugging tool I've seen is Bil Lewis' Omniscient Debugger:

http://www.lambdacs.com/debugger/debugger.html

If there was something like this for CF, I'd be in heaven.
# Posted By Erki Esken | 3/25/06 6:55 AM
Jeff,

There's an exodus to CFEclipse? From what? ;) Yes, I do use CFEclipse and love it. Dreamweaver is intended for designers not coders, so I doubt Adobe will ever move out of that scope.

Erki,

That debugger does look cool, too bad it's for Java.
# Posted By yacoubean | 3/25/06 12:22 PM
I think I intended to communicate the the 'exodus' was from HomeSite to CFEclipse. Although re-reading my post, I'm not even sure what I meant.

;) When CF Studio was abandoned, Dreamweaver was brought "up to speed" for programmers. Whether or not this was succesful is open to discussion (I think most, myself included, would say that it was not). But, the reality is that most of what I did in Homesite I can do in Dreamweaver.

(And can now do in CFEclipse).
# Posted By Jeff Houser | 3/25/06 12:51 PM
Personally, I think one of the most forgotten and powerful tags in CF is the cftrace tag. You can have it out put in the page or in the debugging output along with a log file with information about the trace execution level (warning, information, etc.) which is browseable within the cfadmin and very informative.

I typically just drop one each place I want to check something and then run the page with debugging turned on. So my page output is the same, but the debugging output shows all my traces, including time deltas between each trace (really useful for finding the slow spots of an application).

The only problem with the typical breakpoint scheme etc. is they still usually rely on some kind of annotation in code, be it a comment or development environment metadata. This usually requires hooks into the runtime environment which makes your code or debugging practices very IDE specific. While I use Eclipse and don't forsee switching, I am very careful about resigning myself to a practice which could equate to a lot of work moving away from.

One of the reasons I dislike .Net development so much isn't the languages, but the fact you are very much strapped to Visual Studio if you want any sort of efficient development at all. This isn't necessarily because the system isn't made in such a way that other IDEs can't be made to compete, but that .NET is architected in such a way that Microsoft is about the only one who will be able to keep up with those tools as they change them at their own will.

I appreciate the fact that Macromedia does not pull the same vendor-specific "encouragements" with CF as it tells me they are confident that their product is the best because of its features, not the handicaps they provide themselves over other competitors.

Haha, I apologize that this post turned from an on-topic comment to an off-topic consideration of other issues.

Oh well, that's a blog for you. Interesting post.
# Posted By Mike Kelp | 3/25/06 2:32 PM
> Personally, I think one of the most forgotten and powerful tags in CF is the cftrace tag.

Mike, true...to a point. more powerful is seeing serailised complex values: structs, queries, arrays, xml doc's...

> One of the reasons I dislike .Net development so much isn't the languages, but the fact you are very much strapped to Visual Studio if you want any sort of efficient development at all.

To be honest, I personally don't care. The thing is just a spanner. if it's been made by Sidchrome or Ken-Shu as long as it keeps getting the job done. I can't even think of other ASP.NET IDE's (does Borland still exist? you'd never know...)

I've been working on an asp.net application and because of it's history (.NET version, IDE initially used), debugging has been a complete nightmare without fully using Visual Studio 2005.

Just to survive, I've been screaming for something as simple as cfdump/cfabort. and and make-do with simple cftrace-style debugging - a real PITA and not the least bit productive.

to enlighten those who might not know:

...with VS2005, I've got breakpoints and full line-by-line step into/over/out debugging. I can watch any variable value with just a mouse-over. this includes complex values (object properties, results of any table within a dataset, xml, etc). I can step into any object that's called. When a page finishes, I click on a button or link (or whatever) and the debugging continues line by line to the target page.

I'm in heaven!

>If we want to attract more developers to CF, we've got to make debugging easier


mate, I couldn't agree more! and not just to attract new blood, but stop CF projects and developers going elsewhere.
# Posted By barry.b | 3/26/06 6:57 AM
Mike,

I guess I kind of agree that tying yourself to one IDE could be bad. I'm not sure it's a real problem though, as most people just use the best IDE available for their language, even if it means moving there from something else (like all the people moving to CFEclipse). If Adobe were to add debugging APIs to CF to allow break points and watching, then any IDE out there could chose to support it. Adobe could use the API in Dreamweaver, and the CFEclipse guys could do it in CFEclipse. Later, if someone got enterprising enough to build a CF plugin for Visual Studio, it could use the debugging API as well.

Barry,

Good point, there may be developers chosing ASP.Net today, because debugging is a lot easier. I'd think that if they really knew CF, they'd stay there because the RAD capabilities are a lot better in CF, even if debugging is cumbersome. :)
# Posted By yacoubean | 3/26/06 10:20 AM
Good points. I concede that my original post was biased more on my development practices, than what is beneficial for all developers.

Adding a standard API for this level of debugging is a great idea. I admit that the CFTrace tag obviously isn't the most intuitive debugging tool, but my main interest was in bringing it up to those who weren't using it already.

I don't really know how much I think this is affecting who is using CF vs .Net though, for the sole reason that I don't really see it being as amazing of a concept as it is with software development vs. the debugging of a single web request. Maybe if it could watch session, application variables, etc. over several web requests. I don't know...I know several people who develop in .Net and none of them use breakpoints, etc. in their web development that they can remember.

I also say this, because the last time I personally have used or thought "I need breakpoints, etc." was when I was writing stuff like a C memory management program, or a Java Swing application in the first NetBeans (a classic hehe). I guess it is just not something that I have ever been upset about in terms of CF development.

While it is a great idea, I can't see asking for much language development time to be spent on it versus some of the other things I think CF needs. But maybe it is easier than we think to add.
# Posted By Mike Kelp | 3/26/06 12:12 PM
You are on the nose with this one. I know that MM looked at these features, but we are at Adobe now. These were features that few CF5- users knew how to use, it was hard to configure. Since few people were using it they did not build it into CF6+. (That was a serious mistake, the issue was that CFStudio was hard to set up for doing debugging. Then of couse there was the day Adobe sued MM over CFStudio... now let's hope they give us back the IDE we lost!)
# Posted By John Farrar | 3/27/06 7:34 AM
I just dont' see the need for any ide, but i do agree strongly about better debugging features.

Maybe since it's run on java, there is some hidden information we can take advantage of, and perhaps create an interpreter for...


I still plan on coding in textpad for the next 10 years.
# Posted By Craig M. Rosenblum | 3/27/06 7:38 AM
Mike,

I'd agree that Adobe probably could find more useful things to work on, but right now they seem to be heading full tilt towards Flex integration from CF. I'm sure a lot of you will disagree with me, but I'd much prefer to see a debugging API than Flex integration. I just can't see the benefit of Flex yet, especially because it's going to require users to have the new flash player that's not a stable release yet.
# Posted By yacoubean | 3/27/06 7:54 AM
Craig,

If you prefer to code with a bare editor, than you need a lot more help than debugging! ;) But seriously, thanks for agreeing with my main argument.
# Posted By yacoubean | 3/27/06 7:55 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9. Contact Blog Owner