February 2007

There are sometimes these little problems that just stick, that just take a long time to figure out. Months go by. Years go by.

Anyway, for a long time I’ve been bugged because I couldn’t figure out how to set an alternate location for the WebKit cache. (Really the URL-loading cache, but I call it the WebKit cache anyway.)

The reason I wanted to do this was, well, because Apple recommends it somewhere (I forget where) if you have other stuff in your cache folder (as NetNewsWire does). Plus it just feels quite a bit cleaner.

Makes sense, right? In creating the new cache, I wanted to use the capacity settings from the original cache.

So tonight I got it in my head to finally get to the bottom of this. I tried a bunch of things, including creating an NSURLCache subclass where all the methods called super, and watching the various methods actually get called in the debugger, so that I knew that my cache was getting sort-of used, even if nothing ever made it to disk.

Finally, on a hunch—a hunch that I wish I’d had a year ago—I rewrote my code like this:

And now it works! Cache-y things actually written to disk. You have no idea how glad I am: this really has been bugging me for a long time.

It turns out that referencing [NSURLCache sharedURLCache] before calling setSharedURLCache was the problem. So there’s the answer: don’t go like that.

Anyway, if anyone else ever runs into this particular problem and looks on the web for help, this post is repetitive enough with terms like sharedURLCache that it will probably turn up in Google near the top. ;)

SCI FI Wire: “On Feb. 26, IGN.com reported a rumor that Matt Damon was under consideration for the role of Kirk, Oscar winner Adrien Brody was being eyed to play Spock and Gary Sinise was being mulled to play Dr. Leonard McCoy.”

I could take Matt Damon as Kirk. It’s Ben Affleck as Kirk that gives me the heebie-jeebies.

I’ve been noodling with the colors in the toolbars, since not everyone likes (as I do) the colorful look.

Here’s a blue version and a graphite version. What do you think? (Note: I’m just asking about colors, setting aside the issue of shapes and so on.) Do you prefer the single, more subdued color for all?

I noodle around a lot with user interface. I try things. I have pet theories. Some people know where to go in advance—me, I have general ideas, I iterate, change course, go nuts, keep at it, keep noodling, then fiddle a bit until I like what I see.

Once I start getting feedback, it all starts all over again.

Anyway, here are some screen shots from the builds right before NetNewsWire 3.0d8 got into the hands of the private testers last Fall.

You can see that, among other things, I was trying to get rid of the toolbar-at-the-top entirely. Though lots of apps (iApps, especially) are going this way, it’s not that great for usability in apps like NetNewsWire and Mail where the items are listed near the top—your mouse ends up traveling too much to hit the buttons at the bottom.

One of my personal favorite new features is the ability to hide the subscriptions list. It gives you more room when you’re viewing a web page—or you can even use NetNewsWire as a single-pane aggregator.

You can hide and show the subscriptions list manually via the View menu: choose Hide Subscriptions List (or Show, of course, depending on its state). It has the same keyboard shortcut as Mail has for showing/hiding mailboxes.

The way I use it is to have it hidden and show automatically. When viewing a web page, it hides. When viewing a news item, it shows. Choose View > Automatically Hide Subscriptions.

There’s a hidden pref for using black (dark gray, really) toolbar buttons instead of colors. I find that certain number of testers liked this look, and so I kept it and made it available. I’m not sure if I’ll make it a “real” pref or not (I don’t like to add prefs).

If you want to try the monochrome toolbar, here’s what to do:

1. Quit NetNewsWire.

2. In Terminal, copy-and-paste the following and hit return:

defaults write com.ranchero.netnewswire blackToolbarButtons 1

3. Launch NetNewsWire.

To go back to colorful icons, do the same as above with 0 instead of 1.

(Note: I know that the toolbar is the most obviously visible change. I’ll write more about it from an app design point of view today or on the weekend.)

I’m hugely excited about NetNewsWire 3. Even though there’s still a lot to do, I wanted to get it out there because, well, I can’t stand the thought that you’re not using it. ;) (But, beware, I’m serious about the danger thing, so don’t use it if you’re not comfortable running software that’s clearly unfinished and has bugs.)

There are a ton of changes, not all of them visible or obvious. I’m going to take a break from programming for the next few days and write about some of these changes.

waffle: “C has dominated programming for the last 35 years. Anyone who says differently is lying or work on Sun’s or Microsoft’s marketing team. One of the first properties I assess of a new programming language is ‘how easy is it to drop into C’?”

Here’s a small data point: I love C. Absolutely adore it. Really. I’m a total freak—I think pointers are cool and I don’t mind at all doing memory management. I fantasize about writing apps entirely in C. That makes me an outlier, a real weird freakazoid.

However, I’ve been quite happy with Objective-C, and I suspect I’ll be even happier still with higher-level languages, using C and Objective-C only when needed for specific features and performance issues.

So it is with reluctance that I agree that C is becoming the new assembly. It’s not like I hate it—quite the opposite. (A well-written C app is a thing of beauty, by the way. Even though C isn’t object-oriented, you can still use object-oriented techniques. You can build things in such a way that most of the time you work at a very high level, only rarely dropping down into lower layers of your app.)

The upshot for me is that, well, I’m learning Ruby. ;) As much as I love C, I’ve always loved scripting, too.

Nick Bradbury: “My family moved to Tennessee when I entered my teen years, and it was there that I met my first true love. She was a southern girl whose father was a fire-and-brimstone minister. I was 16 at the time, and to prove my devotion to her I agreed to attend one of her father’s church services.”