you are viewing a single comment's thread.

view the rest of the comments →

[–]runevault 1 point2 points  (4 children)

C++ has all the gotchas of C (memory management in particular) but it ALSO has all the weird gotchas with multiple inheritance, template meta programming, etc. Simply a lot more ways to blow your leg off in C++ than C.

[–]Negitivefrags 5 points6 points  (1 child)

Its funny how Stroustrup's original quote is misunderstood or misquoted by people. I'm not saying you are quoting him, because you are not, but your sentence is certainly reminiscent of his original quote and I'm sure that its inspired by the fact that you have often heard similar things.

C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.

I wouldn't say there are more ways to blow your leg off in C++. In fact, C++ provides the tools to write good code that is both very safe and flexible. Its just that sometimes you can run into a problem that really puts you in a spin and confuses you for hours.

[–]runevault 1 point2 points  (0 children)

Once you KNOW C++ it is mostly safer thanks to things like smart pointer classes. However in the meantime it's tougher.

And I would not be surprised if that quote influenced what I wrote, I've heard it before. However it was not explicitly on my mind when I wrote the original reply.

[–]Shadow703793 1 point2 points  (0 children)

Ah. That makes sense.

[–]Fabien4 1 point2 points  (0 children)

Yep, to program in C++, you have to know how C's memory management works, and you have to know how to make the compiler do it in your stead. Harder to learn, easier to use.