We use C++ at Google and have managed to have many thousands of engineers working on the same codebase for many years without letting it go to hell. Here are the methods we’ve used to accomplish this:
company-wide language style guidelines that strictly prohibit usage of certain C++ features;
a readability process to ensure that new engineers must get their code reviewed by veterans before committing;
static linters that run automatically when a change is sent out for review;
tools to automate large-scale code changes when we decide to adopt new features that clean up code.
“Avoid virtual method calls in constructors, and avoid initialization that can fail if you can’t signal an error.”
“Do not define implicit conversions. Use the explicit keyword for conversion operators and single-argument constructors.”
Personally, I find all of these to be features which are a bad idea to begin with, from a maintainability and debuggability perspective. I’ve never wanted to do anything clever that I couldn’t find some other way to do.
I saw a talk by Jess Bezos where he said one reason amazon could keep growing is the core vision was something that would never go out of style (low cost, lots of choice, and fast delivery).
It made me compare the core features of some languages:
C: Control, performance.
C++: OO and performance.
Erlang: Reliability and uptime.
Rust: Safety and performance.
Of all of those, OO is what can (and is imo) going out of style.
We use C++ at Google and have managed to have many thousands of engineers working on the same codebase for many years without letting it go to hell. Here are the methods we’ve used to accomplish this:
So it’s certainly possible but not easy.
I’m curious - which features are forbidden?
I haven’t used C++ at Google in ~4 years so I couldn’t tell you off the top of my head but the guide itself it publicly available at https://google.github.io/styleguide/cppguide.html
I’m aware of that document - I was hoping for some additional info ;)
For example (from the style guide):
Personally, I find all of these to be features which are a bad idea to begin with, from a maintainability and debuggability perspective. I’ve never wanted to do anything clever that I couldn’t find some other way to do.
I saw a talk by Jess Bezos where he said one reason amazon could keep growing is the core vision was something that would never go out of style (low cost, lots of choice, and fast delivery).
It made me compare the core features of some languages:
Of all of those, OO is what can (and is imo) going out of style.