Thursday, June 19, 2008

Lessons Learned from MarcoPolo v1 and v2

So I'm rewriting MarcoPolo from scratch, and so here's a few technical notes as to why I'm doing it.


  1. Don't fight The Cocoa Way. I came from a background of writing C/C++ programs that used toolkits like GTK+ and wxWidgets. They are both really good UI toolkits, but they are very different in design to Cocoa. I didn't fully embrace The Cocoa Way, and so I spent far too much time adding little hacks and tweaks to get MarcoPolo to work properly. This boils down to doing proper MVC design, and not being afraid to write wrapper classes to keep it that way.


  2. Spend time mulling over architectural decisions. Once you start building a huge edifice, it's a lot of effort to go back and make changes. Moreover, it conditions your brain to think along those design lines, so it's harder to notice fundamental mistakes.


  3. Unit tests are good. In line with lesson #1 above, the code design of the models and controllers were so entangled that it was impossible to unit test them to ensure that sweeping changes I made would not break things.

2 comments:

Josh said...

Looking forward to the new version. Very glad to hear you're continuing to work with the project. If you don't have one might I suggest a donate button?

Dave said...

Josh, you mean like the donation links at the bottom of the MarcoPolo website?