4 ms·
Exactly. C++ is simply way more complicated than Obj-C. Also, the Obj-C object system is pretty high level and dynamic (message passing, late binding, dynamic
by Derbasti 15y ago
Exactly. C++ is simply way more complicated than Obj-C.
Also, the Obj-C object system is pretty high level and dynamic (message passing, late binding, dynamic dispatch). This makes it somewhat slower at method calling, but at the same time a lot easier to work with.
The downside of being slow is usually mitigated by simply being able to drop back to plain old C if need be.
Of course, C++ can emulate all that, and without performance compromises, but at the expense of readability.
For the longest time, I would hands down prefer Obj-C to C++ just because it was simpler. The more experienced I become with C++, the more I am able to appreciate its power and no-compromise attitude, though.
- frou_dh 15y agoTo me, Y appearing repellently complicated means: "I like X. I'm not interested in Y." and not "X is better than Y." That's my point. I think it's a worthwhile distinction for developers.
- mistercow 15y agoThere is, of course, also Objective-C++. In my naïve younger days, I used that so I could have operator overloading in Objective-C. What a nightmare.
- stcredzero 15y agoC++ is simply way more complicated than Obj-C. Also, Obj-C is somewhat more complicated than Ruby, though there is a lot of Ruby if you go looking. Obj-C is also more syntactically noisy than Ruby.
- Derbasti 15y agohaving dabbled in a bit of Ruby metaprogramming, I can't say that it is particularly simple. Still, simple Ruby is simpler than simple Obj-C and certainly simpler than simple C++ (if indeed there is such a thing as simple C++).
- mistercow 15y agoDo you mean that Ruby code tends to be simpler than Objective-C code, or that the language itself is actually simpler. Because, while I haven't done a formal comparison or anything, I would find the latter to be pretty unlikely. Most of Objective-C can really be boiled down to little more than few teaspoons of syntax sugar on top of C (although that is less true today than it once was), and C is definitely a simpler language than Ruby.