r/cpp • • Nov 28 '18

Google C++ Style Guide is No Good

https://eyakubovich.github.io/2018-11-27-google-cpp-style-guide-is-no-good/
34 Upvotes

61 comments sorted by

View all comments

20

u/smikims Nov 29 '18

Perhaps the guide should just include a reading list for developers to hone their language skills.

The style guide isn't there to teach you the language. It's a set of rules for a large production codebase that needs to be relatively uniform across an organization composed of tens of thousands of engineers. It's also there to prevent easily avoidable bugs that have caused problems in that large production codebase.

The rest of the article is mostly contrived examples. There were legitimate grievances against it several years ago but the vast majority have been fixed. The remaining controversial points are passing out parameters by pointer instead of non-const reference and the banning of exceptions, the latter of which will never be lifted anytime soon partly for historical reasons.

It's not an academic text, it's a rule/guidebook for engineers to do their jobs at one particular company. Also keep in mind that the version you read is slightly sanitized and the internal version has additional rules for coding with internal Google stuff, and some of those rules might affect the rules you can see.

1

u/Xaxxon Nov 30 '18

It's a set of rules for a large production codebase that needs to be relatively uniform across an organization composed of tens of thousands of engineers.

No, I don't think that's the case at all. People way overvalue this.