4 ms·
No, it couldn't actually. 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 refl
by PopsiclePete 12y ago
No, it couldn't actually.
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.
- pjmlp 12y ago> something that is close to impossible in a super-static language like C++, which eschews most of those features. 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...
- PopsiclePete 12y ago>I wonder what all those reflection libraries are about.... 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.