The tools developers use have a big impact on the resulting software and so it's crazy to think where we'd be if Obj-C hadn't been created and hadn't enabled the iPhone etc.
The tools developers use have a big impact on the resulting software and so it's crazy to think where we'd be if Obj-C hadn't been created and hadn't enabled the iPhone etc.
There are plenty of efficient systems languages out there...
A key aspect of Apple's NS* and UI* frameworks are various patterns that rely on dynamic dispatch (via 'id') as well as run-time reflection and discovery, something that is close to impossible in a super-static language like C++, which eschews most of those features.
C++ puts performance above all else, Obj-C values productivity as well.
As someone who likes C/Obj-C but absolutely despises C++ and everything to do with it, I count my blessings that Apple didn't choose the C++ route.
I wonder what all those reflection libraries are about....
> As someone who likes C/Obj-C but absolutely despises C++ and everything to do with it, I count my blessings that Apple didn't choose the C++ route.
I hope you never get to write Mac OS X drivers then...
Libraries exist for everything under the sun for C++. Doesn't mean anything. C++ always prefers static dispatch vs dynamic. It's in every single C++ book/article ever written. C++'s RTTI system is extremely gimped and pahetic, exactly for that reason - it's a "limited, rarely-to-be-used" functionality by design.
In Ojb-C, it's opposite. Asking an object what methods it has at runtime, is a very common pattern. Something at which the seasoned C++ programmer screeches in horror and hides in the corner.
>I hope you never get to write Mac OS X drivers then...
Completely irrelevant. Of course drivers are written in C/C++ (a limited sub-set of C++). How many people write OS X drivers? Are you even listening to yourself? 99% of people do not write drivers, they write user-land applications, and the lingua franca for OSX/IOS is Obj-C.
You fail to prove any points. Try harder next time.
IMO these features made it more productive than C++ or Pascal for developing GUI-based applications.
The whole point is moot though, because Swift is the future. It's quite amusing seeing the Objective-C community trying to reconcile their irrational love of the language with the reality that Apple communicated - it's a disadvantage for the platform, keeping developers away with its unusual syntax, lack of safety and overcomplicated paradigms.
Late binding is deciding at runtime the real implementation of a method to be called, which in C++ is done at via virtual method calls.
What you are describing is actually an example dynamic types and reflection.
In C++'s case, there are plenty of reflection libraries to choose from.