Linked by David Adams on Sat 11th Oct 2008 16:48 UTC, submitted by IndigoJo
Thread beginning with comment 333349
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[4]: Before you get rid of C++ ....
by aesiamun on Sat 11th Oct 2008 23:19
in reply to "RE[3]: Before you get rid of C++ ...."
RE[5]: Before you get rid of C++ ....
by luzr on Sat 11th Oct 2008 23:23
in reply to "RE[4]: Before you get rid of C++ ...."
OK, but that applies to about any language
Anyway, if there is any feature that is really *unique* to C++, it is destructor.
It is extremely useful and not present in any other language (AFAIK).
I guess destructors are the real reason why I prefer C++
Particulary, there is nothing similar in Objective-C.
Edited 2008-10-11 23:24 UTC
RE[5]: Before you get rid of C++ ....
by danieldk on Sun 12th Oct 2008 07:47
in reply to "RE[4]: Before you get rid of C++ ...."
The original request was to get something that you could do everything possible with C++ and still be C compatible.
I delivered
I delivered
Absolutely not. One of the core foundation of modern C++ programming is generic programming. And in C++ this is not implemented through type erasure, instantiation of templates actually lead to new types. Combined with specialization, this also offers metaprogramming, which can be used for doing everything from compile-time optimizations to creating domain-specific languages (e.g. see Boost Spirit).
The Standard Template Library (STL) is built on C++ templates. It provides generic containers and algorithms. Where many other languages add e.g. sort algorithms to list classes (which is not really a reusable approach), STL provides generic algorithms for every container that provides iterators.
So, two of the most important aspects of modern C++, templates and STL are missing in Objective. So, it's not really a substitute. The only thing that probably comes close is D.
RE[4]: Before you get rid of C++ ....
by werpu on Mon 13th Oct 2008 10:36
in reply to "RE[3]: Before you get rid of C++ ...."
Objective-C does not have too much common with C++ design goals.
Objective-C just adds a bit of smalltalk syntax over C. Whereas C++ extends C syntax while keeping low-level efficiency.
BTW, note that there is Objective-C++ too
Objective-C just adds a bit of smalltalk syntax over C. Whereas C++ extends C syntax while keeping low-level efficiency.
BTW, note that there is Objective-C++ too
Well there are two different design principles. Objective-C followed the keep it simple principle while C++ followed the, lets take every feature there is on earth and press it into the language approach. The problem is, that the keep it simple approach always is superior. Java could have never taken off if not a huge number of projects simply failed on C++s inherent complexity! Java sort Next was able to pull of a decent component based system in time with ObjectiveC while most others had inherent delays (COM etc...) or failed entirely in their first incarnations (Project Pink from Apple and IBM) is a clear sign of the overcomplexity of the design. The funny thing is that the better C++ based systems basically follow the keep it simple principle and omit a huge load of the language to reduce themselves down to the sane core!
RE[5]: Before you get rid of C++ ....
by luzr on Mon 13th Oct 2008 10:59
in reply to "RE[4]: Before you get rid of C++ ...."
Objective-C followed the keep it simple principle while C++ followed the, lets take every feature there is on earth and press it into the language approach.
Yeah, right. I just fail to see what all of these "every feature in the world" are...
E.g. compared to Java, I only see that C++ supports operator overloading and multiple inheritance from regular classed (you can inherit from multiple interfaces in Java though).
Do not even start speaking about C#, it has many many more of "every feature in the world" in it.
Now considering Objective-C, C++ introduces class as extension to C based struct, while Objective-C introduces wholy new runtime concept. Now of course, Objective-C approach has its advantages, but if you are about to decide what approach is simpler, extending existing C feature has to win...
RE[5]: Before you get rid of C++ ....
by michi on Mon 13th Oct 2008 13:57
in reply to "RE[4]: Before you get rid of C++ ...."
Well there are two different design principles. Objective-C followed the keep it simple principle while C++ followed the, lets take every feature there is on earth and press it into the language approach.
Objective-C may be simpler then C++, but it is also way more limited then C++. For example it is impossible to write a efficient vector class in Objective-C. In C++ you would to something like:
public class Vector
{
public:
Vector(double x, double y, double z);
Vector operator+(Vector v);
double operator*(Vector v);
...
}
In Objective-C it is just not possible to write light-wight classes. Every method invocation is a hashtable lookup. You can of course use C-structs but in my opinion this is also suboptimal.
Objective-C also does not offer operator overloading and templates which are quite useful for numeric stuff, just think about matrix multiplication.
In my opinion the scope of Objective-C is much more limited then C++, but for some things it might be the better language.







Member since:
2005-11-20
Objective-C does not have too much common with C++ design goals.

Objective-C just adds a bit of smalltalk syntax over C. Whereas C++ extends C syntax while keeping low-level efficiency.
BTW, note that there is Objective-C++ too