Hacker News new | ask | show | jobs
by to3m 5246 days ago
I'd like to upvote twice, but it wouldn't let me.

So it's cruel, but I usually secretly assume that people who keenly advocate C++ are just poseurs.

Anybody who has actually gone through the whole process of making a program in C++ and fixing enough of the bugs in it that somebody can put it in a box and sell it in the shops, is appropriately circumspect in their recommendations, because they know just how appallingly awful it can get.

So awful, that you'd give up on exceptions, DLLs, new & delete, templates, STL, auto-registering static globals, and all that kind of stuff - because it's actually EASIER to give up all those time-saving modern conveniences, than it is to pick up the pieces after they've been overused.

But nobody believes it until it's happened to them. It just sounds too implausible...

1 comments

Amen! There are good reasons why Google's [1] and Mozilla's [2] C++ style guides frown on C++ features like exceptions, RTTI, iostreams, and static objects.

I read an anecdote that Bill Joy has a "copy of Bjarne Stroustrup's The C++ Programming Language in which he's highlighted all the sections that Java programmers don't need to concern themselves with." I wonder what a C++-compatible subset language would look like if someone just deleted code from a C++ grammar. Rather than writing style guides and lint scripts, just whittle down a C++ compiler's front-end. :)

[1] https://google-styleguide.googlecode.com/svn/trunk/cppguide....

[2] https://developer.mozilla.org/index.php?title=en/C%2B%2B_Por...