1. 16

  2. 3

    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:

    1. company-wide language style guidelines that strictly prohibit usage of certain C++ features;
    2. a readability process to ensure that new engineers must get their code reviewed by veterans before committing;
    3. static linters that run automatically when a change is sent out for review;
    4. tools to automate large-scale code changes when we decide to adopt new features that clean up code.

    So it’s certainly possible but not easy.

    1. 2

      I’m curious - which features are forbidden?

      1. 2

        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

        1. 1

          I’m aware of that document - I was hoping for some additional info ;)

          1. 2

            For example (from the style guide):

            • “Do not use inline namespaces.”
            • “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.

    2. 2

      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.