Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2011 (Minneapolis, MN) with:

I Got Mentioned On The ColdFusion Weekly Pod Cast! (And A Note On Debugging)

By Ben Nadel on
Tags: ColdFusion

Duuuuude! I just got mentioned on the ColdFusion Weekly Pod Cast. How freakin' cool is that! (( blushing )).

And yes, that is how you say my last name... Nadel : (nay) (dell).

I just wanted to make one comment on something that was mentioned on the show. Charlie Arehart was talking about FusionDebug and he mentioned that sometimes it is hard to debug, especially when in a ColdFusion component that does not allow output. This is very true. Now, it is not a great method (for obvious reasons), but I just wanted to stress stress stress that the following code will ALWAYS be visible:

  • <!--- Dump out message. --->
  • <cfdump var="This needs to be debugged:" />
  • <cfdump var="#Now()#" />
  • <cfabort />

Anything CFDump'ed out followed by a CFAbort tag will halt the page and display the page buffer on the screen. This works in a non-outputting Component / Method. Heck, this even works inside a CFSaveContent tag and that tag isn't even meant to put stuff in the page buffer at all.

I am sure there are times when this doesn't work, but I have yet to come across one. Of course, you do ABORT the page processing, but when you are trying to debug, this is not worst thing.



Reader Comments

Hi Ben, hope folks enjoy the podcast. I'd like to respond to your point: I would only argue that sometimes doing an abort is itself troublesome. Because it stops the request cold, it could keep the output being generated from being complete, which could keep the browser from rendering it. I could imagine times when even the table from CFDUMP would not render, though like you I can't say for sure. It will also stop any onrequestend.cfm from running, and it would fire the onerror of application.cfc.

I don't mean to be picking. You make a fair point. Still, I hope folks will consider the debugger, especially when you can't (or don't want) to edit the code. Especially now that the price has dropped and the new $99 version has been made available, as I pointed out on my blog.

Reply to this Comment

Charlie,

I totally agree. CFDump / CFAbort does have its drawbacks, first and foremost of which, it kills the rest of the page. I just programmed in MX for a long time before I knew you could use it as a debugging technique inside of things the supressed output. I just thought it was cool and hoped maybe I could pass it on.

But yes, definately, people should have all the tools they can use to program better and most definately the more complex a system the less and less useful my technique will be.

Reply to this Comment

Sure, and sorry. I didn't mean to take away from the value of the aspect of the tip you were sharing: that use of the CFABORT did at least permit seeing the output within a CFC/function with output=false. Cheers.

Reply to this Comment

No worries dude, after your whole CFHttp / CGI variable naming comment from 2004... you can do no wrong :)

Reply to this Comment

Post A Comment

You — Get Out Of My Dreams, Get Into My Comments
Live in the Now
Oops!
Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.