Instant Code Review ColdFusion Builder Extension

Continuing on my quest to find cool and unusual ways of extending ColdFusion Builder, I stumbled onto this Rube Goldberg contraption of an extension. It came about due to severe jet lag in Sydney and a need to do something cool for cf.Objective ANZ.

So imagine you’re a freelancer who is no longer in an office, able to get instant feedback on a piece of code. I know the feeling. Wouldn’t it be cool if you could do that through the IDE? Well this extension will do that. Highlight a piece of code in your editor window, right click, and choose Instant Code review. A list of your currently online buddies will pop up, and you choose them and write out a comment. Your code and comment will be sent via IM. Your IM buddy can respond to it. That response will get written as a comment in your source code above the selected code. And just because I can, if you are on a Mac, the extension uses text-to-speech to creepily tell you “Your instant code review is done.”

So what’s going on here? Behind the scenes I have an IM event gateway running. You remember event gateways; we added them in ColdFusion 7. They allow you to have ColdFusion be an IM or SMS client among other things. I use that gateway to take code from the IDE and pass it along to your IM gateway. The gateway can also listen for IMs. When it receives the response from your friend, it uses a locally written queue file to match up the response with the file that generated the code review request.

Don’t take my word for it, here’s a video demo.

http://vimeo.com/moogaloop.swf?clip_id=7706690&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

ColdFusion Builder – Instant Code Review from Terry Ryan on Vimeo.

Now I don’t see this as a completely useful extension. It’s cool, but it might just be a bit flashy. But I wanted to highlight that despite the fact that we added a lot of features to ColdFusion 9, it still has all of the coolness of previous versions.    

Like what you see? Then check it out at RIAForge: Instant Code Review ColdFusion Builder Extension.

Thanks to Raymond Camden who endured testing this application with me, and spammed his buddy list because of it.

Google Language Tools Extension for ColdFusion Builder

I have become obsessed with ColdFusion Builder Extensions. I am convinced that no other single feature of the IDE is as valuable as this. (And I love the rest of the features too, so I’m saying a lot here.) The ability to leverage ColdFusion know-how and features into tooling is awesome. A lot of the extensions we’ve shown off have been about code generation. I think that’s important, as it is big part of the Builder story. We make you more productive, but you make yourself even more productive. Of late though, I’ve been focused on extensions that do more than just generate code, they use ColdFusion capabilities in non-obvious ways. I’ll be posting them over the next few weeks.

Here’s the first:

I created a language translator that allows you to translate content in the editor window to other languages. As a first pass, it only does English, French, German, and Italian, but as I experiment I will expand them. To use:

  • In the Editor window, highlight the content you want to translate
  • Right-click it to bring up the context menu
  • Choose Google Language Tools -> Translate

That should drop the translated content back into your editor, below the original content.

To build this I used a few different pieces. In the last Public Beta drop of ColdFusion we added the ability to grab highlighted content from the editor window in a ColdFusion Builder extension. I take that highlighted content and pass it to the server. On the server I pass it to a CFC that I wrote that consumes the Google Language API. It’s a JSON-powered webservice, so I used ColdFusion support for JSON to simply get at this data. From there, I can use a feature of ColdFusion Builder called “callbacks” to write the translated code back to the editor window. Specifically, I used the “inserttext” callback, which allows me to insert text at a specific line of code. I can use this to carefully place the translated text.

Possible use cases:

  • Translating HTML content to multiple languages
  • Translating code comments to your native language
  • Creating language packs for your applications

Sound cool? Check it out on Riaforge: Google Language Tools Extension.

ColdFusion Builder and Flash Builder Integration eSeminar

I’ll be doing an eSeminar, tomorrow, Thursday, November 5th at 2pm EST /11am PST.

The topic will be using ColdFusion Builder and Flash Builder together. Flash Builder obviously is the best tool for building RIAs with Flex. However Flash Builder added a lot of extra functionality. On top of that ColdFusion Builder adds even more.

This session will explore these integration points, and show you just how fast you can build your applications.

To register and get all of the info you need to participate go to our Online Events site.

CFHTTP equivalent in Java. Really, Java, Really?

I was talking to my boss Kevin, and we were talking about how concise ColdFusion makes certain rote tasks, and he mentioned trying to duplicate CFHTTP in Java. He talked about how it went on for line after line, after line. I figured he was talking about something in the order of magnitude of about 2 or 3 times as much code.

He forwarded me a post on making HTTP GET and POST requests in Java. As the post shows it takes 12 lines of code just to import all of the classes you need. When you’re all said and done it takes about 30 or so lines of code to actually make a GET request. So it takes about 42 lines of Java code to duplicate the functionally that can be called in 1 line of ColdFusion using CFHTTP. I never noticed it was that big a difference. All that versus:

 

 

Now, I’m sure there are easier ways of doing this. And after you build the class and method once, you can just reuse the object repeatedly. But in this day and age of SOA, SOAP, and REST, that seems like something that should be built into the language.

I’m not trying to make this a bash Java post. Really I’m not. Java can do lots of things ColdFusion cannot. In fact Java networking is this verbose because it has more options; it can do low level socket communication. I know, when I’ve needed it in ColdFusion, I’ve dropped down to Java to write it.

But as developers, I think there are lots of places where we don’t add value, but are still forced to work:

  • Getting reporting data out of a database? You add value by writing good complex SQL, but not by writing the database connection code.
  • In basic database applications, you add value by designing the database, but not by writing CRUD code.
  • In a REST and SOAP world, you add value by mashing up services people have thought of combining, not by making the HTTP call to get the data.

I know frameworks, libraries, code reuse, and other encapsulation techniques are ways around this.

ColdFusion as an abstraction layer on top of Java is another way. It’s the way I do it. And because I do it that way, I never have to write more code then I have to for an HTTP GET request, or email, or database connection, or .NET integration, or Exchange call, or Spreadsheet creation, or …

 

Flex 4 ColdFusion Developers Fest

I think a few people have picked this up already, but I figured I would add my voice to the fray to make sure everyone is completely inundated with this deal.

Adobe is running free Flex 4 training events for ColdFusion developers from November 13th to November 20th in various cities throughout the US:

Friday, November 13

Marriott at Legacy Town Center, 7120 Dallas Parkway, Plano, TX 75024

Saturday, November 14

Sheraton Imperial Hotel & Convention Center, 4700 Emperor Boulevard, Durham, NC 27703

Monday, November 16

The Curtis Hotel, 1405 Curtis Street, Denver, CO 80202

Tuesday, November 17

Radisson Hotel Newport Beach, 4545 MacArthur Boulevard, Newport Beach, CA 92660

Wednesday, November 18

The Georgian Terrace Hotel, 659 Peachtree Street NE, Atlanta, GA 30308

Thursday, November 19

Hyatt Regency Chicago on the River Walk, 151 East Wacker Drive, Chicago, IL 60601

Friday, November 20

Fig Leaf Software Training Center, 1400 16th Street NW, Washington, D.C. 20036

Friday, November 20

Adobe, 601 Townsend Street, San Francisco, CA 94103

Each event is free. Free… FRRRREEEEEEEEEE… Free. So go register already:

http://www.adobe.com/go/flextrainingforcfdevelopers,

By the way, see what I did there in the title? It’s Flex 4 and it’s Flex for ColdFusion Developers. Pretty witty, no? No.