July 2009

Mac App Guide Review of Menubar Countdown

The Mac App Guide video podcast has reviewed my Menubar Countdown application. The review includes a demonstration of how to use it.

See MAG 23: Handy Countdown Timer (Freeware) for Mac OS X.

Lunar Lander

Whenever I'm asked how I got interested in computers, I relate this story:

When I was about ten years old, my father took me to an IBM open house. Dad worked for IBM during its heyday, when it was the biggest computer company in the world and would seemingly control the computer industry forever. Employees were treated very well, with lots of company-sponsored picnics, dinners, holiday parties, and so forth. This open house was a celebration of the opening of yet another new IBM office in the Atlanta area.

I was a smart kid, but had never played with computers. This was before TRS-80's and other home computers were available. I think we may have had some Sears-marketed Pong game at home, but otherwise my experience with computers consisted of what I saw in sci-fi TV shows and movies.

While walking around the office, Dad showed me and the rest of my family the IBM systems. I was bored: all I saw were a bunch of glass-walled rooms containing green-screen terminals with huge printers connected to them, and guides bragged about how many pages of text could fit in their memories and how fast the tractor-feed printers could print reports and paychecks.

Then, almost as an afterthought, we went into this little room where a couple of bearded guys were sitting at a small terminal. I immediately sensed that these guys were not like the other IBM'ers. I now know these guys were programmers, but back then I just knew that even though these guys wore ties, they weren't businessmen. These guys were different, and cool.

They asked me if I wanted to play a game on their computer.

The game was Lunar Lander. It was a purely text-based game, without any graphics or joystick controllers or other videogamey stuff. It told me how high above the lunar surface I was, and what my rate of descent was, and asked me how much fuel I wanted to burn. (See 40 Years of Lunar Lander for examples of what this experience was like.)

I was unable to successfully land, even after several tries, but I was suddenly and permanently obsessed with computers. I had no idea how they worked, but I knew that the computer contained an imaginary universe where a lunar lander was descending toward the moon. I figured that if I learned how computers worked, I could create some imaginary universes of my own.

So, I started asking Dad about how computers worked, and he started borrowing manuals from the system engineers and bringing them home to me. Then I got an Atari 800 computer for Christmas one year.

Since then, there have not been very many days that I have not been playing around with imaginary universes. I owe it all to Lunar Lander and supportive parents.

Thank you, Mom and Dad, and also thank you to the nameless, bearded guys who invited me to join their game.

iPhone Camp Atlanta 2009

Yesterday, I attended iPhone Camp Atlanta 2009, a conference for iPhone developers and others interested in iPhone development (business/marketing people). At the same time and in the same venue, Mobile Camp Atlanta 2009 was taking place, targeting developers for Blackberry, Android, Palm Pre, and Windows Mobile.

The conference was organized as a "BarCamp-style event." I had no idea what that meant. It means that on the day of the conference, attendees who want to give presentations sign up and give them. There were five presentation rooms, and nine half-hour time slots, which meant that 45 sessions could have taken place. The actual number of sessions was about half that, because there just weren't that many people who came prepared to give presentations.

Each session was scheduled to be 30 minutes long. In reality, each session was only about 20 minutes, due to in-between-session movement and other logistics. I would have liked to have seen some longer sessions with more detail, but the short-session format did keep things from dragging.

I enjoyed the sessions I attended. I sat in on a few iPhone development sessions, related to use of Google Toolkit for iPhone, XML parsing, and Core Data. I also sat in on a couple of business-oriented sessions.

As with most conferences, the real reason to attend is not to learn material in the sessions, but to network with other people. Unfortunately, I'm not a great networker, so I wasn't able to take advantage of that aspect.

The organizers did a great job. I'll go again next year. Maybe I'll even work up the courage to give a presentation myself.

Adding a Custom View to an NSStatusItem

My Menubar Countdown application uses an NSStatusItem to display itself in the menu bar. I recently had to add a custom view to that status item, and thought I'd share what I learned about the process here.

Anti-pattern: The Overly Generic Interface

While learning about Core Animation, I was disappointed to find that it is plagued by the anti-pattern that I call the Overly Generic Interface.

Review: Core Animation for Mac OS X and the iPhone, by Bill Dudney

Either I’m stupid, or Apple’s developer documentation sucks. Whenever I try to enter a new area of Cocoa development, I am presented with simplistic tutorials and detailed reference information, with little in between to bridge the gap between newbie and expert. Often, the only way to learn an API is to hack on the example programs until enlightenment occurs, or do a lot of Googling.

This is exactly what happened with Core Animation. Most OS X developers don't need to know much about Core Animation, as it is a relatively new feature of OS X, and Mac users don't expect fancy animations in every application's UI. However, on iPhone, users do expect things to bounce and zip around the screen, so an iPhone developer really needs to know this stuff.

I started reading Apple’s Core Animation Programming Guide several times, and each time, I got lost in Chapter 2. Skipping forward to subsequent chapters didn't get me anywhere. I was presented with architectural diagrams and abstract discussions of geometry and transforms and layers and timing and so forth, but there was nothing concrete that I could grasp.

Bill Dudney’s Core Animation for Mac OS X and the iPhone filled in the gaps perfectly. It doesn't contain much information that is not in Apple's docs, but it presents it in a way that makes sense to me. Dudney leads you by the hand through actual working code that does cool stuff. After reading this book, I now understand what Apple was trying to tell me in the Core Animation Programming Guide.

I read the PDF-formatted version. I also tried reading the epub-formatted version using Stanza on the iPhone, but that didn't work so well: the diagrams and code examples aren't readable. So I recommend sticking to the PDF or paper formats.

My only gripe is that I'd like to see more iPhone-specific information. The majority of the book covers Core Animation on OS X, and then there is a single chapter at the end about the iPhone. I would prefer to have an iPhone-centric book with an oh-by-the-way-this-works-on-OS-X-too chapter. But that's a minor quibble; I think I understand the material well enough now that I can learn the iPhone-specific aspects of Core Animation on my own.