September 24, 2007

Venkman planning for Gecko 1.9, part 3

Thanks to Gijs and Mnyromyr (and not to me; I didn't write a single line of code), Venkman's met three of the six bullet points I listed in my initial Venkman planning post. It is now at least minimally useful for Gecko 1.9 code.

I would strongly encourage Firefox developers (and for that matter, most of us who hack on trunk) to launch the JavaScript Debugger at startup (command-line argument is -venkman), and turn on "Stop for Exceptions". You'll find a few pain points pretty quickly. My personal favorite looks something like this:

try {
  var foo = myObj.property.QueryInterface(Components.interfaces.nsIFoo);
} catch (e) {};

This code is wrong, in my opinion, on three levels:

  1. The empty catch block, which always annoys me. A comment saying "do nothing" would be better than that.
  2. No checking of what e is. In this example, only one line is inside the try block, but you can't tell if the QI failed, or if myObj is undefined. It could be the QI failure is expected, but if myObj being missing is a Bad Thing, that exception needs to propagate.
  3. A simple instanceof check removes the need to try and catch. If you can avoid generating an exception, then by all means do so. Exceptions like this are just useless (and probably expensive from a JSENG/XPConnect point of view). Exceptions should be thrown for exceptional circumstances.
var foo = (myObj.property instanceof Components.interfaces.nsIFoo) ? myObj.property : null;

I'm not intending to point fingers, but autocomplete in the URL bar is an extremely visible case of this being a problem for Venkman...

Time is running out for any of these changes we want to get into Firefox 3. If we're fast enough, though, we can clean up a lot of these useless "noise" errors which discourage people from using Venkman - and thus make exceptions it catches more relevant to whatever problem the user is debugging.

Thanks!

Posted by WeirdAl at 8:21 AM | Comments (3)

September 14, 2007

Mozilla24 and the last mile

From the Mozilla 24 upcoming.org page:

Stanford is a 20 minute walk from the Palo Alto train station. Visit 511.org for details on public transit.

Hmm. I looked on 511.org, and it suggests walking that distance. Too bad I don't know my way around the University...

The northbound Caltrain arrives at Palo Alto Caltrain Station at 9:31 am, leaving San Jose Diridon at 9:00 sharp. The day pass from San Jose to Palo Alto and back is eight dollars.

So here's what I want to do. Anyone going to Mozilla 24 @ Stanford by Caltrain from the South Bay, let's meet in the northernmost car (the bike car, usually). I'll be wearing a blue Firefox shirt and carrying my usual light blue laptop bag, boarding at Diridon. If you're heading to the event by Caltrain, please reply here and join me. All we need is one person familiar with the University, and we can head off together. Otherwise, we can wait for the southbound train 30 minutes later and join up with our Franciscan colleagues, or we can ask a local for directions. :-)

Posted by WeirdAl at 8:04 PM | Comments (2)

September 6, 2007

Verbosio goes on hiatus

With OpenKomodo coming, I think I should really put Verbosio on hold for the moment. Komodo's capabilities bring so much to the table that I'd be a fool not to look at moving much of Verbosio's infrastructure over to Komodo instead of XULRunner. This means learning another platform (not as much fun as you might think), seeing what API's I can benefit from, and what I can contribute back. Making sure OpenKomodo works on trunk XULRunner will probably be one of my main goals (since Verbosio uses several trunk features).

I am really quite pleased to hear this. It's the kind of thing I'd want to throw a party for. I've been a big fan of ActiveState's Komodo work ever since I was introduced to it at OSCON 2002. I kept thinking, "I want that!" Now, ActiveState is saying, "Here you go." You just can't beat that.

Verbosio's on de facto hold anyway, as I've (once again) bitten off more than I can chew. If I could find a couple days uninterrupted, I'd be able to finish off the next piece of UI for it...

Nine days to Mozilla 24! Too bad we only get nine hours at the Stanford hall... anyone interested in hosting and/or joining me during the other fifteen for a hackathon?

Posted by WeirdAl at 6:24 PM | Comments (1)

September 2, 2007

Venkman planning for Gecko 1.9, part 2

Gijs Kruitbosch posted a nice summary of Venkman work coming up. I'm posting a link here so that it shows up on planet (apparently, the post didn't show up here). We'd love to have help.

Posted by WeirdAl at 12:08 PM