Hacker News new | ask | show | jobs
by pjmlp 4510 days ago
One of the reasons C++ gets bad reputation, is those Cisms that people insist on writing, when the language offers much better alternatives.
1 comments

Which is mostly due to lack of education. If you don't ever spent time learning, but just coding, you don't know better. And sometimes it's all too easy to get thrapped into it due to deadlines and whatnot. A former collegue of mine, unfortunately, was the best example: programmed for like 15 years years and still wrote like it was all 'C with classes' (not that there ever was such a thing). You know, writing declarations at the top of functions etc. Missing out on C++11 is just as bad.
Fully agree.

Personally I never liked straight C.

For me it was just a short transition between Turbo Pascal and C++, only to be used when required to do so. Around 1993 or so.

I devoured every book and publication about C++ I could put my hands on. Always trying to educate others how to write safe and portable C++.

Nowadays I am into JVM and .NET mostly, but when I reach for C++ it is with regard to the latest standards.

Every now and then, I still see C++ code that is basically the C subset without using any improvements of C++ over C.

C with classes is what the google c++ style guide mandates: http://google-styleguide.googlecode.com/svn/trunk/cppguide.x...

No exceptions, no boost, no lambda, no rtti, streams only for logging, avoid operator overloading, etc.

The Google C++ style guide has its quirks, but describing it as "C with classes" is flat out wrong.

> no boost

Not true, select parts of Boost are available.

> no lambda

The C++11 features are being rolled in gradually. Lambda expressions are now permitted.

> no rtti

The guide says "avoid RTTI" and urges the developer to come up with a different design. This is very much in line with C++ best practice overall. There's no ban on RTTI.

Version 3.274 says:

Do not use lambda expressions, or the related std::function or std::bind utilities.

It's unfortunately not synched with the internal version.
I don't agree with Google's style guide, besides they are not perfect.
There is no reason to code in 2014 as if CFront was just released today.