4 ms·
Not that it's an invalid position, but when Apple-centric developers proclaim 'ObjC > C++' in such a matter-of-fact way, I always wonder how much that is based
by frou_dh 15y ago
Not that it's an invalid position, but when Apple-centric developers proclaim 'ObjC > C++' in such a matter-of-fact way, I always wonder how much that is based on actual real-world experience.
- mistercow 15y agoWell see part of the problem is that it takes more experience to know your way around C++; it's just bigger than Objective-C, even if you only talk about the "commonly used" parts. If you know C and are reasonably familiar with OO, you can easily learn all of the important differences between C and Objective-C in a week or so. And since it's a true superset, everything you know from C carries over. C++ is just more complicated to learn the ropes of. So I guess what I'm saying is that a lot of people criticizing C++ probably don't have much experience with it, but that's kind of the point.
- deleted 15y ago[deleted]
- Derbasti 15y agoExactly. 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.