Dan Rosenstark
Dan Rosenstark

Reputation: 69747

Objective-C: High-level language?

I have managed to avoid C and C++ up until now (except for a few HelloWorlds), and have instead worked in higher-level languages. I've worked and lived in VB6, then Java, then C#, then ActionScript, and now Ruby.

I've recently become curious about programming for the IPod Touch/IPhone. Though I've seen some possibilities for avoiding ObjectiveC (like Mono for IPhone), I'm curious about Objective C. Mostly: does it require the developer to handle garbage collection and manage pointers and that sort of thing?

Edit: I am totally open to the possibility that my concept of higher- and lower-level languages is incorrect or misleading.

Upvotes: 3

Views: 1616

Answers (4)

rein
rein

Reputation: 33445

Garbage collection: yes, but not nearly as bad as C or C++. Once you understand Objective-C garbage collection it's really easy. It doesn't take that long to learn or master either.

As far as pointers go - you'll be using pointers far less frequently than you would in C or C++. Yes, a bit of knowledge about pointers is useful (knowing the difference between declaring NSString * and NSString) but that's also not that complicated.

Personally I would avoid all the "higher-level" languages that are emerging for iPhone development. They really only eliminate the need for you to learn Objective-C but still force you to use the native framework (Cocoa Touch). They add complexity for laziness sake. Objective-C can be learnt in a week, debugging framework nuances takes a lot longer. But then again, it is only my opinion.

edit:

C# memory management can also be a pain if not done correctly. Yes, there's a garbage collector that works in a lot of cases. However, there are also objects that need to be disposed and not disposing them correctly can lead to memory leaks. Creating your own IDisposable objects can also be tricky if you're not 100% sure what the order of the Disposing sequence is. I've seen a lot of projects where developers get this horribly wrong. Basically what I'm saying is that the Objective-C memory management is not more complex or more technically difficult than the Dispose chain in C#/.NET

Upvotes: 10

Randolpho
Randolpho

Reputation: 56381

It's not as "high-level" as C# and Java, IMO, but it's still considered a high-level language, just like C++ and, yes, C.

Objective C does have garbage collection, but the iPhone Object C does not.

Upvotes: 1

arno
arno

Reputation: 357

There is garbage collection for Objective-C but not for the iPhone, i. e. if you write software for the iPhone you have to handle the memory stuff on your own, but this is no general Objective-C problem.

Upvotes: 4

Cade Roux
Cade Roux

Reputation: 89651

"Mostly: does it require the developer to handle garbage collection and manage pointers and that sort of thing?" - on the iPhone, yes.

Upvotes: 1

Related Questions