Hacker News new | ask | show | jobs
by jasim 3450 days ago
Absolutely stoked to read your response. Thank you sir.

There is a dearth of quality conversations on the internet about good code in a real-world messy context, mostly because the people who're doing serious work don't have the time to talk about it. Would be a good thing if you write more. In fact you folks should be writing books!

1 comments

One maybe interesting anecdote.

May 2015, a few Chrome old timers reacting to the complexity of the code, decided we should try and build something new. This is nothing new for me personally (having worked on Netscape, Firefox and Chrome, and various false-starts along the way). We decided to design a browser based on a service-oriented architecture, using our new IPC and bindings tool (Mojo). This project was called Mandoline. We got a shell up and running that could complete some of Chrome's telemetry test suite. Performance was good. The architecture was clean. Problem was, the browser didn't do all that much. While a team of 6-7 people might have been able to build a browser 10-15 years ago, today browsers are just too complex (in feature requirements).

So our options were to try and convince the Chrome team (huge org) that they should drop everything and help us build this prototype into something real (unlikely, many past examples of failure of this kind of thing - see: Gecko transition/Netscape 6), or to find a way to bring this architecture into Chrome. The first not being a real option, we settled on the latter.

OK so you might ask - why labor under this delusion of building a new browser from scratch at all? Why not just stay within the confines of Chrome from the start, and look at the incremental projects that can be done to pragmatically improve things? My answer is that incrementalism should not be a destination or a goal. It's a tool that helps you get somewhere interesting. If you don't know where you're going, you're lost and incrementalism is just a delusion to trick you into thinking you're making meaningful progress. In the suffocating confines of a massive codebase, it can sometimes be hard to see the forest for the trees. It can be very valuable to step aside and try something else. Stepping aside can be creating a branch and hacking away liberally, or creating something entirely new. The other benefit of doing this is that it doesn't distract or further complicate the shipping product. But then bring the learnings back into the main line. And hopefully in your project you have leads on the main line willing to learn from such discoveries. On the Chrome team we're fortunate that we do.

So this is what we're doing now. We're bringing a service-oriented architecture to Chrome. A few of us have a pretty good mental picture in our heads of what the end state looks like (roughly) and we're using incrementalism to nudge the Chromium codebase there over a few years. The value in this approach is we get to validate our ideas against all the different platforms & features Chrome supports and test it on all of Chrome's users. It means if our changes land & stick that they really are by definition "good". By the end (if there ever really is one) we will have rebuilt much of the system architecture, while shipping every 6 weeks.

I was interested recently to read a similar story here about the plans in Firefox to integrate some of Servo into Gecko. The rationale was very similar. The reality is that you can't burn your user base by neglecting them while you build the massive new thing, or by expecting them to switch to something else. Instead you have to embrace the complexity & figure out how to work within it, while not giving up your dreams.

wow, that was amazing. Really nice to hear interesting stories like this.

Your take on incrementalism is interesting. I remember Joel Spolsky used to say never rewrite software from scratch as you will introduce new bugs. But I guess a well-balanced approach is always beneficial.

And yea, modularising Firefox and slowly replacing part by part with Servo is indeed a great idea.

I'd like to add my grain of salt here: I can agree about the don't rewrite from scratch "rule", but only depending on the context -- and also only when looking at all the details of a given project.

When bengoodger says "reacting to the complexity of the code", I doubt this is as messy as what can be found in some private codebase produced over a decade by some less-than-google-level employees who since left. So while the never-recode myth has some value in somehow (at least) good code bases, and depending on the angle of view (to even judge whether an approach constitute a rewrite or not), it also has a rather big cost, when some manager try to use it on projects far beyond the non-return point to justify forcing engineer to swim in the septic tank instead of doing any valuable work.

After all, for each Netscape (which BTW, involves a quite good amount of technical and commercial mix, and even then Mozilla is still with us today...) I could ask why a corresponding NT has not evolved from consumer Windows... (some parts were shared, but again: the angle of view...)

Not a counter-point at all, just an aside: consumer windows and NT were fundamentally different software. The "Showstopper! the Breakneck Race to Create Windows NT and the Next Generation at Microsoft" book is a packed guide of what happened at Microsoft at the time and covers the differences. Very interesting read.
I agree, that book is excellent.