Reputation: 27
I'm planning to learn Objective C. Most of the books say that the reader should know C as a starting point. Is it necessary to know C before diving in the Objective-C ocean ? I'm a ruby programmer.
Upvotes: 1
Views: 1312
Reputation: 5296
As @arjan points out it's a superset of C. You might be able to work your way though examples and such without prior C experience, however to become productive you will eventually have to understand plain C. For examples many APIs such as SQLite access are only C (not ObjC/Cocoa). You really have to grasp concepts such as pointers, C-style strings etc.
Upvotes: 1
Reputation: 41209
I personally think you should be fine diving in without C. Yes, Objective-C is a superset of C, but that doesn't that all Objective-C coding will require C knowledge. The situation is similar for C++. I say if you have a firm knowledge of at least one programming language and know the basics of C's constructs and syntax you should be fine to start the other stuff. You don't need to be able to write strong C applications before you get started with Obj-C, but it will help you a lot once you can.
If you find you need to do something that requires deeper C-knowledge, then you can hit the C manual a bit harder, but it probably isn't necessary until you get to that point. You should be able to develop your experience of the two languages pretty simultaneously instead of having to learn C for a month before you can even touch Objective-C. :D
Here's what the Objective-C books want you to know about C:
Since you're a ruby programmer, most of this should come fairly easily. The biggest shock is going to be moving from a high-level dynamic language to a low-level static language, so be prepared for some big changes, buts its nothing you won't be able to handle.
Upvotes: 4
Reputation: 19323
Nah. As long as you know what functions are, variables, objects, then you'll pick up "C" syntax by programming in objective C. To be more specific, I don't think you need to go and "learn C" first. Rather, I'd keep a C reference handy and look up anything you don't understand there.
Upvotes: 0
Reputation: 34625
From Wikipedia -
Objective-C is a reflective, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Objective-C is a thin layer on top of C, and moreover is a strict superset of C;
Yes , you should have knowledge of C
.
Upvotes: 1
Reputation: 3061
I don't think it is absolutely necessary, I learnt Objective C with no knowledge of any other languages. However, saying that, it is very useful if you know C and a bit easier.
Upvotes: 0
Reputation: 38163
You can't program in Objective-C without knowing C, as Objective-C is simply a superset of C.
Upvotes: 0