As someone who likes C++ for its expressiveness and power, and who wrote C++ before he wrote C, and OO code before he wrote procedural code, I tried very hard to disagree with you... but...
... dammit, you're right. And I don't just say that because I'm working in the very small subset of code that pretty much *must* be implemented in C for reasons unrelated to efficiency. (You're also working in that subset, which is probably why we agree on this point.)
You *can* write C++ that avoids the traps you describe (and with C++11, it gets easier) -- but you do need to be an expert to do it, everyone who works on the project needs to be an expert too, and you need to avoid almost every piece of example code that exists out there on the Internet as well. Which means that hardly anyone writes good C++. (By comparison, a far higher percentage of C developers can write good C, though the percentage is still small and it still takes the usual time for any human field of roughly ten years to become anything close to expert.)
Posted Jul 3, 2012 15:10 UTC (Tue) by dashesy (subscriber, #74652)
[Link]
everyone who works on the project needs to be an expert too
And everyone who will be working on the project! Forever without a gap, if there is one person in between that does not know most of those traps, it soon becomes unreadable and hard to understand and debug (the worst that can happen to a project). Specially the corner cases (that C++11 promises to solve with first class language idioms) tend to accumulate more cruft. I really appreciate that kernel, and what landley is doing is using C. Whenever code beauty matters (and not time to market), if code does not work it should be replaced, not sub-classed.