Since this is a C++ forum I thought it'd be nice to discuss what we all love about the language.
My favourite thing about C++ is messing around with low level data, really getting down with the bits and bytes and having direct access to specific memory locations. Also, its flexibility. You can do almost anything with C++ and although it may not be the best language for a specific task it is a capable language for almost any task you can think of.
C++ lacks the kind of "black box" features of other languages that one needs to simply blindly accept and put all faith into. With C++ you know exactly what's going on and you know that you can rely on it. It's also never screwed me out of 6 months of coding a certain project like some other language has. :)
My least favorite thing is the devastatingly huge range of different coding styles and conventions. :\
Static typing. No really, dynamic typing is ok if you write your own programs, but it's a huge pain in the butt when trying to read the source code of others.
1. The ability to write user defined types that look like and interact with built in types seamlessly.
2. The light touch approach to generics (templates) that have made them more flexible that the designers envisaged.
3. Static type checking on objects.
4. Low level control and efficiency of C.
I like the controlled approach to the low level access. That is it allows you to work with each bit and or byte in your application without actually having to deal with processor or other hardware specific instructions like you would in Assembly. At the same time it allows you to do all of this in an OO fashion.
I like that it doesn't need a framework like Java or .Net and if it's done right it works on just about everything.
I like how work that I do today can be integrated into work that I do next week or even next year without having to Copy\Paste or any of that crap. Simply include the header and poof, I have all of that stuff done already.
Speed of execution. This is often over looked because systems today are years ahead of what software needs but this is so vital to me especially when I have to work on hardware that is getting to the end of it's life cycle.
Speed of execution is a bit exagerrated for C++ though - you CAN create fast programs with C++, but the average C++ program usually isn't significantly faster than its java counterpart for instance.
I probably don't know enough languages to really be able to compare, but I like how it can be used to program virtually anything using any paradigm you want.
Speed of execution is a bit exagerrated for C++ though - you CAN create fast programs with C++, but the average C++ program usually isn't significantly faster than its java counterpart for instance.
Speed of execution is a bit exagerrated for C++ though
I disagree. Newer versions of Java can rival C/C++, but it's probably one of the only languages that can, except for assembly of course. If you look at stats comparing C++ to other languages, it almost always wins. In C++ you can often code a grossly uneffiecient algorithm and still beat other languages that are using an optimal algorithm.
In order to see the difference in speed of execution between C++ and Java for instance you need to see it on dated hardware, or else get the PC you're using to be preoccupied with something intense like a burn in test or a fork bomb that saturates the CPU cores. Like I said because the hardware now a days is so much faster then most software can reasonably demand, it's usually outside of our ability to notice the difference. But trust me it's there.
Lisp and Java have made a lot of progress and today they're not so much slower than C and C++. But it's no exageration that C++ is usually faster, sometimes very significantly. See the table here: http://norvig.com/python-lisp.html
The performance differences between Java and C++ are not any greater than differences between various C++ compilers. It is just a matter of optimisations the compiler can do. Some things are faster in Java (dynamic allocation, virtual calls and thread locks), some are faster in C++ (templates).
It is often easy to create a 100-line benchmark showing C++ faster than Java - by just avoiding things that are slow in C++: heap allocation, locking, iostream, exceptions or dynamic dispatch. However, it is hell difficult to not use them in a "real" size application, so for such applications Java and C++ are really very close to each other.
BTW: Our not-yet-totally-optimised analog simulator engine running on JVM is 3x faster than Berkeley Spice written in C. If Java were so slow, how would it be possible? Do you really believe they write unoptimal C code there at Berkeley?
The thing I like most is that it is a programming language. When it is the most appropriate language to use, it is great...
Sorry but, to me, this kind of question is like asking a cabinet maker what he likes most about his chisel and C++ Vs Java is akin to what chisel is better a bevel edge chisel or a Oire Nomi.
Today I was discussing with a colleague on how to implement a sparse matrix (and gaussian elimination on sparse matrices), so that your code works with arbitrary coefficients (be it rational numbers, complex numbers, doubles, etc.).
And guess what the answer is!
Templates!
My colleague is using C#, and guess what ... C# has templates (inspired guess by which language...)! (There, they call them generics; they have a bit simplified syntax which is good).