Blue Sky On Mars

Thoughts on Building Software Products

Joel explains Hungarian notation

by Kevin Dangoor

Joel Spolsky, as always, is entertaining and takes a bit of exposition to get to the point in his latest article: Making Wrong Code Look Wrong. In the article, he makes a differentiation between “Apps Hungarian” notation and “Systems Hungarian” notation, and now it makes sense to me. Whenever I saw people talking about Hungarian Notation, I always saw the Systems version which seemed completely nonsensical: why would someone have a variable name that just duplicates information that you’ve already got? Conveying more useful information, as in the unsafe string example Joel gives, is a good thing.

I don’t buy the exceptions argument that Joel makes. When you’re writing the code, if you’re calling some outside function you need to know whether that function throws exceptions or if it returns an error code. Either way, when you’re calling something that can fail, you need to decide how you’re going to handle that failure. If you use error codes, you’re forced to do bookkeeping all the way up the chain until the error hits a point where it can be properly dealt with (sometimes requiring action from the user). With exceptions, you can just say “this method is not in a position to do something about this problem, pass it along”.

CompSci is all about tradeoffs: Joel’s preference is for more explicit code that requires more bookkeeping. My preference is for something that requires a bit less bookkeeping, and saves a bit of time by leaning on the tools a bit more. People writing macros in LISP are all the way at the extreme of hiding much of the bookkeepnig behind the tools provided by the language.

There’s no proveably correct answer to this, so pick your poision as they say.

Regardless of how you feel about exceptions, though, Joel’s article is worth the read because of his Hungarian Notation explanation. If you’ve been turned off by Hungarian Notation in the past, it’s worth taking a look at Joel’s view on it.

Luxury Chair.com: use caution

by Kevin Dangoor

If you do work that requires a lot of sitting, you don’t want to skimp on your chair. The cost of a good chair is small compared to the cost that bad ergonomics can extract from your body.

Of course, not everyone will agree on what the perfect chair is. I’ve spent about 3 years working at companies where my chair was an Aeron. It’s a shame that the Aeron was one of the symbols of dot com excess. The fact of the matter is that it’s a darn good chair. I’ve been using computers for a long time and the Aeron is the most comfortable chair that I’ve sat on. Though it’s always good to take frequent breaks and move around, the Aeron always felt great to sit in, even for long stretches.

Given that I’m still in the startup phase of my business, buying an Aeron seems extravagant. But, my current chair is old and makes my rear end hurt. So, I bought an Aeron, but I did shop around.

I took a chance and purchased from Luxury Chair.com. They sell new condition, open-box chairs. At the time I ordered, their website was fairly sparse. The page described the “highly adjustable” model of Aeron, with the leather arm upgrade, for $599. That may sound like a lot, but when you shop around, that’s a good deal! Sit4Less charges $968 for the same thing! (Note: Luxury Chair charges $75 for shipping, sit4less offers free shipping. Even accounting for the shipping difference, Luxury Chair is still much cheaper.)

When the chair arrived, it was indeed in excellent condition. However, the chair I received was an Aeron basic, not the highly adjustable model. That would not have been a good deal. Sit4Less charges just $649 for the Aeron basic with free shipping.

Mistakes happen and the important thing is what is done to take care of the mistakes. Without fuss, Luxury Chair paid the return shipping (thankfully including pickup, so I didn’t have to haul this 55 pound chair to UPS) and then sent me the correct chair which arrived today. This second chair is the correct model and is also in excellent condition. My only complaint would be that it took two weeks between the time they received my returned chair and I received the new one. Otherwise, though, Luxury Chair took good care to ensure that I was happy with the product. I should also note that they’ve improved their website to highlight that they have both basic and highly adjustable models of Aerons, so this type of mistake is not as likely in the future.

One thing to be aware of is that Luxury Chair is not an authorized Herman Miller dealer. This means that the 12 year warranty is provided by Luxury Chair, not Herman Miller. (The tag on the bottom of the chair that reflects the chair’s date of birth has been removed.) I haven’t noticed troubles with the Aerons I’ve used, so I was perfectly comfortable with this arrangement.

All in all, Luxury Chair came through with the product as advertised at a price that was significantly less than anyone else, including other open box deals that I saw. If you’re considering an Aeron, I wouldn’t hesitate to recommend Luxury Chair.

Update (5/8/2007): This post has been a magnet for comments about LuxuryChair.com. The comments are almost universally negative. The original title was “A Good Deal”, but I’ve changed it to “Use Caution”. They worked out fine for me, but apparently they haven’t for others. YMMV.

The tale of making Zesty News cross-platform

by Kevin Dangoor

As I mentioned earlier, Zesty News has a browser-based interface. But, Zesty News is not a web-based program: it’s a desktop application. You install it on your computer and access the program through your web browser.

So, I get to deal with the intracacies of cross-browser compatibility and the deployment aspects of a desktop application. Joy!

But, it goes beyond that. While I can imagine telling a geek friend, “yeah, you just point your browser at http://localhost:xxxx and there you go!”, I can’t imagine telling a normal person that. I certainly can’t imagine selling a product like that. That would just be irresponsible product management. My goal was to have just enough native GUI to give people easy access to Zesty News, and do everything else in the browser. I also decided early in the process that I am only targeting modern and mainstream systems, at least to start with. Here’s my supported platforms matrix:

  Windows XP1 Mac OS X2
Firefox Yes Yes
Safari Waiting for Apple on this one Yes3
Internet Explorer Yes4 Blech

1 In all likelihood, Zesty News will run on any 32-bit Windows. That’s not part of my initial test plan, though, so I don’t want to guarantee that.

2 OS 10.3 and 10.4

3 My testing will be with the latest version of Safari that comes via Software Update. This means 1.3 on Panther and 2.0 on Tiger.

4 My testing is with IE6. It is quite possible that IE5.5 will work as well.

Limiting things like this certainly reduces the cross-browser issues. There are some tricky bits, but Firefox, Safari and IE6 are close enough that I don’t spend all of my time just dealing with browser inconsistencies.

The question then becomes: what is “just enough native GUI”? It turns out that there’s not a lot of native GUI necessary, but that work does extend to providing something for every browser in addition to each platform.

Remember how I said that I couldn’t imagine telling all of the non-techies to go to http://localhost:xxxx? I have a couple of solutions for this. On both Windows and Mac, firing up Zesty News automatically opens the browser to Zesty News. But, that’s not a complete solution: people leave news aggregators running all the time. On Windows, as you’d expect, you get a taskbar icon taskbar image that you can just double-click to get Zesty News to popup in your default browser. Whew! Something that “just works” with multiple browsers. The right-click menu also includes the ability to quit Zesty News (but why would you want to do that?):

menu image

As of this writing, the Mac interface isn’t quite as slick. That will change somewhere along the way. On the Mac, you can use cmd-Tab to hop over to Zesty News:

cmd-tab view

Once there, you can use the menu to launch your default browser to the right place:

Zesty Mac menu

Of course, you can also add a bookmark to Zesty News in your browser, given that the Zesty News software is just sitting at a URL you can point to.

Just opening Zesty News isn’t all that’s needed, though. The other key feature that’s needed when not looking at the Zesty News interface itself is the ability to subscribe to new feeds. Firefox 1.0 added a nifty feature to handle this, and the open source Feed Your Reader tool by Michael Koziarski made it easy to subscribe to feeds in Zesty News from Firefox.

zesty firefox

That’s dandy for the 10-20% of web surfers who are using Firefox. But, what about the 80% who run IE? Zesty News includes an IE toolbar that scans for feeds and makes it as easy to subscribe as it is in Firefox:

zesty ie

With Mac OS 10.3.9, things aren’t so pleasant. Registering Zesty News as a reader for the “feed://” protocol is easy enough (just add it to the info.plist file). But, with 10.3.9 (and Safari 1.3), Apple took over so that Safari would display a message saying that you need to upgrade to Tiger/Safari 2.0 to do RSS. Ugh.

Zesty News has a “Browser Setup” screen that includes an option to make Zesty News your default feed reader. Unfortunately, there’s no documented way to do this under Mac OS 10.3! Under Windows, you just set a couple of registry entries and you’re done. Carl Lindberg, author of the excellent RCDefaultApp, gave me some tips on the undocumented, private APIs to do this. I haven’t had a chance to do it yet, though.

So, the net of all of this is that Safari 1.x doesn’t have a fancy way to detect and subscribe to feeds right now. However, Zesty News has a Feed Finder bookmarklet that should work in most modern browsers, and that makes it pretty easy to subscribe to feeds.

Of course, Mac OS X Tiger makes this all better. Safari 2.0 detects feeds along the way and provides an easy subscription mechanism that will work with Zesty News. (I haven’t installed Tiger yet, so I haven’t tested this. From what I’ve read, this should work fine, though.) Safari 2.0 also lets you change your default feed reader in much the same way that Safari 1.x lets you set your default web browser.

That seems a little backward to me, though. You really should be able to tell an application “I want you to be my default”, rather than having to run some other application which happens to do the same thing. Carl Lindberg reports that Tiger provides public APIs for setting defaults for file types, but not for URLs. And, of course, the private APIs have changed between Tiger and Panther.

Before Zesty News 1.0 final is released, I’m going to straighten out the Mac support to fix all of this. It’s ironic, because I use the Mac for all of my work except for Windows-specific development and testing.

Overall, making Zesty News cross-platform and cross-browser has not been too painful. There have been some days where I’ve been pulling my hair out over one little thing that works on one platform but not the other, or weird APIs or strange compilation problems. But, I feel much better about having a cross-platform Zesty News so that I can support the increasing number of folks running Mac OS X and the masses running Windows.