Writing new XML-RPC code

Last night I started work on new XML-RPC code for NetNewsWire, to replace the system-supplied code it’s currently using. This will fix a bunch of weblog editor bugs.

As I started work on this I was instantly reminded of why I love XML-RPC: it’s so simple and geometric and clean. My code reflects this. It practically writes itself.

In comparison, parsing RSS is like walking across a field of broken glass.

(And the glass has been heated to just below its melting point. And your hair is on fire.)

I have a couple things going for me:

1. I’ve been on good-friend terms with XML-RPC since even before its spec went public. As a former UserLand employee, XML-RPC is as familiar to me as my own socks.

2. I have a bunch of experience already parsing XML using the CoreFoundation routines. I can re-use the knowledge gained by doing RSS and OPML parsers. (And even re-use some of the code.)

A reasonable person might ask: Why not use Eric Kidd’s code or use the Python bridge? It seems like a good idea to use existing code rather than do it from scratch.

There are a couple reasons:

1. I’d write just as much code to integrate existing code as I would in writing a parser from scratch. There’s no savings in code written—and it would mean an extra unneeded layer, which means there’s more that could go wrong.

2. Since I’ve already done a great deal of XML parsing already (RSS and OPML for instance) I already have a bunch of knowledge and code. Writing this code presents no challenges.

14 Feb 2003