The Pragmatic Engineer
00:27:40 · Titus Winters, Gergely Orosz
You know, you do not want at a, you know, 10,000 plus person company to be like, everyone stop touching the repo for an hour. Let me do this thing. Like, that's not gonna scale. Right? And so the tech is you break all of... Like, you figure out how to do your refactoring so that the old API and the new one can coexist in spelling. Yep. And then you paralyze, like, just cut by directory structure. Like, alright. I'll send you this batch of updates, this batch of updates, and you wind up, you know, going like that. And then once everything is clean, then there's a race to make sure no one copy and pastes the old thing. And then you delete the old thing, the new thing is the default, you move on with life. You just do that a few 100 times, and your code base is in much better shape. [00:28:28] S0: Yeah. Wow. And and then you're you're doing this all all the while while other engineers, they're just doing their thing. They're using these things they don't even know about. They don't wanna know about you. I mean Exactly. They might be aware of you, but they shouldn't have to change their Yep. Just, as you said, slow down or Yep. But then we
00:28:28 · Gergely Orosz, Titus Winters
[00:28:28] S0: Yeah. Wow. And and then you're you're doing this all all the while while other engineers, they're just doing their thing. They're using these things they don't even know about. They don't wanna know about you. I mean Exactly. They might be aware of you, but they shouldn't have to change their Yep. Just, as you said, slow down or Yep. But then we [00:28:43] S1: did get amazing feedback on some of this. Like, at first, people were like, what are you doing? How... Why are you changing my code? It's like, I'm not okay with this. And very quickly, they're like, oh, this is great. Like, I go away. Please please move My code just gets better. Like, and I don't need to worry about looking up, like, is this the right way to do a thing? Because if it was the wrong way to do a thing, you would have gotten rid of it already. Like, when you have someone that is going through and just janitering the code base like that, copy and paste becomes the correct answer for how do I do this? Like, find someone else that did it once, you copy it, you move on with life, and you have evidence that it's probably a reasonable answer. Because if it was wrong, we would have fixed it already.
00:29:26 · Gergely Orosz
[00:29:26] S0: It's very interesting because today, obviously, if you did a big refactoring, the obvious tool that you would reach for is is AI as we've seen with so many companies having lots of success with... Well, in in the sense that AI is capable of the challenge that you had is you had this massive asset code base, rewriting it by hand would have not been feasible, but at Google, you came up with a very clever semi automated approach, was based on pretty hardcore language parsing and and coming up with new ways where you could formally, maybe informally or or at least prove that this thing will be correct Yeah. Which is what most teams would not have the availability capacity, even expertise to do. What everyone has the expert... The capability to do right now is like, oh, AI, go and do this and and do tests and all this. However, where I wanted to get to, like, rewriting with AI still feels so much more janky than what you did, which was so much more deterministic. Yes. And I wonder if this technique that you used at Google might at some point spread or or people will just put up with like AI kind of, you know, like, it might or might not work.
00:30:32 · Titus Winters, Gergely Orosz
[00:30:32] S1: Think if you're looking for it, it's already out there. In the Java space, particular, tools like OpenRewrite, like, you basically... There's a little configuration per run for it, and you say, like, this is the pattern I'm looking for in the Java code. This is how the rewrite would look. And it goes through and blasts through all your Java source files and and does that update. Turns out, AI tools are really, really good at generating open rewrite recipes, which is way cheaper on token consumption, and way more accurate, and much faster, and auditable. Right? It is a substantially better pattern. And I... We've seen talks from, I wanna say, Netflix and Uber. I could be wrong. Specifically on, like, everyone seems to be coming to the same conclusion of what you need is a deterministic tool that declares the intent of the rewrite. You can have the AI, like, write a little skill to tell... Train the AI how to create the config for those tools, and then you move on with life. In the c plus plus space, actually, some good friends might have a startup right now. It's called BrontoSource that is specifically just about that sort of declarative rewrite pattern at a very high level of intent, very powerful for C plus plus Yeah. [00:31:50] S0: I I like the idea of of using AI to help generate deterministic software tools transformations.
00:31:50 · Gergely Orosz, Titus Winters
[00:31:50] S0: I I like the idea of of using AI to help generate deterministic software tools transformations. [00:31:58] S1: Yeah. Kelsey Hightower gave a great talk recently on, like, zero token architecture. And, like, his whole thesis, and I think everyone is coming to the same conclusion, don't use AI for constant inference. Use AI to generate the deterministic tool that will actually do the work, and then have AI fill in the gaps on the prob... Parts of the problem that you can't solve or where to invoke the tool, things like that. But, like, if your whole architecture is token consumption for all time, it's probably a cheaper and more effective way to do it.
00:32:35 · Gergely Orosz
[00:32:35] S0: Yeah. I just recently heard a head of engineering tell me that they're using these AI code review tools, which which are pretty good, but very expensive and slow. Right. And this person said, hang on. Like, what if we told the AI, okay. Like, let's do a thorough code review every now and then, but wanna find something. Let's have it generate a lint rule. Yes, please. Which is cheap and repeatable and it will no longer take thirty minutes the the cost. And also, it's it's just nondeterministic. It might or might not find it next time. That that that was frustrating. Like, this person was like, look, when we know we have certain things, so now what what they're doing is every now and then they still run some of these reviews and of course... But whenever they find any issues, then they fire up inference AI, several agents and say, alright. Can you come up with an improvement in our deterministic linting Yep. Can help it. And and the inspiration came actually from this person heard about how Uber... Actually, I I think it was... Heard heard me talk about when I joined Uber, I could barely commit my code the first first week. It was so painful because the linter just kept rejecting it because Uber had this Right. Enduring culture that Yep. Pre AI, whenever you saw something break, you just put a lint rule. Architectural rules were all in runt rules. You could not have something like a... We we had an architecture and and you could not inherit the wrong way because a linture would say like, uh-uh. You cannot you cannot inherit from, like, a builder cannot inherit from a... I don't know what what a composer or whatever that was.