Boyan Kostadinov's cfSnippetExecutor For ColdFusion Testing
You might remember Boyan Kostadinov from such places as my blog where he makes a habit of dropping awesome suggestions on me. This guy's like an idea-machine. Well, he's just come up with a new, very interesting idea: cfSnippetExecutor. Like me, Boyan suffers from a massive code testing directory (he, in fact, has a whole virtual site for it). This is due to the fact that every time we come across something that looks cool, we want to try it out ourselves. This requires messing with the ColdFusion server and the creation of a ton of test files.
Well, what if we didn't need to create a test file every time? What if we has the equivalent of a run-time Javascript evaluator? That's pretty much what cfSnippetExecutor is, except for ColdFusion. The idea here is you put your test code into a TextArea, AJAX shoots it off to the server, the server executes it as a dynamic file, and then returns the output result in the AJAX response.
My only concern would be that this, of course, opens you up to all kind of potential malicious problems (since you pretty much can't lock down things like CFFile or CreateObject() cause, well, what would be the point?). But, Boyan's thinking on this was that it is NOT a public script. You put it on your machine where you and you alone have access to it. This makes it only as dangerous as you want to be to yourself.
Now, there is plenty of testing that requires more than one page, but as far as seeing something on someone else's blog and having that "oh that's cool, let me try" desire, this could be very cool. I will be interested to see what other people think.
Reader Comments
Do you use CFEclipse? I use the scribble pad a hundred times a day to test snippets of code.
@dan: I'd be very interested in hearing more about how you use scribblepad - there I just gave you an idea for a blog post ;)
Great Idea! I would really like to try out my new screen cast software as well, maybe I will throw 1 together if I can find a mic.
@Dan,
I use HomeSite 5.5 still. I have tried to use Eclipse a number of times and I can never seem to get my scribble pad to work. Something about the configuration of it always seems to go horribly wrong.
All ~ This is a great tutorial on setting up the scribble pad. If you guys have any problem after reading that tutorial feel free to email me.
http://daveshuck.instantspot.com/blog/index.cfm/2006/10/27/How-to-setup-the-CFEclipse-Scribble-Pad