Daniel said:
.. and your point is misplaced because it is largely not the ability to
perform "pointer tricks" that makes C++ more flexible or more powerful.
Yes, being able to manipulate machine addresses through pointers may
make C++ a suitable choice for very low level code (firmware, drivers,
etc.)
Hm, why ? Singularity / Cosmos are operating systems in C#. The
MicroFramework targets embedded devices.
-- but on most modern architectures (with
hardware memory management and address remapping) C++'s addresses don't
correspond to meaningful physical memory addresses anyway.
No, pointer manipulation is not what we're discussing, here.
O.k. pointer manipulation is the main task of C ;-).
[...]
There's nothing obscure about TMP. It's what makes the C++ standard
Hm, which C++ standard library is using meta templates ? IIRC Tr1 will
use them, boost library uses them but the STL ?
library so hugely powerful, it's what makes some of the amazingly useful
Which powerful standard library in C++ can I use for file operations ?
libraries in, for example, Boost possible.
Boost is a good, cool library - sure. But these libraries get somewhat
bloated, because of all the template stuff and compilation slows down
more and more.
And for example I dare to say that boost::function has a higher
overhead, than C# delegates.
Modern C++ code is built on
templates and it makes the language hugely more powerful than a
I thought it to be so too. I have implemented discriminated unions, used
type lists as they are in Loki for example and all the nice stuff.
What I got was unreadable, hard to debug and bloated code which needed a
very long time to compile.
The one compiler emitted code with a size of 3MB, the other one compiled
the same sources to 6MB.
After I had replaced all the TMP stuff by generated code the code size
could be reduced to 1MB.
classical OOP language like C# or Java could ever hope to be. Even if a
C++ programmer never writes a single template in his whole life he has
all the power of those libraries to draw upon.
Could you give me an example (part of a library), which is more powerful.
C++ is based on C, but is not a simple replacement. The syntax of C++ is
almost a proper superset of that of C (i.e. most, but not all C source
will compile correctly if fed through a C++ compiler) with new semantics
and new functionality that represent an evolutionary increase in
flexibility and power.
But C++ inherited the worst from C - macros.
C# is based on Java. It has a slightly different syntax and a different
set of runtime APIs, but it is semantically very similar -- a little
better, because some of the mistakes of Java were not repeated, but
largely similar. Where is the evolutionary advance here? Nowhere.
- LINQ
- Delegates
- Library, which isn't bound to a single language
- Lambda expressions
- Implicit typed variables
- and many more
C++ will get some of these too, but then the argument that C++ hasn't
invented these could be used too.
Hm, I once was a die hard C++ developer and argued the same way. But
today I'm not that sure about C++ and it's future.
I would prefer >every time< a native C# or would prefer the 'D'
language, if it would be better supported by most of the commercial
developer tools and could (directly) compile (old) C++ code.
Have you used another language than C++ too, to make a good comparison ?
I don't want to start a language war - better said continue one. But I
too think the evolution of C++ is currently too slow and heading in the
wrong direction, since modules in C++ are still delayed. If I compare
what abstraction level I can reach for example with F# and how I'm still
able to use my C# code easily, I don't think that C++ is still the
Cheers,
Andre