News for hackers. Stuff that matters.
Re:Software Engineering at Google by MarceColl on Monday August 14, 2023 @10:37AM (#37121532)
The tools, design and manpower needed to build a skyscraper are different from those needed to build a 1-story wood house. It's not that the ones that build the wood house are failing to study and adopt the ways of their extremely successful competitors.

Now, some of the things you say like unit-testing and user data encryption are ones that I've never seen associated with the "We're not google" mindset, so maybe people have started using that phrase for anythingnow

Re:Software Engineering at Google by jeffbee on Monday August 14, 2023 @10:49AM (#37121674)
I'm not really talking about artisanal 3-man software shops, I'm talking about mid-sized companies with thousands of engineers, who don't realize they are already larger than and facing the same problems as Google was when they started adopting these practices. And to be clear, rejecting something as proven as pre-commit code review is not only to reject the example of Google and many other very successful enterprises, but also to ignore decades of developer productivity knowledge before Google existed. It's almost like the fact that Google adopted a long-standing best practice makes modern engineers reflexively revolt against those best practices. This can only be seen as a structural advantage for Google.
Re:Software Engineering at Google by dinvlad on Monday August 14, 2023 @11:13AM (#37121966)
Curious how pre-commit code review worked, could you please elaborate a bit?
Re:Software Engineering at Google by jeffbee on Monday August 14, 2023 @11:32AM (#37122227)
Every change is reviewed by someone other than the author before it lands in the repo. At google they take this a bit further. Every change has to have been either written or reviewed by a designated owner the code (designated by subdirectory) and one of the participants must be a qualified user of the languages used in the change. And they have technical measures in place to ensure that programs running in production descend exclusively from reviewed and committed code.

Pre-commit review is common but not universal in the industry. Some shops practice post-commit review or no review. Some believe review consists entirely of quibbling.

Re:Software Engineering at Google by dinvlad on Monday August 14, 2023 @11:38AM (#37122309)
Oh, I see - by "pre-commit" it doesn't really imply it in "Git commit" sense - the change is still propagated to others (presumably by committing it as a sort of "draft"), it's just not committed to the mainline - is that correct?

I'm very familiar with CR at other companies, but tbh since most deal with Git I don't think they'd have the same problem, unless I misunderstood the concept of "pre-commit" here..

Re:Software Engineering at Google by joshuamorton on Monday August 14, 2023 @12:24PM (#37122895)
Google (for $reasons) doesn't do long lives code branches and doesn't use git, at least for the main repo. So in that context every commit is reviewed pre-commit, but you'd do the same workflow elsewhere with trunk-based development, small pull requests, and CI and automated and human review of all PRs before they're merged.
Re:Software Engineering at Google by dinvlad on Monday August 14, 2023 @12:38PM (#37123087)
Right, I know it’s not on Git and hence was my question - and it sounds like this is more about terminology and less about technology. I.e. what Google does in this case is not that different from just “Code Review” in the traditional sense, as most other companies (with good engineering practices) do - reviewing code before it enters production (+CI/CD, as you mentioned)
Re:Software Engineering at Google by joshuamorton on Monday August 14, 2023 @01:05PM (#37123512)
> Edit: as OP mentioned, it does seem to differ in technical sense from traditional CR, in that the changes live only on developer machine, not in source control.

Yes and no. There's a decent whitepaper on Piper and citc you can find by searching for it (or actually I will :P [0]), as far as piper is concerned they aren't checked into source control, but the vast majority of development happens in "citc" workspaces, which aren't source control, but also are source control in a sense that every save is snapshotted and you can do point in time or point in history recovery, and I can open up a readonly view of someone else's workspace if I know the right incantations, and most of the developer tools treat the local citc workspace enough-like a commit that it's transparent ish.

[0]: https://cacm.acm.org/magazines/2016/7/204032-why-google-stor...

Re:Software Engineering at Google by dinvlad on Monday August 14, 2023 @01:24PM (#37123768)
OK, thanks for these details and the link! Somehow I remember the title, but not the content :-) That'll be an interesting read.
Re:Software Engineering at Google by nonethewiser on Monday August 14, 2023 @02:17PM (#37124520)
> and I can open up a readonly view of someone else's workspace if I know the right incantations

So thats not just a basic feature?

Re:Software Engineering at Google by UncleMeat on Monday August 14, 2023 @03:21PM (#37125581)
The normal workflow is to create a changelist and then have somebody patch that changelist into their client rather than accessing their client directly.
Re:Software Engineering at Google by joshuamorton on Monday August 14, 2023 @03:52PM (#37125975)
It's the equivalent of me being able to view the local, unpushed changes you have in whatever directory you git cloned into.
Re:Software Engineering at Google by nonethewiser on Monday August 14, 2023 @02:16PM (#37124501)
> as OP mentioned, it does seem to differ in technical sense from traditional CR, in that the changes live only on developer machine, not in source control.

Which seems worse.

Re:Software Engineering at Google by compiler-guy on Monday August 14, 2023 @06:32PM (#37127597)
"On the developer's machine" isn't correct.

They are actually saved within a special file-system called "citc" (Clients-in-the-cloud). It saves literally every single revision of the file written during development. If you hit save, it is saved in perpetuity, which has saved me a bunch of times. Every single one. No need for any kind of commit or anything else.

Further, these saved revisions are all fully accessible to every engineer within the company, any time they want.

Re:Software Engineering at Google by jeffbee on Monday August 14, 2023 @12:45PM (#37123182)
Yeah, there are no direct translations between git and perforce concepts. The right term within Google would in fact be "pre-submit" not "pre-commit". Before a change is submitted in the Perforce-derived flow it exists only in the author's client and isn't really part of source control in the way that git users are accustomed to pushing their branch to origin.

NB: At that company there are also users of git-compatible and hg-compatible tools, but I am discussing the main perforce-derived flow.

Re:Software Engineering at Google by dinvlad on Monday August 14, 2023 @12:50PM (#37123272)
Oh I see, thanks! I was under impression Google has migrated away from Perforce towards an in-house system a while ago, but looks like I was mistaken (or do you mean that system is derived from Perforce?). Edit: I guess its name is Piper..

It’s quite interesting/mind-bending to think of work-in-progress that’s still somehow synced between peers (in fact this is one of those “missing nice-to-haves” I wish Git had, and can only be approximated with wip branches..)

Re:Software Engineering at Google by jeffbee on Monday August 14, 2023 @01:03PM (#37123488)
The synced-between-peers features are built atop a thing call CitC, or Client in the Cloud. An author's client isn't on their machine, it's hosted in prod.
Re:Software Engineering at Google by dinvlad on Monday August 14, 2023 @01:26PM (#37123802)
OK got it, thanks for clarifying it
Re:Software Engineering at Google by klooney on Monday August 14, 2023 @01:57PM (#37124251)
The real problem with code review is that if people don't do it/just hit sign off, it's worthless. Your whole company has to believe.
Re:Software Engineering at Google by benlwalker on Monday August 14, 2023 @01:29PM (#37123855)
Pre-commit means before committed to the canonical repo, not before commit locally.

The SPDK project has an elaborate pre-commit review and test system all in public. See https://spdk.io/development . I wouldn't want to work on a project that doesn't have infrastructure like this.

Even mailing lists with patches are really a pre-commit review system, as are GitHub pull requests. Pre-commit testing seems more elusive though.

Re:Software Engineering at Google by throwaw12 on Monday August 14, 2023 @12:36PM (#37123050)
> I'm talking about mid-sized companies with thousands of engineers

Can you name such mid-sized companies with thousands of engineers? If you hit thousands of engineers headcount, you are not a mid-sized anymore.

Theoretically, Google does 100 things right, pays for those 100 things, but also Google has tons of cash, if Google didn't release product in Q1, no worries, they will release in Q3.

Now consider startup with 50 engineers, if you didn't release feature in Q1, you might need to stop the project, because customer with whom you signed the contract just goes away and you will be laying off 5 people

Re:Software Engineering at Google by aprdm on Monday August 14, 2023 @05:17PM (#37126917)
mid-size with thousands of engineers? Wow, mid-size for me is around 100-200 people :)
Re:Software Engineering at Google by sumtechguy on Monday August 14, 2023 @11:55AM (#37122541)
"were not google" is usually good for things where people are using cargo cult. I saw at one company that went open floor plan because google did it. No one was happy about that. Retention became very low and everyone bailed out. Emulating google does not fix process and management issues. As what may be at google for a good reason may be an utter failure at another company. There are things all shops can adopt that google does that would help them. But many of the ones I have seen adopted were little more than showy garbage instead of the things that would actually help.

Also sometimes you just need a simple tool to get something done. As engineers we like to build things so sometimes we make it way more complex than it really needs to be. For someone like google that may just be fine to do. For others a minimum viable product may be in order. Do not worry about optimizing for the 3 million user per day case when you have 10 total users a month. Add logging and keep an eye on it. Then worry if you need to scale. As building good scale takes time and thought. Many times you do not need that at all.

As your company/group grows you will take on more and more of the things 'google does' because you will need to, or you will go nuts chasing everything. You could probably even make stages out of the different times to do/evaluate things. To do it early could actually harm what you are doing. You need to evaluate what you are doing and why. Just copying someone else does not always lead to a good outcome and you could be wasting effort when you could be making product.

Re:Software Engineering at Google by MarceColl on Monday August 14, 2023 @12:46PM (#37123189)
I think you wanted to reply to the same person I replied to? Since I'm saying basically the same thing you do I believe
Re:Software Engineering at Google by robertlagrant on Monday August 14, 2023 @01:36PM (#37123969)
> "were [sic] not google" is usually good for things where people are using cargo cult

It's no different to cargo culting. That should not be the reason for not doing something, any more than the opposite should be a reason for doing it. Just see if the practice makes sense in your context and decide that way.

Re:Software Engineering at Google by marcosdumay on Monday August 14, 2023 @05:14PM (#37126879)
"We are not Google" is the answer to "I saw on that blog here that we should do X", "everybody is doing X, we should too", or "you have to follow this good practice here" where the practice is only "good" because it's hyped.

Those kinds of demand happen exactly because they saw them at Google, and an outright refusal is exactly how they should be dealt with. Once the unreasonable person is cut out, you can look at your context and decide what's the best way to solve the problem.