March 5th, 2007

Dashcode is going to receive an awful lot of undeserved flak in the coming months.

The major impression that many people will take away from Dashcode will be that “there are widget templates – how quaint!” This is in no small amount comparable to walking around in a nuclear powerplant, spotting a soda vending machine and walking away in contempt while muttering “I thought this was supposed to be a class establishment“.

I’ve done some exploratory custom widget development in Dashcode in my copious free time, and the verdict is in: Dashcode is an extremely competent application.

Dashcode wins over the existing widget IDEs on technical knockout all over the place, but especially in two places:

  • The existing widget IDEs are more or less glorified project folders. As anyone who has ever done Dashboard widget development will know, you work in a bunch of apps at once, and if you’re lucky, your widget IDE is where you can code JavaScript, CSS and HTML in one place.

    Dashcode is nothing short of a revolution here. To an extent that even Xcode can’t match, you really do everything in the same app; there’s even a little optional workflow list with different tasks and handy shortcuts depending on template. You design your widget, you style the individual elements, you add controls or other “parts” (as Apple terms them), you edit your HTML, you have the initial widget front generated, you specify the Info.plist attributes, you try out the widget, you debug the widget and you deploy the widget. You, snigger, make the whole widget. In other apps, ‘workflow’ is a catchphrase for the marketing materials; in Dashcode, it’s intrinsic.

    In very few places is the whole experience any short of awesome, but the Widget Icon stage is one, where you can’t drag in other “parts” as you’re used to. Technically it makes some sort of sense, since the widget is an HTML page and the icon is, well, an image, but it creates a very inconsistent experience, and the best you can do is ‘place’ external images on top of the icon, or ‘edit in external editor’. I am expecting a better implementation of this particular stage.

    On the whole, though, Dashcode really does free you from your shackles. If you want a glossy roundrect-shaped widget, you just change the settings in an inspector, and Dashcode takes care of the handiwork of generating the images before you can even glance at Photoshop’s dock icon with contempt. If you want a scroll area, you just drag in a scroll area, and Dashcode figures out the rest. If you want a scalable widget, well, every element has got struts and springs for keeping the widget sane when it resizes. If any of this was poorly implemented, you couldn’t hand code or bring in your own handiwork, but so far, Dashcode has handled everything I’ve thrown at it with aplomb.

  • Dashcode is quite possibly the best non-Firebug Javascript environment I’ve ever used. You can pause the widget at any stage of running, look at the full memory stack, run commands through the evaluator and set up breakpoints. There is of course syntax highlighting as well. The CodeSense index is good to be for Javascript (the ‘methods’ navigation list notes different entries for different members of an object, for example), but is obviously unfinished or stripped back to work on 10.4. If you’re writing var i = 5, the code completion list will trigger once you write the i, and if will be selected, and once you write the space, it will be inserted, and you’ll end up with var if. This is such a violent bug that I’m positive it was either introduced within hours of releasing the sneak peek or just a natural effect of using the last thing that built for 10.4. At any rate, it goes away once you untick the appropriate checkboxes in Preferences, and only ever annoys you for five minutes.

Even after seeing the leaked Dashcode video, I kept dismissing Dashcode as a ‘toy app’ – a widget counterpart of iWeb that can do the five templates and that’s it. But a toy app it is not. It is a powerful development tool that also has built-in user-friendly templates and an off switch for kids. It is one of the best things to come out of Cupertino in recent memory. And it is going to be one hell of a raise negotiator for a lucky group of engineers inside the Developer Tools group.