Not a bad intro to ObjC message syntax. Even though the article has few mistakes.<p>Most notably ObjC syntax does not have functions that are called, it has messages that are sent to objects and classes. In the end all messages are "translated" to C function calls to objc_msgSend().<p>Everything makes sense after you read the proper documentation. Which in this case is <a href="http://developer.apple.com/library/mac/documentation/Cocoa/Reference/ObjCRuntimeRef/ObjCRuntimeRef.pdf" rel="nofollow">http://developer.apple.com/library/mac/documentation/Cocoa/R...</a>
I was interested in this article when I saw that you<p><i>"... wanted to help out those who began to learn iOS evelopment, especially programmers who are coming from no programming background or web development background"</i><p>but then the first line of your next article is:<p><i>"I assume you are very familiar with declaring functions in [Javascript, PHP, or Ruby], if not, you should not be reading this"</i><p>So... which one is it? A tutorial for non-programmers or programmers familiar with other languages? or a tutorial specifically for people fluent in Javascript/PHP/Ruby?
I'm going to have to start referring to this post when I explain why I like objective c. Usually people just give me this crazy stare like I'm some kind of moron.<p>One thing though, if you spell a method name wrong, it will still compile. It's only a warning that "the object may not respond to that selector". Of course if you have warnings as errors turned on, then of course it will error.
python also has this right by introducing named parameters. The same function in python can be written as:<p><pre><code> do_send_mail(recipient="some@email.com", cc="another@email.com", subject="Hello!", body="hi!")</code></pre>
Totally personal preference. I would rather have a language be concise and the documentation verbose than the other way around or with both verbose.<p>Having it be verbose is great for learning, but after a short while syntax like:<p><pre><code> do_send_email(recipient, cc, subject, body)
</code></pre>
is much better for quickly reading code. Plus, reading the docs is hugely important. Having to check every now and then is great for getting you back into them.
<i>I hope you understood the very fundamental reason why Objective-C syntax has to be the way it is.</i><p>It does <i>not</i> need to be like this in a statically typed language. Most statically typed languages don't require you to pass the parameter name. Some have this optionally so you can mix and match or have default values (C# for example <a href="http://msdn.microsoft.com/en-us/library/dd264739.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd264739.aspx</a>).<p>If you'd written other statically typed language the Obj-C syntax would probably still be surprising to you.<p>Brilliant design by Apple it is not, it's the nature of statically typed languages. For example your comment:<p><i>Now, which one is the recipient? What is the subject?</i><p>Shows a lack of experience with statically typed languages. IDEs will tell you if you hover over the method with your mouse as well as when you're creating the method (including all the variations).<p>On the other hand it's quite fun to see someone naturally find out some of the reasons why some people prefer statically typed languages.