An important lesson from Objective-C

I’ve started to develop applications for iOS about 3 months ago and there were a lot of things new for me in that environment (there are a lot yet) and Objective-C was not exception.

The syntaxis of this programming language is scary the first time you see it but with time you get used to it and you can get a lot of good practices too.

One of the most important things I’ve learnt is that the more self-explanatory a method is, the better. It doesn’t matter how long it is. Actually this is something you can apply to other languages. Let me show you a quick example:

function cleanAllInputValuesAfterValidation(values){}
function sortDirectoriesAlphabetically(directories){}

In fact, in Objective-C you can pass parameters in the middle of the method’s name, which teaches you a couple of things about naming. You can see DHH’s thoughts (the creator of the framework Ruby on Rails) about this here.