inessential by Brent Simmons

April 2012

Wish

I wish there was a separate WWDC just for Mac development. Imagine how much fun that would be. I’d totally go.

I don’t imagine there’s any chance of that happening, but a fella can still dream.

The Three Keys to iPhone App Performance

When I’m writing iPhone code, I keep three things in my mind at all times:

  1. Don’t allocate any memory.

  2. Don’t do any work.

  3. Don’t block the main thread.

Obviously, 1 and 2 are impossible — you’ll need to allocate some memory and the app will actually have to do something. But I bend the stick by thinking of these extreme rules rather than something nicer like “Allocate as little memory as possible” and “Minimize the amount of work the app does.”

(The last one — don’t block the main thread — is totally possible, of course. That rule isn’t extreme at all.)

One example lesson I’ve learned: when you have a complex, variable-height table view cell with a bunch of layout, it can be tempting to want to cache that layout — or at least text and image measurements — so that you can avoid the work of re-measuring and re-laying-out.

I’ve found that sometimes that’s actually slower — because, after all, caching and retrieving from a cache also involves memory allocation and work. Caching isn’t free.

And sometimes it’s not slower.

So I’ll add a fourth key:

Use Instruments.

Not an extreme rule — a necessity.

On Skipping WWDC This Year

I won’t be at WWDC this year due to a once-a-decade massive family visitation. I live on the cool coast, and my family (mostly) lives on the other coast, so it’s a Big Deal Not To Be Missed.

(I may tweet faux locations during WWDC, just to send people on wild goose chases. “Shields.” “No, Tempest.” Etc. Let me have my fun, okay?)

I still love WWDC, and I’ll be there next year.

But I may not buy a ticket next year. Here’s my thinking:

  • I get a ton of value out of the sessions — and they come out on video very quickly these days, and they’re easy to get. I play some of them over and over. There’s no need for a ticket to get the sessions.

  • I haven’t used the labs much over the years. I had one great experience in the labs in 2005, but they’re just not generally useful to me. I don’t tend to have the kinds of problems that only a lab can solve, and I have lots of ways of getting help and finding answers. (So do you.)

  • I’ve been a Cocoa developer since 2002. There are developers newer to the platform who can benefit much more than I can from actually being at WWDC. If I don’t buy a ticket, somebody else who needs it more than I do can attend.

  • Most of the value of WWDC — for me, at least — is after hours. I can skip the actual conference and still appear in the evenings.

So, again, yes, I’ll be there next year — but I bet I won’t have an actual ticket. I’ll let that ticket go to someone else, someone who’s more excited and able than I am to get up early each morning.

Y goes down (or up, or something)

Say you’re editing a xib in Xcode, and you want to move a thing down.

So you show the Size inspector and find the Y axis stepper.

And you have a choice: click the down arrow or the up arrow?

You want the thing to go down, so you click the down arrow. And the thing goes up.

I’ll never, ever get used to this, no matter how much it makes sense.

ded

[RSDevLion:~] alias ded
rm -rf /Users/brent/Library/Developer/Xcode/DerivedData

At this point it’s become a matter of religion. When anything goes weird, I just type ded.

(Part of) Why Instapaper and Similar Are So Useful

ReadWriteWeb, Jon Mitchell: Websites Have to Get Better:

Read-later apps are competition for noisy, ad-ridden websites. They represent a simple fact: Users hate our sites.

Sure do.

Dave Winer suggests:

Generate a community of template designers who create readable templates that we can use in content management systems… Make it easy for people to make readable sites. And beautiful and have advertising. Help solve the problem.

Very Nice Indeed

I didn’t know Pacific Northwest neighbor John Moltz had a new-ish website. I subscribed to the feed.

(John lives in the Pacific Northwest, yes, but just enough offshore to be in international waters, where he’s legal.)

Kyle’s Objective-C Namespaces Proposal

⌥⇧K:

This proposal introduces a new kind of selector that carries a namespace in addition to, but distinct from, its keywords. It redefines classes, categories and protocols to be members of namespaces, and provides rules for what namespaces their methods belong to.

I’m not sure that we need namespaces. It would solve some problems by adding complexity — too much, I think.

But I’m not sure I’m right.

Security and Profit

John on a difference between security and privacy:

The difference, though, is that with security, the biggest problem is a lack of attention from developers. With privacy, the biggest problem is purposeful obfuscation by developers looking to profit by having users think their information is more private than it actually is.

I agree that the biggest problem with security is a lack of attention. But I also think that a lot of security issues, at least in the past, were a result of developers seeking to profit by making their software easier-to-use at the expense of security.

There’s no need to point the finger just at Outlook and IE and Windows. An example that persists, and that bothers me, is Safari’s “Open ‘safe’ files after downloading” preference, which defaults to on.