Thursday, February 26, 2009

Feisty Ford Focus

People who drive small cars sure have colorful personalities. Yesterday, on the way to work, I saw a Ford Focus with a license plate frame that said, "Don't laugh. It's paid for." It was refreshing to see someone being flashy about their financial responsibility — a quality which is rarely flaunted.

Wednesday, February 25, 2009

Lessons from refactoring

I enjoy the process of refactoring software — especially software that was written by other people. It forces me to understand things inside and out (which is a tough point to arrive at when all you do on that code is the occasional drive-by bug fix). On top of that, since the desired functionality is known already, it's all redesigning of the data model and writing code. There are fewer product-level questions that come up. The specification is pretty much set.

For this particular project, though, I have the unique challenge of making the new design pass muster with multiple parties. People are picky and they always have something to say, so I took special care this time to anticipate any objections and address them so they'd get a better sense of my thought process. I've still had to make changes — and I make them gladly — but I've found that having to explain each decision I'm making generally serves to clarify my thought process.

It certainly helps to have some time to think hard about these changes, too. It's a healthy thing to let a data model sit for a bit and soak into the minds of all stakeholders while their input is incorporated. It also helps when people are interested enough to give detailed and insightful feedback. Sure, it generally doesn't hurt to have more sets of eyes looking at a plan, but having a team of people analyzing it harnesses collective historical memory — great for backward compatibility — and makes the plan more bulletproof by ensuring that it addresses concerns from many points of view.

Saturday, February 14, 2009

Blogger client as a Java Swing desktop application

Ever since I started using Blogger, I've been looking for a decent, no-nonsense desktop client to write my posts. I personally find it to be a lot of hassle to load up a big, heavy web browser and log in to Blogger to make my posts. (To be fair, Drivel was quite excellent in the past, but doesn't look like it's maintained anymore.)

After a little poking around at Google's API documentation, I am pleased to announce that I'm writing this post from a desktop application of my own making. It's a Java desktop application using Swing, so it will run on Windows, Mac OS X, Linux, and any other major desktop platform with a Java runtime.

So far, I can select from a list of blogs, write in post titles (to be friendly to those search engines), write post content, and submit new posts. It's really basic, but it's quite a milestone and a major motivator for me to at least have gotten this far.

Soon to come on the feature front, I'm aiming for loading old posts to update, deleting posts, and smoothing out the user experience. (Right now, the app looks and feels like the weekend side project that it is. It doesn't even scroll when the text is too long.)

On the code quality front before I release this thing out into the wild, I'd like to do some release engineering, automate the build process, and just separate the various concerns (like GUI drawing code, network connections, and application logic.)

In any case, it feels good to have my software development methodology validated: get a dirty prototype up and running, and count on the morale boost to spur further development. So far, it feels pretty good. The hardest part is done and the challenge from now on is just finding spare moments to work on refining this thing.

Update 02/20/2009: I've implemented updating existing posts, and I'm updating from the improved client right now. Of course, to get to that point, it had to load up old posts. A cleanup of the code base before proceeding is probably in order, because I'm kind of going nuts trying to figure out where everything is and where new things should go.

Update 02/22/2009: I've created the build system to use Ant and package the app into a neat little .jar file. I also fixed a minor usability bug to make the app more pleasant to post with and give you feedback when a post has been submitted. The refactoring into a better architecture will have to wait; my mind's capacity for refactoring is mostly taken up by a big refactoring proposal I'm putting together at work.

Update 12/16/2009: It's open to the public! Please see the Lumberjack release announcement. The code has been cleaned up, made more maintainable, and a few features have even been added to make the application more pleasant to use.