7. Version Control

There isn’t much to the passer-rating project—less than a hundred lines of source, plus the contents of the project file—but you have already invested time and trouble in it. So far, you’ve only created three files, but soon you will be moving on from creation to change. If you’re like most programmers, you are conservative of the code you’ve written. An old function may no longer be required, but it may still embody an insight into the underlying problem.

One solution might be simply to keep all of the obsolete code in your active source files, possibly commented out or guarded by #if 0 blocks, but this bloats the file and obscures code that actually does something. Once the revisions get more than one layer deep, it can be ...

Get Xcode 6 Start to Finish: iOS and OS X Development, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.