Matt Gemmell

My new book CHANGER is out now!

An action-thriller novel — book 1 in the KESTREL series.

★★★★★ — Amazon

Defaults, defaults, defaults

development 1 min read

The most nightmarish part of software development (aside from UI design and graphic design, in descending order of horror) is coding up the defaults system (that is, the saving, loading, updating and respecting of Preferences).

Mac OS X (Cocoa) makes it a lot easier than usual, with its NSUserDefaults class, but it’s still a pain. That’s what I’m working on at the moment (in BlogThing). I’m also using BlogThing to post this, which is sort of nifty. :)

My feeling is that, for small to medium-sized projects, a sensible approach to development is:


  1. Think through the functionality. Make copious notes. Think some more.

  2. Do your feasibility studies. Revise plan as appropriate.

  3. Work on the UI for defaults/Preferences. Get it right. Minimise the amount of time you'll need to spend later rearranging and rethinking the prefs UI.

  4. Do some cursory work on the main window/document UI and menus.

  5. Code up the defaults system, including saving/loading, updating, doing the right thing when OK-ing or canceling the Preferences window (or whatever), and sanity checking.

  6. Think carefully about validation. Implement as much as you can.

  7. Now start coding the app itself, in bite-sized chunks.

  8. Test, fix, test, fix, test, fix.. etc.

  9. Graphic design, credits, Help, etc.

  10. Localization.



It’s not a perfect order, but it works for shareware-type projects, and helps reduce frustration (at the price of tedious work at the beginning of the project). I also find that it’s energising to get your preferences laid out, since it really shows off the capabilities of your app. I’ve always been one of those developers who has to be physically restrained from making everything customisable. Bad. :)

Anyway, back to the salt mines.