9 ms·
Google is 2B lines of code and it's all in one place (2015)
- bumblebritches5 4y ago
- zamadatix 4y ago(2015), would be interesting to see what has changed in those 7 years.
- oh_sigh 4y agoIt's now 10B lines
- cplusplusfellow 4y agoWhere is this extra code coming from? Do they do an immense amount of code generation?
- lupire 4y ago300K person-years....
- dchftcs 4y agoThat would still be 20-30k additional LOC per person year. Which is difficult to achieve especially in a corporate setting with a mature code base, without code generation, lots of blank lines, or including static data. Even in startup environments it's hard to get 20k-30k a year for several years from the average unless many of the engineers don't overlap.
- mrwh 4y agoI don't know about that. 100 lines a day, 280-or-so days a year, is pretty doable for the average L4. You could do that in migrations alone, and people do.
- dchftcs 4y agoL5 or above there's normally a lot more communication and planning, which pulls down the mean significantly. In migrations you typically need to subtract some old code in the end, and it's not uncommon to result in net negative LOC (if the migration is ever complete). For L4 maybe there are more days where one can do several hundred LOC in an afternoon than L5, but there are also many days that result in 100 or less over an entire week, because there's testing, debugging, profiling and figuring out what to code. But, maybe I'd be wrong about Google. Afterall, it might be easier to dump lots of code into the codebase if there are 10 independent chat apps in development at any one time.
- xen0 4y agoMigrations tends to involve deleting lines too. A 200 line change typically doesn't grow the code base by 200 lines. I believe in my 2.5 years at Google, I've actually deleted more lines of code than I've added.
- deleted 4y ago[deleted]
- ahtihn 4y ago> 280-or-so days a year So working some week-ends and no vacations at all? There are about 260 week days in a year. Add bank holidays and vacations and you should ve closer to 230 working days in a year.
- sudosysgen 4y agoProbably half of that is config or autogen, perhaps even more, so it seems fairly reasonable?
- dchftcs 4y agoYes but the point of contention was whether this can be done without code generation and static data. And probably both you and I agree it's quite difficult for a large organization to get 20k-30k net LOC additions per engineer without "conifg or autogen".
- gravypod 4y ago(Opinions are my own) > Do they do an immense amount of code generation? Blaze (aka Bazel [0]) has provisions that make it easy to generate code but this happens as a compile step rather than something that is checked into a git repo. [0] - https://bazel.build/ https://bazel.build/
- kyrra 4y agoGoogler, opinions are my own. I believe the YouTube video linked from the wired article goes into this, but there's more machine generated code checked in than human generated code at this point. A lot of this is boilerplate or config data that is stored in source control. I feel like Google definitely believes that config is code, so we have a ton of configuration of our systems checked into Piper.
- brundolf 4y agoWhy is the generated code checked in, vs generated as-needed later?
- onei 4y agoPure speculation on my part, but I've noticed Go has generate and build as separate steps and it's standard to check in generated code. This split no doubt makes compilation a lot simpler/faster, but perhaps it's a reflection of standard practices the language authors were used to.
- azurezyq 4y agoMost of them are generated on the fly, like protos. But you know, there are tons of configs, all kinds of.
- danpalmer 4y agoTraceability, simplicity, all sorts of reasons. If you commit all your codegen’d stuff you don’t need to worry about how to run codegen in most places. You can enforce a lot of security properties, you can run large scale analysis on the code in production because it’s all “statically” available, etc. That said, I think Google’s source control ecosystem is really quite different to what’s publicly available with systems like Git/Hub/Lab etc, even to Phabricator. These approaches work well at Google but don’t necessarily translate to other tools in the same way. Don’t take these sorts of things as gospel, or even as google advice about good engineering. Understand what they achieve, and then figure out a way to achieve that same result with the tools available to you.
- exikyut 4y ago
- deleted 4y ago[deleted]
- oh_sigh 4y agoSorry, I never checked the replies to this comment, but I just want to point out that I was just joking with my 10B statement and have no clue as to how much code is actually in google's repos. it may be 1T for all I know.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- webscout 4y agoinside a single system available to just about every engineer inside the company Can someone explain why there have never been any leaks?
- danielmarkbruce 4y agoleaks of what exactly? It's billions of lines of code spread amongst millions of files which make up thousands of services... It's not like there 10 files with all the magic sauce.
- zeven7 4y agoTo add to this, it's not all on every engineer's machine. It's not like they can just walk out of the office with a computer with all the source code. It's on a virtual file system that requests files as needed, and you can bet there are systems set up to detect if someone is just downloading the whole thing for no reason.
- chii 4y agoit's not even that. if you assume that the entire codebase was leaked verbatim, it would still take entrenched knowledge of many google engineers to replicate the same services and infrastructure to support those services. If any state actor who stole that code could deploy such engineering capabilities, they don't really need the source code tbh.
- deleted 4y ago[deleted]
- arebop 4y agohttps://en.wikipedia.org/wiki/Anthony_Levandowski#Criminal_conviction_and_pardon https://en.wikipedia.org/wiki/Anthony_Levandowski#Criminal_c...
- xfs 4y agoFrom Steve Yegge: What really happened is that China hacked Google, and it pissed Google off when they finally discovered it, many months later. This wasn’t some small intrusion or data breach. It was a systemic, coordinated, widespread, very deep hack, which among other things, gave China all of Google’s source code. It was very similar in scope and ambition to the Solar Winds hack recently out of Russia. It forced Google to completely rethink their security, which at the time was an Igloo model (hard on the outside, soft on the inside, a Gary Larson reference I think), and they had to migrate to where internal access was also limited, which took years. I’ll share with you, confidentially wink wink, that most companies way overvalue their source code. It’s actually their engineers who are their biggest asset, because the engineers can reproduce the source code if it’s lost (quite quickly at that), whereas the source code can’t do fuck-all on its own. Moreover, most source code bases are so ugly that you couldn’t give them away. But Google had what they now call “HIP” (High-value Intellectual Property) scattered through their source code, which are the tuning parameters and constants for various algorithms and AI models which are the true Secret Sauce to Google’s Search and Ads dominance.
- sqs 4y agoDoesn't mention Google's CodeSearch, which is one of the coolest parts of Google's monorepo: https://codesearchguide.org/story/google https://codesearchguide.org/story/google.
- kccqzy 4y agoYou can experience the magic in the open source version: https://source.chromium.org/chromium/chromium/src https://source.chromium.org/chromium/chromium/src Try the powerful search, including free text search, operators like f: or symbol: (the full list of operators can be found at https://developers.google.com/code-search/reference https://developers.google.com/code-search/reference) Then try the references feature by clicking on symbols.
- gravypod 4y agoYou can also visit https://cs.opensource.google/bazel/bazel/+/master:src/main/cpp/archive_utils.h https://cs.opensource.google/bazel/bazel/+/master:src/main/c... which also has references for symbols which is my favorite feature. "Find all places this class is used" is super helpful.
- jeffbee 4y agoIt is still baffling to me how bad both cs.github and sourcegraph are compared to this. I mean when your entire business is browsing code why don't you have decent crossrefs? Bizarre, especially when you consider that the whole underlying infrastructure of google codesearch has been open-sourced.
- kyrra 4y agoGoogler opinions are my own. I also highly recommend this ACM article talking about our source control from 2016. https://m-cacm.acm.org/magazines/2016/7/204032-why-google-stores-billions-of-lines-of-code-in-a-single-repository/fulltext https://m-cacm.acm.org/magazines/2016/7/204032-why-google-st... There's also a YouTube video which is linked from the wired article that is good. https://youtu.be/W71BTkUbdqE https://youtu.be/W71BTkUbdqE
- tasuki 4y agoInteresting! Have you met many people whose opinions were not their own?
- vntok 4y agoYes, anyone writing on behalf of their employers would present opinions that may not be their own.
- sph 4y agoWe should adopt the opposite: ask to disclose when opinions are NOT your own.
- vntok 4y agoHmm, no we should not. The default is already that any stated opinion is your own, disclosing ties is only necessary when you're expressing an opinion about a company you are actually working for. This case, when an employee speaks about their employer in a public forum, is pretty rare, so rare in fact that people are surprised when they see disclosures -like in this very thread.
- tasuki 4y agoAgreed, disclosing ties is a good idea. I guess I'm just not too keen on the specific wording...
- 4y ago
- gouggoug 4y agoComment in relation to the comments in this thread: What is it with all the Googlers systematically prefacing their comments with "Opinions are my own"? Is that some kind of policy at Google? It's so ubiquitous now that it feels almost like some kind of humble brag.
- andrewxdiamond 4y agoIf you identify yourself as a Googler without disclosing that you are not speaking on behalf of the company, you leave the window open for people to think you _are_. Which is a no-no of course. The standard cop out is to say that line even when it’s completely unnecessary. It’s just easier to add it than consider how your words may be missunderstood.
- gorgoiler 4y agoAt a high level there’s some dissonance between having such a strong bond with one’s employer that one would identify as an employee of theirs, socially, outside of work, but also claim to still be independent enough of the employer to have independent thoughts on technical matters directly related to the employer. If you wore an I’m with her! tee, you would not claim to have a neutral opinion on politics.
- TulliusCicero 4y agoThis is an incredibly uncharitable reading of the situation. It's like you're being deliberately obtuse. Someone literally explained to you that it's a matter of transparency, and you're jumping to, "well obviously they're just bootlickers".
- gorgoiler 4y ago“Bootlickers” is pretty unkind. If you work for Google, comment in public on Google stuff, with an account that says “I work for Google!”, I would say it is not possible for you to remain independent, no matter what kind of spell-of-disclaiming is attached to your post. When it comes to Google matters, one either comments as a Google employee, or not at all. It comes across as distasteful to try to do wade in while waving off claims of bias with “opinions are my own” with the implication that they are unbiased. Maybe what these people mean is: I work at Google so this is biased towards them, but they didn’t tell me to write this, and perhaps I should be reading it that way?
- dang 4y agoDiscussed at the time: Google Is 2B Lines of Code, All in One Place - https://news.ycombinator.com/item?id=10227000 https://news.ycombinator.com/item?id=10227000 - Sept 2015 (325 comments)
- throwaway0x7E6 4y agoconsidering the rapid decline of quality of both the text and image searches, I don't think there are any people left at google that actually know how any of that works
- oxff 4y agoIt's so bad these days, the Search. Rendered entirely unusable either from SEO or other manipulation they themselves run.
- vntok 4y agoConsider that your experience may not be representative. You might be part of the very low percent of people whom Google Search does not target and does not want to spend money on acquiring/retaining.
- pbhjpbhj 4y agoThey know how it works, why do you think it's not working as designed. They do things to make a profit, not to make a good search engine [any more]. This sort of opinion appears rife somehow, people who make it clear their raison d'être is make money above all else are considered incompetent because, whilst making massive amounts of money, their actions are highly deleterious in other areas. Do you just not believe that those in control only care about the money and couldn't care less about search quality other than to the extent it's necessary to make money?
- spiffytech 4y ago> Do you just not believe that those in control only care about the money and couldn't care less about search quality other than to the extent it's necessary to make money? I definitely believe this, but I also think companies fall victim to the classic quote from Upton Sinclair: "It is difficult to get a man to understand something when his salary depends upon his not understanding it." It would not surprise me if Googlers had a rationalization for why these "worse" search results are somehow a better user experience. Other examples: Apple's tight control over the iPhone software experience is controversial. Facebook employees often say they're benefiting the world, while outsiders think they're harming it. I don't think these are black-and-white - someone can credibly argue a case for each. But I think the Upton Sinclair quote tends to tip the balance for what insiders believe.