3 ms·
In some ways it's a giant step backwards... you have to deal with pointers and header files. And it repeats itself a lot (declare the same things multiple time
by ohhmaagawd 18y ago
In some ways it's a giant step backwards... you have to deal with pointers and header files. And it repeats itself a lot (declare the same things multiple times). String manipulation is awful in Objective C.
I would say it's a hell of a lot better than C. But kind of irritating compared to Java or Ruby.
- tlrobinson 18y agoYou can't really call it a step backwards, since it's been around for 20 years, long before many other dynamic languages like Ruby and Python. But irrespective of time, there are a few annoyances compared to at least Ruby (I wouldn't say it's worse than Java though). The pointers aren't such a big deal, as long as you don't try to use the math operators on them. You just have to remember the "*" in declarations. Remember, objects in most dynamic languages are "pointers", you just don't have access to the raw bits. BTW, Objective-J solves the problems you mentioned (no raw pointer access, no header files or needing to declare things multiple times, the "+" operator does string concatenation and regexes are built in). Of course it's mostly for client side web apps, rather than native apps (though Cappuccino works in Adobe AIR...)
- Tichy 18y agoI consider it a step backwars because Apple is forcing us to use it (again). Why not let a 20 year old language that hasn't aged well rest in peace?
- potatolicious 18y agoIts interface is definitely cumbersome by Java standards - but through it you gain a lot of control over performance. String ops are painful because you are cloning your memory over and over, and if you used NSMutableString instead, you'd get a much nicer interface as a result. If ever in Cocoa you think to yourself "man, this API is really awkward", Google it, you might find that you're not using it right. It certainly worked for me.