Right now I am using Google C++ Style Guide in my C++ code and I was pretty happ
ID: 655046 • Letter: R
Question
Right now I am using Google C++ Style Guide in my C++ code and I was pretty happy with it.
Recently I was told that this guide is very bad: it is used internally by Google (I knew that), is outdated, and promotes some very bad practices. So I want to use another coding style.
What good and fairly used C++ style guides are there? I write code for both gcc and Visual Studio, and I use a lot of the C++11 features.
What I liked very much about Google C++ Style Guide was the indentation, the whitespace and the naming conventions (specially naming all classes, types - including typedefs, type aliases and template aliases - with capital first letter).
I know any answer is subjective (I hope this is ok on this site) and I would appreciate any opinion, but I am interested which guides are used these days.
Explanation / Answer
You can use the guideline from this book for general usage:
amazon.com/Coding-Standards-Rules-Guidelines-Practices/dp/0321113586
from Herb Sutter and Andrei Alexandrescu. It does not take into account C++11 though, but I think there will be a new edition.
But it will not answer about number of space instead of tabs or what kind of esoteric notation you want to enforce. But these are not the most important thing, most of the time just to have some consistency is the key.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.