Linked by Jared White on Thu 24th Apr 2003 17:49 UTC
General Development There are two major varieties of Cocoa available. The first variety, possibly the more well known of the two, is the kind that you can use to make a nice warm cup of chocolate milk. While tasty, it's hardly proper subject matter for an operating systems information site. The second variety is far more on-topic: a programming environment for Apple Mac OS X that is the modern evolution of of the original NeXTSTEP frameworks. That's what I'm here to talk about today.
Permalink for comment
To read all comments associated with this story, please click here.
Re: Not convinced
by Nicolas Roard on Fri 25th Apr 2003 10:30 UTC

Sorry, but I do find the [] syntax confusing, as it's never clear what is the method and what are the arguments.

Well in the beginning I had difficulties too, I didn't "got it". In fact, it's really simple :

[myObject messageWithArgument1: foo andArgument2: bar];

the function's name (function signature, or selector) is NOT


as you could think, but :

messageWithArgument1:andArgument2: !

In fact, you put your arguments "inside" the method's name/call ... it's not simply that you "name" the argument, the "argument's name" is part of the method's name.

I've not seen anybody mentioned the big disadvantage of Objective-C, in that it's very slow.

It's not "very slow". It's a compiled language, and frankly I don't see the difference when programming with GNUstep or with Qt. I "know" that methods invocations are a bit slower due to indirection, but it's barely noticeable. I think that today's computer are too fast ;-) (and remember, NeXT ran on 68030, and their eventual slowness was mostly due to DisplayPostscript, not ObjC). Anyway, the biggest problem due to rapidity in a program is generally due to a bad algorithm/architecture rather than the language itself.

And of course, if you want, it's trivial to "cache" the method call, thus no more indirection, it's as fast a standard C function call !

You could easily use directly C if you care so much (never had the need to do that in fact).

Python has the advantages of a non-confusing syntax and true garbage collection.

Personnally I can't stand the tab thing with Python... ;-)
But what's your thing with garbage collection ? With GNUstep, you are free to use a real garbage collector instead of retain/release ! (Mac OS X can't, yes, but it's available on GNUstep).

But strangely, retain/release/autorelease is more used anyway (I think that's because it's quite simple mechanism, efficient, and far painless than C memory handling, and not very complicate).