Learning a new programming language can be daunting, especially if it relies heavily on a set of idioms or patterns you have never encountered before. Before you start writing good code in a new language, you first need to know what good code looks like. Having a standard style guide can help you get up to speed on best practices used throughout the community – and making it easier for new developers to join the platform is something we should all strive towards. At Macoscope, we believe in helping fellow developers out, an attitude which we hope is reflected by our small but constantly growing library of open-source code and our engagement with the community at events like Mobile Central Europe.
Coming from a Python background, I thought it was weird and maybe a little worrying that there was no One True Official Code Style Guide for Objective-C. It seems like every modern language has one these days – often with a matching automated tool that helps you to conform to it. Python has its PEP-8, Go has gofmt, even PHP has a set of PSRs! Not so much with Obj-C. When I was starting with iOS development, if you weren’t already familiar with the handful of big names in the Cocoa world, the best you could find was probably Google’s guide which is… of questionable quality, to say the least.
We recently arrived at the decision to open our style guide to the public. If, by chance, you had a look at one of our job postings (we’re hiring, by the way!), you may have noticed us mentioning our internal style guide. As of today, it’s no longer internal. We spruced it up a little, gave it a fresh coat of paint and published it on our Github. It’s a living document, and the rules aren’t set in stone, so if you think it could be improved, don’t hesitate to open a issue or submit a pull request.
We encourage you to go and dive right into our new, shiny Macoscope Objective-C Style Guide, and we hope you find it as useful as we do.