3 ms·
What do you mean by style? Whitespace and casing in names, chunks of the standard to use or not (unique_ptr, mutable refs as function arguments, auto), interfac
by saulrh 8y ago
What do you mean by style? Whitespace and casing in names, chunks of the standard to use or not (unique_ptr, mutable refs as function arguments, auto), interface design paradigms (RAII, exceptions vs error codes, composition vs. inheritance)? It doesn't really change my answer (the Google style guide), but the reasons are somewhat different in each case. I choose Google's formatting basically because it meshes with the feature-set they recommend and their interface design philosophy. I choose the feature-set they recommend because their guide's coverage and reasoning are more comprehensive than those of comparable guides I've seen. I choose their interface design philosophy because it meshes with the feature-set and is better than trying to figure it out myself.
(I do work at google and got the "writes idiomatic c++" certification, but I'm writing the above from the perspective of the (very tiny amount of) c++ I write for personal projects, including things I worked on before I got past their interviews to get hired.)