ColdFusion Builder and development productivity – Part II
Tags: Coldfusion
In a previous post I touched on some of the features that will enhance productivity, and in this post I will go into the line debugger and show how it can be very productive as well.
Most people aren't aware of how the line debugger works, and even those who are very seasoned developers haven't even began to use its power in any way shape or form.
So how does the line debugger give me more productivity, well it all boils down to what you see and what you don't see and what you don't see if very little.
When a line break is fired you will see a window with some information like this.
By default most of this information is switched of and one has to switch it on, but when it is switched on it provides everything you need to know. I have a ColdBox handler setup that I am using for this post, that looks like this.
var rc = event.getCollection();
var test = {};
test['andrew'] = 'something to goes here..';
writeDump(test);
event.setView("home");
}
And after the dump I have a line break that has fired, so what you can see in the next image is that not only can you see what is there for that snapshot of the Application as it stands, but you could look at all other scoped variables as well.
You will also notice that I have dumped some information out to the screen, or the request that will be sent back to the browser at least. This is a handy little feature of line debugging, lets say we are running over a query in a loop and we are building a table up and something is going wrong. But we are not 100% sure what is causing the problem or at what stage. Well with the line debugger you could go line by line through the code, see what the variables contain at that point of the Application, but most importantly you can also see what is in the next image as well. And this can make this unused feature very worth the time to go through this debugging process.
As you can see you can not only see what will be seen by the browser as final output, but you can also see the source of this as well. So if it is a class / style that is not being generated when it should or that a wrong variable is getting calculated, by line debugging and flipping between these views in the debugger you could potentially increase your productivity very quickly.
There are still a few small problems that the line debugger does that it shouldn't, and I am confident that in time when people begin to use this feature more that it will be complained about even more.
So as you can see it is fairly powerful, because you are not going back and writing code to always dump other scopes or other structs, arrays or whatever. Because you can run through the code, step into each function line by line and watch all the variables change without changing your dump output.
Give it a go, I swear that give it the time it deserves you will stop going back to using cfdump.
There are no comments for this entry.



TweetBacks