A Programming Injury

Launching Knit and finding my footing again

Andrew Procter
Treble Apps

--

I quit my cushy “Sr. iOS Developer” job in April to start my own thing. I took a huge pay cut, lost health benefits, put strain on my relationships, and shot my stress levels through the roof to do it. It seems crazy, but it was the price of entrepreneurial admission. I needed to pursue the creation of all the app ideas that have been bouncing around in my head since the App Store launched six years ago.

In order to make that happen, I made sure my new company placed focus on building and launching our own app ideas, not just those of our clients. It’s not purely a selfish pursuit — we believe that designers and developers learn the most from the projects they’re the most passionate about. We then take what we’ve learned making our own apps and apply it to the work we do for clients. The first of those original in-house ideas just went live in the form of Knit. I’m really proud of it. This is the story of a bug that drove me to injury.

Knit allows you to leave geo-located notes for friends. To get a note, your recipient has to travel to the place where you wrote it. This makes development tricky, because the core feature of this app is one that can’t be tested reliably in the iOS simulator. It doesn’t do location all that well. You need to be out in the real world, where there’s real cell tower setups and real GPS accuracy issues. So I walked. I walked around my neighborhood in Toronto laying down notes, then retracing those steps to make sure the notes got picked up. Rinse. Repeat.

It wasn’t long until I figured out that the basic geofencing features Apple makes available to developers weren’t going to work. They just weren’t accurate enough. The notes I laid down on my walks weren’t getting picked up on the way back. Our testers were discovering notes many hundreds of meters away from where they were left for them.

To fix this, we came up with a hybrid solution. We would use geofences to detect when our users were in the area of a note, then fire up full GPS and wait for an accuracy threshold to be crossed before we displayed the note notification. I implemented it, and voila! It worked!

Until it didn’t.

Weeks later, note pickup bugs resurfaced, and I couldn’t figure out why. Our logs showed nothing useful, the bugs weren’t consistently reproducable, and the simulator was, again, of no help. So I walked again. And again, and again, and again. One particular day of attacking this problem was immensely frustrating, and by mid afternoon I’d had more than enough. I tapped out a message: “Tennis?”. I sent it to Geoff Villeneuve, a fellow developer who helped out on Knit. We play tennis once or twice a week.

That day on the court, Geoff was the note pickup bug. I played hard.

When we finished playing and began the walk home, my left knee started to feel, for lack of a better word, weird. By the time I got home I couldn’t bend it without immense pain, and it had begun to swell. It would be another week before I could walk on it, during which I had the downtime to fix the note pickup bug. It wasn’t even all that hard to fix — we just needed to find the perfect balance of geofence radius, note radius, and GPS accuracy.

Taking frustration out playing sports is normal, even healthy. But I may have taken it a bit too far. The diagnosis so far is meniscus irritation, caused by playing tennis too hard on legs that, turns out, haven’t walked properly for years. All the walking around the neighborhood testing Knit didn’t warm up my knees for a rousing game of tennis, because I was doing it wrong.

On the left: my natural standing position. On the right: how I’m supposed to stand.

They call it ‘collapsed ankles’. It messes with the whole lower body, and caused irritation in the meniscus in my knee.

Turns out all the joints below your belly button are highly affected by how you walk. My knee should be alright after a few weeks of physiotherapy, but the underlying problem will take many months to correct.

I left myself a note at the tennis courts for when I return.

Knit is available in the App Store now.

You should follow Treble on Twitter: @trebleapps

Special thanks to everyone who worked on Knit: @jonrundle, @jonathankochis, and my tennis partner @gvilleneuve. I’m @andrewprocter.

Tennis court photo credit: dkwonsh on Flickr.

If you liked this piece, hit the ‘Recommend’ button so others can see it!

--

--

Andrew Procter
Treble Apps

Currently @trebleapps, previously mobile engineering @envoy, @resolutionim