Negative 5750

I love to delete code. It’s the best thing about programming.

But, of course, I’m working on a new version of NetNewsWire that has a big new feature plus some smaller new features. So I’ve written a bunch of new code.

Well, I got curious as to how I was doing on number of lines of code—and found that, at least so far, NetNewsWire 2.1 has 5750 fewer lines of code than NetNewsWire 2.0.1. (This includes the various frameworks I wrote that NetNewsWire uses.)

How could this be?

The first thing is, the Notepad has finally been removed. (There’s a good chance you have no idea what I’m talking about. It was a 1.x feature that nobody used. It was hidden for 2.0: it could only be turned on via a Terminal command. And now it has finally been removed.)

The second thing is that NetNewsWire 2.1 requires 10.3.9 or greater—which means two sub-things:

a. I could delete Jaguar-specific code.

b. I could switch to using Cocoa bindings in a bunch of places (most notably in the preferences window) which allowed me to delete a ton of code.

And the third thing is just that, like any programmer, I get better over time and find ways to make my code smaller and better. This part is actually my favorite—when I realize I can do in five lines what I used eight lines to do—and not only that, it’s more readable and easier to maintain.

I have a thing about this deleting-code thing. (You might recall how, for the 2.0 release, we split the weblog editor out into a separate app. This continues that tradition.)

Of course, the actual app folder will probably be bigger than 2.0.1—since this version includes both PowerPC and Intel compiled code and has some new resources (new windows, graphics, etc.).

But—fewer lines of code.

03 Mar 2006