On Thursday, 30 October 2014 at 05:01:27 UTC, H. S. Teoh via Digitalmars-d wrote:
templates and metaprogramming completely. I was skimming over Google's C++ style guide today, for example, and was shocked to discover that they discourage the use of templates and frown on metaprogramming, among other shocking things (like prohibiting exceptions, using 2-space
indentation, and other "interesting" things [1]).

The Google cppcon presentation was pretty clear on this, e.g.:

1. The code should be easy to understand at the call site for a non-expert. No need to look up the docs. They don't care if code is tedious to write, because reading is more important and frequent.

2. Exceptions hide error_handling, so they have their own status class that force error-handling or explicit "ignore()" to make code review easier. C++ exceptions also come with a performance penalty.

3. No non-const ref parameters to functions, use pointers. They want a visible "&" at call site for output parameters. e.g. "read(&var)" so that you don't have to look the function up in the docs.

4. They use clang with C++11 and standard libraries.

5. Formatting debates are not interesting. Use automatic clang formatting, it is better than most programmers anyway.

Reply via email to