Technical Article => Business => Google

In Google, most of the products are written in C++ and Java. They usually don't choose Python to write their product stack. What's behind the decision to choose one language over the other in Google? Let's get to read some opinions from Robert Love, a Google software engineer.

Love said he couldn't imagine writing let alone maintaining a large software stack in Python. They use C++, Go, and Java for production software systems, with Python employed for scripting, testing, and tooling.



There are a bunch of reasons for the primacy of C++ and Java:



Familiarity. Early Googlers were well-versed in C++.

Performance. Java can be faster than Python; C++ can be faster than Java.

Tooling. Tools for debugging, profiling, and so on are significantly better for Java than Python. Even C++ is easier to debug and understand in large systems.

Concurrency. As you can imagine, Google systems are highly parallelized and many are highly threaded. Threading in Python is an unmitigated disaster. The global interpreter lock (GIL) is a giant pain in the ass.

Lack of need for the prototyping prowess of Python. One commonly-cited strength of Python is that it is easier to rapidly prototype small systems in Python than Java and (to an even greater extent) C++. At Google, however, this benefit isn't all that appealing: We have a lot of powerful frameworks that make prototyping or extending existing systems easy. Folks tend to prototype by gluing a hack into an existing server rather than build an entirely new distributed system.

Finally, he said "In the war of Perl versus Python, I come down on the side of Python. But I would never use it to build a production, scalable, mission critical, performant system—particularly one someone else may need to understand some day long in the future."

Also Python and Java had some different design goals.



Python is a language that is optimized for readability and rapid development. It's very well suited to the more entrepreneurial groups that are looking for product/market fit because iteration is quicker with a less verbose, less restrictive languages.



Usually we use Python for most of the product both front end and back end but C++ and/or Java where there is a performance bottleneck. This lets us benefit from the speed of development with Python and speed of execution of code with Java. Google seems to use them in similar capacities.

So the final suggestion is the language to be used depends on the requirement of the product, sometimes even in the same product we may use different languages.