bearophile wrote:
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".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.xmlAt 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.
Jerome
--
mailto:[email protected]
http://jeberger.free.fr
Jabber: [email protected]
signature.asc
Description: OpenPGP digital signature
