For No One

RSS

➩ Method names in Objective-C

Matt Gallagher went in depth (a few years ago) on Cocoa’s naming conventions. He defends them against common criticisms, and explains them well:

Objective-C aims to be substantially more self-documenting than its peers. The intent is that all methods in all classes should be able to follow the same set of rules so that subtleties of behavior are easy to see and understand — even when you are new to the class.

This aim combines with the named parameters in Objective-C to produce methods which are quite distinct compared to other languages.

If you write code for OS X or iOS, you should definitely be aware of these conventions. I’ve certainly broken them in my own code, and will adopt them going forward.