11 ms·
The OO parts of Objective-C will likely be slower than the OO parts of C++ in many cases. There are a few places where ObjC can help even the score on performan
by neverartful 11y ago
The OO parts of Objective-C will likely be slower than the OO parts of C++ in many cases. There are a few places where ObjC can help even the score on performance. Typically ObjC objects are not copied (cloned). Normal usage (within a collection, ivars, etc.) is with reference counting. Prior to C++11 (shared_ptr, unique_ptr, etc.), there wasn't a good way within the language itself to track object ownership without having to make object copies.
Since C++ and ObjC are both (essentially) supersets of C, you can always mix however much (or little) of plain C that you want. Everything about OO in ObjC is very dynamic. It allows you to do some very cool/flexible/unsafe/unwise things.
In my opinion, that where the tradeoffs start showing up. Flexibility, runtime speed, nice abstractions, development speed, code complexity, etc. Really difficult, if not impossible, to have them all at once.
Despite the unusual looking OO syntax of ObjC, overall it's a pretty simple language given the power it provides. Once you get acclimated to looking at its syntax, I'll even dare say that it's much easier to read and understand than many other languages.
- nickpsecurity 11y agoI appreciate the detailed reply. It seems like it's not a fit for my zero-overhead strategy but an interesting alternative to C++ for app development.