asker

mahmoudhossam-deactivated201107 asked: Since this is an Obj-c blog,I have a question for you

why would they make another C with OOP,what's wrong with C++?

It sounds from your question like Objective-C has only been around for a couple years. Believe it or not, Objective-C is an old language! It was invented in 1986 by Tom Love and Brad Cox (only 3 years after C++). It was adopted by NeXT as the lingua franca of the NeXT OS, and was the language that Sir Tim Berners-Lee used to write the world’s first web browser.

Objective-C and C++ were created with very different purposes. The former was an experiment in combining the dynamism of Smalltalk on top of the C language. C++, on the other hand, was built to add the object oriented features of Simula to C, but without suffering from Simula’s performance problems.

PC Week summed up this difference nicely in their 3 Nov 1997 edition:

Objective-C is the result of adding object facilities to C with the goal of making programmers more productive. The result differs greatly from C++, which adds objects to C without making computers less efficient: quite a different goal.

I’ve found this to be the case in my own use of the language. I’ve learned several languages over the past decade, and Objective-C is the only language I’ve actually enjoyed using. Of course, each language has its flaws (including Objective-C), but Objective-C gives me the organization of an object-oriented language like C++ or Java, the power of a dynamic and flexible runtime like a scripting language, all built on top of the power of C. There are tradeoffs to this (Objective-C tends to be slightly slower than C++), but for me, the benefits far outweigh the costs.

  1. funwithobjc posted this
Short URL for this post: http://tmblr.co/Zt522y2q84oa
blog comments powered by Disqus