Objective-C – Origins: C++ or C?

ciosobjective c

I am very confused about this programming language, Objective-C, which I heard is used to develop iOS applications.

I know that it uses the principles of OOP. Would it be easier to learn if I already knew C++?
What about it's name? is it a combination between the C programming language and the OOP principles I use in C++?

Best Answer

Brad Cox and friends added a thin layer of Smalltalk on top of C.

Objective-C thus has much more in common with Smalltalk's highly dynamic message-sending style OO than C++'s.

One major difference is that in Objective-C you don't worry too much about what class something is: you care about what messages something understands. You can have objects that change the set of messages they understand, at runtime.

Having said that the two languages have very different ideas of what OO is, many ideas/principles are still shared: inheritance, delegation, polymorphism, and so on. You'll easily find many examples of the various OO patterns in code written in either language.

Related Topic