Google C++ Style Guide
Page |
1 |
Some nice reading on the “style” of C++ code at Google open source projects: The Google C++ Style Guide [google-styleguide.googlecode.com]
It has some good technical explanations for various style rules. Others are clearly more a matter of taste type of rules, and are arguable – as always in this sujet :-)
Nontheless, enjoy reading!
19 replies
I think the Google style guide documents the exact mistake a lot of companies make when they are prescribing the style this specifically. Programmers are usually free form thinkers. Putting a too rigid harness on that free form thinking lets developers focus on form rather than on functionality, and frankly, I’d rather have a bit of functionality. If you want to restrict coding rigidly to a certain standard, use a language that isn’t as free form as C++.
Volker, thanks for sharing! It is always good to know how leading companies work.
Personally, I really like the Qt convention that class names start with a capital, and method names with a lower case letter. That is different in the Google conventions.
Yes it is really nice, although I have to admit that I am still getting used to it :)
I think the Google style guide documents the exact mistake a lot of companies make when they are prescribing the style this specifically. Programmers are usually free form thinkers. Putting a too rigid harness on that free form thinking lets developers focus on form rather than on functionality, and frankly, I’d rather have a bit of functionality. If you want to restrict coding rigidly to a certain standard, use a language that isn’t as free form as C++.
+1 :) Bull’s eye! :)
I prefer Unix or BSD style, it’s not so strict as Google has…
Joke:
But the best thing that they wrote, was: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=C++0x#C++0x
“ Decision: Use only C++0x libraries and language features that have been approved for use. Currently, no such features are approved. Features will be approved individually as appropriate.”
How can I use C++0x (as it Google said), if there is just specification out?? Think smarter and you’ll get nonsense of using this Google Style :D
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Inline_Functions
Does Qt encourage inline functions inside the library which can be called from user code ? I guess it could cause binary incompatibilities if definition of inline function changes between library versions.
You must log in to post a reply. Not a member yet? Register here!






