Embracing ColdFusion Builder

Posted on August 10, 2010 by: Justin Scott 2 Comments

For the last decade or so I've used Homesite+ as my primary editor when working on ColdFusion applications, HTML, or pretty much anything web related.  Homesite is essentially a text editor with lots of features that are specialized for HTML and ColdFusion specifically.  It includes inline help and code assistance for the language.  I start typing a tag or function name and it finishes it for me and fills in a lot of the details.  Homesite was eventually turned into ColdFusion Studio many years ago but had stability problems.  Homesite+ included all of the features of studio but actually ran properly.  It's been running well for me for many, many years.  Unfortunately, Homesite is no longer supported.  It's an old application and ran great on Windows XP.  Last year I upgraded to Windows 7 and had to run Homesite in the "Windows XP Mode" within 7 for it to run at all.

ColdFusion Builder is Adobe's response to cries from CF developers for an updated development tool.  Many people had been using Dreamweaver which, like Homesite, was a glorified text editor.  It had a lot of features for GUI development and was really more oriented toward designers than developers.  There was also the open-source CFEclipse editor, but in the past I found it to be clunky at best.  I wanted something as agile as Homesite.  My workflow doesn't really fit into the "project" model that eclipse if built around.  Adobe decided to build its own IDE with Eclipse as well, much to my chagrin.  I tried the beta versions last year and had nothing but problems with what should have been simple tasks (like creating a new blank file on an FTP server).  Fast-forward a year and Builder has been out for a while and the first updater has been released to fix some nasty bugs in the first official release.  I can't use Homesite forever, so I decided to give Builder another shot.

I downloaded the trial installer yesterday and the install went fairly smooth, or so it seemed.  When I loaded it I was greeted with error 148:3 which said I needed to reboot.  I rebooted, reloaded, same error.  Adobe's website says that if you get this error you should uninstall, ensure the Windows Installer service is running, then reinstall.  Did that, still no luck and the same error.  I did some more digging and found a discussion which said that one of the licensing services that is installed with Builder may not get installed, producing the error, if something else is running at the same time as the installer which is "using a lot of memory."  How much more specific could they be?  I uninstalled again and unloaded most of my background programs, one of which is ColdFusion Server itself (using a measly 512MB of RAM or so; I have 4GB so I just leave it running all the time for local development).  Reinstalled Builder and this time it loaded up without any complaints.  It would seem that Adobe has some work to do on the installer if something so simple can botch the entire install without any warnings, but I digress.

Once the editor was loaded it seemed foreign.  Builder really shouldn't be called an editor though, it's an IDE.  The editor is just one small part of the overall package.  There are debugging windows, server management windows, log viewing windows, project navigators, file navigators, object explorers, and a lot more.  Each piece is really just a plug-in to the Eclipse back-end, so everything has its own actions, settings, etc.  It can be very confusing at first for someone who has never used Eclipse.  Eventually I was able to hide the windows I won't be using often (or at least don't need to see all the time) and rearrange the windows to at least look a little but like my familiar Homesite layout.  I found that switching out the color scheme to use the "CFEclipse" profile almost matched my existing Homesite colors.  With a few adjustments I created a custom profile which comes even closer, though I do not think it will be possible to match exactly.  The other thing I noticed is that the default text size in Eclipse is 10pt whereas Homesite was using 9pt.  I adjusted the font size down and the editor immediately seemed a lot more familiar.  One difference is that the Eclipse editor uses anti-aliasing when rendering the font where Homesite does not, so there is still a subtle difference in the way text is rendered.  Homesite also puts more space between the lines, so the text in Builder looks slightly more compacted and seems to run together more.  I'm sure I'll get used to the closer lines and font-rendering with time though.

My plan is to use Builder for the next week or so and see how it goes.  I'll report back with the good, the bad, and the stuff I can't figure out once I've had a chance to let it sink in for a while.  Wish me luck!


Facial Recognition in ColdFusion

Posted on July 30, 2010 by: Justin Scott 0 Comments

As anyone who works with ColdFusion knows, it's built on top of Java.  It also provides ways to easily leverage pretty much anything Java is capable of.  I saw a post from Todd Sharp about using the "faint" Java project to enable facial recognition in ColdFusion.  You would think that something like this would be fairly complex, but all of the hard work has been wrapped up in the faint engine.  With ColdFusion, a few lines of code loads the Java object, sets up a Java thumbnail object, then points the faint engine at an image an asks it to find the faces in the image.  Easy!  Java passes the results back to ColdFusion which then writes the images to disk.  This could be great for helping users to crop uploaded avatar images or create a facial thumbnail for dating sites.  Of course the amazing part about this isn't the facial recognition, but the ability for ColdFusion to simply pick up any Java class and use it without any fuss.


That's ColdFusion?

Posted on June 17, 2010 by: Justin Scott 0 Comments

I just realized that I have some catching up to do.  At work I spend my days looking after a fairly large number of ColdFusion applications running on ColdFusion 7 and 8.  Most of the underlying code in these applications was written back in ColdFusion 5 and subsequently adjusted to work in newer versions, but it's rare that we need to update the framework in a really fundamental way.  It does a great job and has lots of little whiskers all over it from where it's been ammended and beaten into doing whatever we need it to do.  However, it's all procedural code and scantly makes use of any of the newer features offered by the ColdFusion engine.  In my off-hours (if there is such a thing), I'm doing a lot of the same except for other clients who are also running older versions of ColdFusion or have applications originally written for older versions.  Then, I read a blog post from Terrence Ryan inviting ColdFusion skeptics to give the platform a try.  In the post, he outlines some of the concepts and features that we all know and love about ColdFusion.  He also links to some recent CF code on GitHub showing what "modern" ColdFusion can look like (in an attempt to show that not all ColdFusion code has to resemble your favorite pasta).

When I first clicked the link, I began to wonder if it was directed to the wrong place.  That doesn't look ANYTHING like what I'm used to seeing ColdFusion code look like.  I recall reading that components (ColdFusion's answer to classes in other languages) could now be written entirely in script form (as opposed to the usual tag form), but I had never actually seen one in practice.  Furthermore, ColdFusion 9 has made just about every tag available in script form, so we end up with code such as:

var httpObj = New http();
httpObj.setUrl(variables.apiUrl & "translate");
httpObj.addParam(name='v',type='url',value=variables.v);
httpObj.addParam(name='q',type='url',value=arguments.q);
httpObj.addParam(name='langpair',type='url',value=arguments.from & "|" & arguments.to);
var result = httpObj.send();

This was pulled from Ryan's sample on GitHub.  Usually this would be done with the CFHTTP and CFHTTPPARAM tags, but this is the first I've seen someone using the script form.  It all looks alien to me, which means that I need to take my own advice and re-read the tag and function references (my number one piece of advice to new CF programmers at Annex ten years ago).  Hopefully I will be able to find some time to refresh myself and convince my employer or a client or two that an upgrade to ColdFusion 9 is necessary so I can get some hands-on experience.  I do have CF9 installed on my laptop for development purposes, but the code all gets deployed to older servers, so I can't use the new features and put them into production just yet.  It's one thing to toy around on the local system, and another thing entirely to actually put code into production.


Older Entries