Ryan (tekman) wrote,

Objective-C: Does it grow on you?

(Warning: This represents a mid-learning rant. Opinions are probably under- and misinformed, and subject to change. If you love Objective-C, please tell me why and give me hope.)

So far, only a couple hours into my relationship with Objective-C, I hate it. Perhaps worse than C++.

Mostly, I'm frustrated at weird conventions that work around seemingly braindead problems with the language.

Like the whole weird first argument thing, where convention says you slap WithX onto the message name, so you end up with something like

[locationManager updateWithLatitutde:lat longitude:long]

Then there's the whole issue that in the prototypes you're defining message passing with named parameters, in effect, but you don't get a binding on the parameter name, it's SEPARATE, and convention shoves 'a' in front of the natural var name:

-(void)updateWithLatitude:(float)aLatitude longitude:(float)aLongitude;

It's also plagued with huge flat namespace issues.

In any case, right now I hate brackets.

I can't believe it's 2008 and I'm going against my conviction to never bother learning another language without first class functions and lexical closure.

On the upside, at least there's duck typing and message forwarding. At least, if you can penetrate the syntax.

For anyone who's come out the other end of this tunnel, did you eventually come to enjoy Objective-C or is it just the ugly cross-bread stepchild of C and Smalltalk that should have died with NeXT instead of getting dragged back into OSX?
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment