Boyan Kostadinov's cfSnippetExecutor For ColdFusion Testing

Posted July 20, 2007 at 6:14 PM

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.

Post Comment  |  Ask Ben  |  Permalink  |  Print Page




Reader Comments

Jul 20, 2007 at 6:35 PM // reply »
35 Comments

Do you use CFEclipse? I use the scribble pad a hundred times a day to test snippets of code.


Jul 20, 2007 at 6:53 PM // reply »
1 Comments

@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 ;)


Jul 20, 2007 at 6:57 PM // reply »
35 Comments

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.


Jul 21, 2007 at 10:46 AM // reply »
6,516 Comments

@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.


Jul 22, 2007 at 4:19 PM // reply »
35 Comments

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


Post Comment  |  Ask Ben

Recent Blog Comments
Nov 20, 2009 at 11:32 PM
Five Months Without Hungarian Notation And I'm Loving It
I've used headless camel case for years for not only ColdFusion variables, but also SQL tables and fields... pretty much everything involving code. I also subscribe to the "don't abbreviate and clea ... read »
Nov 20, 2009 at 11:00 PM
Five Months Without Hungarian Notation And I'm Loving It
@Marcel, Yeah, I always err on the side of longer but more readable variable names. As for the camel casing of CF methods and the headless camel casing of custom items, I get around this by always ... read »
Nov 20, 2009 at 10:56 PM
Five Months Without Hungarian Notation And I'm Loving It
I use the following and love it: my.namespace.MyComponents.functionMethodsOrUDF() CONSTANT_VALUES_OR_PROPERTIES One thing I always try is to CamelCaseBuiltInColdFusionFunctions() so others can tell ... read »
Nov 20, 2009 at 5:38 PM
Learning ColdFusion 8: CFImage Part I - Reading And Writing Images
Hi Ben, Great article. I've been looking around to see if ColdFusion image engine can programatically create the following "wrap around" effect: http://www.creativepro.com/article/photoshop-s-she ... read »
Nov 20, 2009 at 5:35 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
@Dave: I talked to Gert he suggested: <cfhttp method="get" url="http://{some cf website}" result="stuff" addtoken="yes" /> Note the addition of cfhttp attribute addtoken. That should persist y ... read »
Nov 20, 2009 at 5:23 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
@Todd, Ahh, gotcha, yeah that makes sense. ... read »
Nov 20, 2009 at 5:17 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
Ben, sorry if I didn't make this clear. You can make it work like that if you want, just put <cfset session.foo = 1> (and <cfset application.foo = 1>) in your OnRequestStart() and it reve ... read »