Linked by David Adams on Sat 11th Oct 2008 16:48 UTC, submitted by IndigoJo
Thread beginning with comment 333350
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[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[6]: Before you get rid of C++ ....
by aesiamun on Sat 11th Oct 2008 23:33
in reply to "RE[5]: Before you get rid of C++ ...."
OK, but that applies to about any language
C compatible? Since when can I take my c code and just run it through the perl interpreter? Python interpreter? Java compiler?
I can do that with my objective-c compiler.
Anyway, if there is any feature that is really *unique* to C++, it is destructor.
You're right there. I don't rely on that often at all, though.
Edited 2008-10-11 23:34 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[6]: Before you get rid of C++ ....
by luzr on Sun 12th Oct 2008 14:35
in reply to "RE[5]: Before you get rid of C++ ...."
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.
To be fair, you CANNOT use std::sort for every container that provides iterators - only for those that provide *random access* iterators.
In fact, I believe that the whole idea of 'generic' algorithms that apply to anything is somewhat moot - the only useful algorithms are those dealing with random access containers. And within those, only sorts and bounds are really important (about 5 total).
In fact, if you would just glue those as std::vector, std::deque methods, you would lose only a little...
While I really like C++, I am not huge believer into STL. IMO, Stepanov nearly killed the language...
RE[6]: Before you get rid of C++ ....
by tyrione on Sun 12th Oct 2008 21:58
in reply to "RE[5]: Before you get rid of C++ ...."






Member since:
2005-06-29
The original request was to get something that you could do everything possible with C++ and still be C compatible.

I delivered