Who am I? @mostgood
✤ Started writing iPhone apps in 2008 !
✤ Head of App Development at Dennis Publishing (we’re hiring!)!
✤ Best of 2013 - Newsstand
✤ Code that was written by someone else that you have to maintain!
✤ How many of us have inherited code?!
✤ Try it if you haven’t - it’s amazingly fun and educational, and only
Why inheriting code?
✤ Had a new iOS developer join last week!
✤ There has been a lot of !
“Why was this done?” !
“How does this actually work?”!
and general anger at the people who wrote it...
“Why do I need to open Xcode?”
✤ Some rampant bugs need squashing!
✤ The app looks dated!
✤ Add new features!
✤ Legal issues!
✤ API deprecation
I’ve opened Xcode...
Stalk your prey
✤ Go through documentation!
✤ Look through commit history!
✤ Issue tracking!
✤ Crash reports!
✤ Become obsessive
As you go
✤ add comments!
✤ add pragmas!
✤ document how it works!
✤ keep track of known issues!
✤ add tests
✤ Update 3rd party libraries/frameworks!
✤ Basic refactoring!
✤ Drop support for older OS versions if possible!
✤ Run ‘Convert to Modern Objective-C Syntax’, etc
Not so quick fixes
✤ Standardise: Replacing XYMagicGridView with UICollectionView!
✤ Modernise: NSURLConnection -> NSURLSession!
✤ Updating persistent storage type: Plist -> CoreData!
✤ Complicated refactoring
It’s too broken: rewrite all the
✤ Declare bankruptcy on technical debt!
✤ Latest and greatest
This isn’t working: rewrite all the
✤ booBoo.surfaceArea > plaster.surfaceArea!
✤ Making it worse!
✤ Ghosts in the code
“Why is it like this?”
✤ Did people really not care about quality and maintainability?!
✤ But there is usually a reason why
✤ On the cheap!
✤ Newly native!
✤ Inexperienced team
✤ Cray cray deadlines!
✤ Too many cooks!
✤ Bad clients
Don’t point fingers
✤ We all do stupid things!
✤ There are always circumstances!
✤ If you haven’t already, you’ll create something that will torture
another developer someday
Open a dialogue
✤ If possible, get in touch with who worked on it before!
✤ Talk to people who are maintaining your code!
✤ Find people at conferences, meet-ups, twitter, etc...
“It’s good to talk”
✤ It shows you how far you’ve come!
✤ Grounds you!
✤ Learn something new!
✤ Teach someone something new!
✤ Shows respect!
✤ Strengthens community
What’s your legacy?
✤ When you write code, think of the next developer!
✤ Document and comment!
✤ Write meaningful commit messages!
✤ Coding standard!
✤ Write tests (if you’re into that sort of thing)
mild WTF Good Better
Comments x x x x
Documentation x x x
Issue tracking x x
Refactor x x
Coding standard x x
Price: < hour few hours a day few days