Comment by pclmulqdq
1 year ago
Outside of the ML groups, Google really doesn't like Python and there's very little of it in the codebase. This move isn't surprising in that light.
Also, Google is IBM at this point, so I would expect a lot of IBM-like moves.
Former googler. It's very team dependent. My first team was 100% c++, I moved to a sub team that was 100% python. There's a lot of it around
Very little at the scale of this codebase is still a lot.
From where I sit (SRE), I see a lot of Python which is very much mission critical.
is it really Python though ?
yes, SRE uses loads of python, despite a decade+ pseudo-mandate to encourage Go
4 replies →
Well over 100m lines of Python as has been publicly stated several times over the years is not "very little".
In a codebase of 13+ trillion lines it's very little.
Google has published that it is at about 2 billion LoC not including experiments and scratch use. I don't know if the 100 million lines of Python includes experiments. Also, if the number is old, there is a chance that the number of lines of Python has actually gone down over the years due to the (soft) mandate to stop using it.
Correction, outside of the ML groups and anything related to CI/infra. Especially if you remember that Starlark[0] is a dialect of Python.
And that’s without going into all the outside-of-g3 code (of which there is a metric ton, especially if you worked with any teams that deal with hardware or third-party/acquisition stuff).
0. https://github.com/bazelbuild/starlark
Starlark is not Python. It feels like Python when you write it, but it's very different in a lot of ways that really matter.
A lot of people don't realize that the issues that python haters (myself included) have aren't generally about the look and feel of the language, but about how many sharp edges the language has for maintenance and scaling. Python 4 could fix all of these things if they ever did it.
I agree with you on this, but just saying, there is plenty of actual python (not starlark) at Google, all over the most crucial places (which a lot of people who haven’t touched those don’t even realize exist).
Personal example - the fleet of hardware prototypes (that I used to work on) used for hardware-in-the-loop testing (basically the hardware version of CI/CD) was pretty much reliant on python. Anything that was compact enough to be accomplished by a script and generic enough (open this serial connection, write to that memory address, etc.), the de-facto default choice was almost always python.
But I fully agree with you otherwise, in a sense that I haven’t seen much of a gigantic python codebase consisting of a bunch of interconnected python modules, like you would see with other popular languages at Google (e.g., C++/Java/JS).
This is not true, for example the entire mobile test infrastructure is written in python.
>Outside of the ML groups
Google is also going all in on ML (or AI if you prefer).
They seem to support Python quite widely. There are a handful of languages that have an API for google cloud and the likes, Python is one of them
There’s a ton of python all over the place. You don’t know what you’re talking about.
maybe they plan to adopt mojo
Mojo developers will not be different from Python developers, also Mojo is still very unstable. Chris Lattner said last May that he expected Mojo to be usable in 18 months, so within the next 7 - 8 months
Getting a python readability review seems downright impossible in my org.
Which languages would you say google prefers these days? But also in light of what an early SWE might want to focus on to maximize career options?
Honest answer, only C++.
C++, Java, and Go are the languages for backends IIRC. I think Typescript is the frontend language of choice.
2 replies →
Python is mostly the Perl of the current day. And it attracts tons of beginners, that also means nearly equivalent amount of bad code(Just like in the Perl days).
These days if you are doing serious work, you simply use Java. Especially if you want something running for years. Java is really the only option you have.
A decade back I interviewed at a major telecommunications firm. Python was the new fashion then, they were trying to rewrite a fairly big Java code base to Python. Anyway I didn't get the job. My friend did. After a few years of this they realised, Python was not a serious alternative for an application of that nature. And abandoned it midway.
I know several other banks that have had a similar arc. Python is an amazing glue language and perfect for lots of automation and adhoc glue work. Its just not meant to be a serious alternative for long term, stable applications which are typically written in Java/C++.
Other languages like golang have come up in the past. While they are really good for smaller applications. They are just not there for something serious. 'Simplicity' has different meanings in different contexts. Either way, I think both Python and Java are here to stay and will be used for tasks where they are good at.
But we are now past the 'Python for everything' days.
Even as a lifelong java dev, this is a silly take.
Python is an absolutely lovely language. It is not the 'perl of it's day'. In my experience, things get hairy when you start building bigger systems that require a lot of collaboration but you can probably do away with most of the pitfalls if you use type hints. Beyond that, it's main downside is performance but you would be shocked how little code you have to convert to C/C++ to remove bottlenecks.
You are right that most large orgs choose a language like java, but I'd also argue that C# and golang are good fits as well. They're fast, and they have a garbage collector. I suppose typescript / node could be in that same category but I steer away from that stack as a backend dev.
Do you realise how your comment sounds? No actual reason for any of the opinions, just "this happened" and words like "serious". What does serious means, is it type safe or something? Can you try again with substance?
I think it's a copy pasta.
Someone should rewrite this but Rust instead of Java; it would be a perfect meme.
I guess Instagram, Threads, Reddit, Uber, and Spotify aren’t serious long term applications.
I'm not sure i'd cite Reddit as a positive example of such a thing.
4 replies →
> Its just not meant to be a serious alternative for long term, stable applications which are typically written in Java/C++
The what, now?
Using Python for a serious backend thing at a telecom firm is a big no-no, and I say that as a guy who has been paid to write Python code for almost 20 years now.
Python's absolutely fine to use for a "serious backend thing" at a telecom firm.
It's a language that attracts casuals, but that does not mean it's incapable of being used for serious software engineering. The only scenarios where I wouldn't use python for a "serious backend thing" are scenarios in which there are dramatic cost/performance/etc consequences resulting from the overhead of using python which would be substantially reduced if using $lowLevelLanguage. Even then, there's always the option of outsourcing specific units of functionality to say, c++, anywhere the performance difference actually matters.
I would say that for the vast majority of use cases, acceptable performance could be easily achieved by simply writing better python.
Writing this reply brought to mind some absolutely atrociously inefficient ORM code I encountered in a python codebase recently. If you don't have an understanding of how to utilize SQL efficiently, it doesn't matter what language you're using to construct the SQL queries, the software engineering equivalent of warcrimes is possible in any language.