Google C++ style guide

"Jérôme M. Berger" jeberger at free.fr
Sun Oct 4 13:50:48 PDT 2009


bearophile wrote:
> I have found this page linked from Reddit (click "Toggle all summaries" at the top to read the full page):
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
> 
> At Google C++ isn't the most used language, so it may be better to use a C++ style guide from a firm that uses C++ more than Google. On the other hand Google has hired many good programmers, and probably some of them have strong C++ experience, so if you are interested in C++/D this style guide deserves to be read.
> 
> This guide is mostly (as it often happens with C++) a list of features that are forbidden, I think usually to reduce the total bug count of the programs. Some of such imposed limits make me a little nervous, so I'd like to remove/relax some of those limits, but I am ignorant regarding C++, while the people that have written this document are expert, so their judgement has weight.
> 
> They forbid several features that are present in D too. Does it means D has to drop such features (or make them less "natural", so the syntax discourages their use)?
> 
> Here are few things from that document that I think are somehow interesting. Some of those things may be added to D style guide, or they may even suggest changes in the language itself.
> 
> -------------------
> 
>> Function Parameter Ordering: When defining a function, parameter order is: inputs, then outputs.<
> 
> D may even enforce this, allowing "out" only after "in" arguments.
> 
	I actually use the inverse convention: "out" arguments come first. 
This way, it is easy to see that "a = b" and "assign (a, b)" modify 
"a" and not "b".

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20091004/bdd2ea37/attachment.pgp>


More information about the Digitalmars-d mailing list