Monday, October 27, 2008

Applications Are Only as Beautiful as the Processes They Replicate

In an ideal application development process, you work with the client to get an accurate picture of all of the business logic involved in the process the application is supposed to handle, and the end result is a robust system built with clean, understandable code.

But it doesn't always work out that way (some would say it never works out that way). Most of us have had to deal with "scope creep." In fact, one could argue that most modern CFML-coding frameworks and patterns came out of the need to deal with "scope creep" and other reasons for changing our applications.

But sometimes the challenge in creating a clean application comes from the nature of the business "logic" itself, the real-world process that your application is supposed to mimic and replace. It occurred to me the other day that that is often the biggest hurdle I have to overcome with the applications that I'm asked to construct.

When I work with my clients to figure out what exactly what tasks the software needs to perform, I often discover that the processes at work are often riddled with exceptions and conditionals. Sometimes my clients are consciously aware of these exceptions, but other times I have to point them out and we have to figure out how they need to be dealt with.

We humans can handle exceptions within our thought processes very easily. Computer logic, on the other hand, doesn't handle exceptions so casually (which is probably why errors can be referred to as "exceptions"). Coding for even a single exception to an otherwise iron-clad rule can make the code involved twice as complex and perhaps a bit less than pristine.

While we do all we can as responsible programmers to deliver a beautifully-coded application, I think that sometimes there's no avoiding the touch of ugliness that comes from trying to represent and replicate an "ugly" human-driven process.

Wednesday, September 3, 2008

CF411 and ColdFusion for Educational Use (Oh, And That New Browser...)

Blogging bullet-point style tonight:

  • Charlie Arehart's new CF411 site has a MASSIVE amount of links to tools and resources for CFML and web development. Stop what you're doing right now, go to the page, and store it somewhere (your bookmarks, Delicious, wherever).

  • The announcement that ColdFusion 8 Enterprise is now available for free for educational use (in other words, for learning purposes) was made on Monday. You can find out more at https://freeriatools.adobe.com/coldfusion/

    While I'm glad the announcement is out, I just wish it had been promoted better. There's still nothing about it up on the Adobe home page or even on Adobe's ColdFusion product page. Why not?

  • Last (and least...), Google surprised everyone this week with their new Chrome web browser. It got so much attention that everyone stopped talking about the iPhone, which is admittedly pretty impressive.

    Like everyone else, I've played with it. Here's my take on it (yep, more bullet-points):

    • It runs pretty well.
    • It does seem to run JavaScript more quickly than other browsers.
    • It has a few nice innovative features.
    • It can be quirky at times and it has some flaws (but it is a beta).
    • It has promise, but it doesn't provide any new functionality that I find particularly useful to me.
    • FireFox will remain my browser at work and at home.

     

Friday, August 29, 2008

Leveraging the Ubiquity FireFox Plugin To Access CFQuickDocs Pages

If you're a FireFox user and you haven't tried out the new Ubiquity plugin created by the folks at Mozilla Labs, you should.

What is Ubiquity? The short answer is it's a command-line interface for retrieving and re-purposing web content. For example, the "wikipedia" command built into the plugin takes the word you type in, retrieves data from the top 5 matches for that word (as you type it, no less) in Wikipedia using an API, and displays that data with clickable links to the Wikipedia pages in the command window:



You can see even more interesting uses for Ubiquity by watching the video clip in the Ubiquity blog post.

One of the things about Ubiquity that hasn't been talked about very much is that you can create your own Ubiquity commands using JavaScript and then share those commands with other Ubiquity users (note to jQuery users: Ubiquity commands can use jQuery functions as well as regular JavaScript functions). To that end, I created a very simple command that lets me call up a particular CFQuickDocs page by typing "cfquickdocs" and the name of the CFML tag or function I want to look up:



As Ubiquity commands go, it's not that impressive, but it does let me pull up a particular entry faster than I used to (which involved going into my bookmarks, clicking on the bookmark, waiting for the page to load, and then entering the tag or function I want to read about). And all it took was one function call with four parameters:

makeSearchCommand({
  name: "cfquickdocs",
  url: "http://www.cfquickdocs.com/?getDoc={QUERY}#{QUERY}",
  icon: "http://www.cfquickdocs.com/favicon.ico",
  description: "Searches the CFQuickDocs for the CFML tag or function you enter."
});

Sharing a Ubiquity command is simply a matter of putting the command in a JavaScript file and then creating an HTML page that calls that file. So if I wanted to host/publish the above Ubiquity command, I could just add it via a <link> tag to an HTML file and host it somewhere, and a Ubiquity user could simply visit that page to install it.

If you don't have Ubiquity installed but want to learn more about developing Ubiquity commands, there is an online tutorial that explains the basics. Once you have the plugin installed, you'll have access to a command editor that lets you try out your commands as you code them, and you can read the code for all of the functions that come built into the plugin.

Saturday, August 23, 2008

If You Build the App, Someone Just Might Use It: You Never Know

I was rather surprised to see my colorPicker AIR application included in a list of 10 AIR apps for web designers on the Six Revisions blog this past week. Then Gary Gilbert gave it more exposure by blogging about the Six Revisions post.

After seeing the Six Revisions post, I decided to check colorPicker's download numbers on RIAForge and got another surprise: the download count was just shy of 800.

As of today, four days after the blog exposure, the download count stands at 1119.

I built the colorPicker mainly for myself (and I still use it). I put it up on RIAForge because I thought a FEW people might prefer something a bit simpler than Kuler (Adobe's color palette tool). But given the number of slick color designer AIR apps that are out now, I would never have expected that many people to have given colorPicker even a glance.

It just goes to show that you never know what apps or code other people might find worthwhile.

Wednesday, July 30, 2008

My first jQuery plugin: textCounting

I've blogged about things I've done with jQuery before, but this is the first jQuery plugin I've developed.

My textCounting plugin lets you show users how much text they've entered into a <textarea> box and/or how much text they can still enter before reaching a set limit. The plugin can be configured to count either the number of words or number of characters entered or still available.

The plugin is designed in a way that a single call of the plugin can affect all of the <textarea>s on the same page if you follow certain element ID naming conventions. There are a number of different configuration options, and it can be used with another jQuery plugin, the Metadata plugin, to retrieve settings and data from a metadata block within the class attribute of the <textarea>s.

To see a demonstration of the plugin in action and to download the plugin, visit:

http://bcswartz.github.io/textCounting-jQuery-plugin/

I want to point out that one thing that the plugin does NOT do is enforce the word/character limit set for each <textarea>: you can apply a CSS class to the HTML element containing the count as a visual notice to the user that they've exceeded the limit, but it doesn't actually prevent them from continuing to type. I was originally going to provide that option, but I realized that a lot of users tend to paste content from another source in <textarea>s, especially when the content is expected to be verbose, and making the user count the words or characters in their text prior to copying it into the <textarea> defeats the purpose of providing the counter in the first place.

If any of you are interesting in writing your own jQuery plugins, I highly recommend you read Mike Alsup's blog post "A Plugin Development Pattern" on the Learning jQuery site. It was an invaluable resource and taught me a lot.

Thursday, July 10, 2008

Google's new virtual room service (Lively) may have potential

Yesterday Google launched a new beta project called Lively. Lively lets you create virtual rooms that people can join and then interact with each other via avatars. The concept is similar to virtual reality systems like The Sims or Second Life, but the difference is that you can put the rooms that you build on your own web page(s).

When I first heard about it, I thought the idea was a bit over-the-top, but I decided to at least try it out last night.

For a first version beta, it's pretty slick. You start off with a basic set of room layouts and room items (furniture, decorations, accessories) to build your room with, but you can choose to add different items from an on-line catalog (currently, all of the items are "free," which seems to imply a virtual currency may be established later when they let folks create their own stuff). Once you add an item to the room, you can move the item by dragging it and then rotate it as needed. You can also add mood music, either from the catalog of music or by uploading your own music file.

Once you've decided an avatar to represent you, you can enter the room and interact with the items (if there's a couch, you can choose to sit down on it). If there are other people/avatars in the room, you can chat with them just like you would in a normal chatroom and your words will appear in a conversation block over your head for everyone to see (or you can whisper privately to a single fellow occupant). Right-clicking on your avatar brings up a menu of gestures and animations you can have your avatar perform, like clapping, laughing, or dancing like John Travolta in "Pulp Fiction" (yes, it's as bizarre-looking as you might think).

I threw together a very simple room and then embedded the code to access the room on a very simple web page on my site. You can check it out if you like, but since you'll need the Windows-only plugin to enter the room, which is the same plugin that lets you create your own room and avatar, you're probably better off trying Lively out by creating your own room.

The need for the plugin to even enter a room is probably one of the biggest drawbacks of the service. The visual evidence strongly suggests that Lively runs off of Flash and was built using Flex (I once saw the standard Flex "Initializing..." dialog box while loading my room) so it's unclear as to why a separate plugin is needed. Maybe Adobe can work with Google to redo the plugin in AIR so it's at least cross-platform.

The other challenge facing adoption of Lively is, well, its usefulness. Right now, it's essentially an enhanced chat room. Some folks have said that businesses could use it to hold virtual meetings, but I don't see that happening unless Lively is upgraded to allow one or more room participants to speak via a microphone and provides a means of working with a presentation (Lively does allow you to display Flash videos within your room but I didn't explore that feature).

And while the idea of having a virtual room up on your home page or blog is kinda neat, it's not going to do you much good unless there's a compelling reason for people to come and hang out in groups in YOUR room. Centralized virtual realities like Second Life are never empty because there's just one world for people to go to: certain areas might be emptier than others, but there's always someone around to interact with. Still, I do see some potential uses for it with established communities. Popular online forums could replace their existing chat rooms with Lively rooms. Businesses could create a guest room or visitor room where website visitors could hang out before interacting with customer service avatars. Conferences like cf.Objective() or CFUnited could have virtual discussions rooms that allow conference-goers to discuss the day's events with non-conference goers ("Folks, the in-person BOFs will be from 8pm to 9pm, followed by the online BOF free-for-all in the Lively room from 9pm to...whenever.")

Heck, the folks on the RIA cruise in February could take the Lively "tropical island" room template and make a place to meet up with non-cruise landlubbers at some point during the cruise if they wanted to.

Who knows if people would make use of these rooms, but the beauty is that it doesn't take long at all to create a basic Lively room, so if it doesn't work out the time lost in trying isn't painful.

It'll be interesting to see if this goes anywhere. My guess is that it'll depend on how much time and effort Google decides to invest in it and whether it will scale effectively (I heard that there were load issues when it first went public yesterday, but I didn't have any real problems with it last evening).

Saturday, June 28, 2008

A list of jQuery plugins I use

As part of his blog post today, Ray Camden and a number of the folks who posted comments pointed out that while it was great that there are a lot of plugins available for jQuery, the downside is that it's hard to know which plugins are any good. I'm not a heavy plugin user, but I'd thought I'd list the few plugins and jQuery UI libraries that I've found to be very useful:

  • jQuery Form Plugin: this plugin appears in every project I've done since I started using jQuery. It makes it dead simple to submit forms via AJAX.

    (Oooh, it looks like the author's added some new features since the last time I download it...I'll have to check that out).

  • Tablesorter: this plugin was actually incorporated into version 1.0 of the jQuery UI library, but I don't see it listed in the current version of the UI library. This plugin lets you sort a table in ascending or descending order based on a selected column.

  • Sortables UI library: this part of the jQuery UI library lets you rearrange items on the page using drag-and-drop (something I've mentioned a number of times here on my blog).

  • TableDnD (Table Drag-and-Drop): the Sortables UI library I just mentioned does not work on table rows (tables are just "different," apparently), but this plugin lets you grab a row and move it up or down within the table.

  • curvyCorners: after trying a few different plugins aimed at letting you create curved corners for certain HTML elements (like <div>s), this plugin, although not perfect, seemed to work best.

    I must say that I couldn't get it to work right in IE, but that might have been because of the way I was using it. And it looks like the author has released a few updates since I last downloaded it, so that may not be an issue anymore.


Anyone else have any jQuery plugins they'd recommended using? Or recommend avoiding? :)