Live data from Hacker News

The Dark Side of C++ [pdf]

miek.nl

1–10 of 33 posts

Re: The Dark Side of C++ [pdf]

#6
Most of the problems mentioned there don't apply to the regular C++ coder in his daily life, many of the mentioned problems are even non-existant if you stick to the encouraged coding styles of modern and real OOP C++.

In practice just the template error messages suck as hell. I'd really like something nicer there, but in practice you actually survive those messages without too much wasting of time. You just ignore the error message and rather look at the line of code mentioned and then you usually find the problem rather fast by just looking at the line.

rgds, René

Re: The Dark Side of C++ [pdf]

#7
The Dark Side of C++ is that everyone is an opinionated expert. C can be abused in a similar manner. The output of cpp is notoriously hard to read, especially if all newlines are removed :) But this is implied and understood by your average C programmer and therefore it is simply not worth discussing.

Re: The Dark Side of C++ [pdf]

#8
The "hard to read part" is not very honest. You can so similar slides for a awful lot of languages, I'm not sure I see the point. C macros, for one, introduce similar issues.

The "C++ makes auditing painful" is just flat out wrong. Any decent IDE alleviates the trivial ambiguities given as an example (references...). Auditing isn't done in just reading the code when reaching a certain size, anyway, so I'm not sure where the author wants to go.

Additionally, a properly written program is consistent, and that's true for any language. If the program you audit is inconsistent, I can feel your pain, but don't blame C++ for it.

I also don't understand what "too powerful" means. Power is relative, that C++ is too powerful for many tasks is an obvious statement but saying that it's just "too powerful full stop" is a bit silly, isn't it?

Re: The Dark Side of C++ [pdf]

#9

Most of the problems mentioned there don't apply to the regular C++ coder in his daily life, many of the mentioned problems are even non-existant if you stick to the encouraged coding styles of modern and real OOP C++. In practice just the template error messages suck as hell. I'd really like something nicer there, but in practice you actually survive those messages without too much wasting of time. You just ignore t…

It's a compiler problem and clang is an attempt at solving it.
Post reply on HN