2 ms·
I attended a talk by one of the Google Guava (Java collections library) authors and he told us how they didn't have to worry about maintaining backward compatib
by nradov 9y ago
I attended a talk by one of the Google Guava (Java collections library) authors and he told us how they didn't have to worry about maintaining backward compatibility at all. When they made a breaking change they could check out all of the impacted Java code across Google, refactor it, verify that the tests still passed, and then commit everything in one shot. It's easy to understand the productivity advantages.
- matttproud 9y agoOne challenge is latency in the generation of codebase and identifier and callgraph search index (Cf., Code Search and Kythe). We can perform global tests across the entire monorepo, but that takes time. What happens if someone introduced new usage of old API immediately before our atomic refactoring, and what about pathological tests or flakes? This still necessitates doing some cleanups multi-stage: (1.) mark old API as deprecated (optionally announce), (2.) replace and delete legacy usages, and (3.) deletion of final trailing usage sometime soon thereafter once the codebase has been reindexed. Some languages and ecosystems are more tolerant of this problem than others. That said, incremental cleanup still has advantage with bisecting regressions. As I said, it is not perfect but broadbased change quickly is relatively easy. In my time maintaining open source, I never had these luxuries, which is why I said the monorepo is infinitely easier. Another consequence: if global cleanups are easy, perhaps that reduces the barrier to experimentation. Perfect is no longer the enemy of the good and the good enough. For me, I felt in open source where I had zero control over dependent code and its callgraph, the reverse was true: hesitance to publish something for fear of cost.
- user5994461 9y agoFacebook gave a conference not long ago about then doing the same thing. Interestingly, they only do that for java code. Java has good analysis and refactoring tools.
- danabramov 9y ago>Interestingly, they only do that for java code. Not sure what you mean. I work at Facebook, and can confirm we keep all code in a monorepo (or, rather, one of two big monorepos) rather than just Java code. This lets us easily do React API changes: we can deprecate an API internally, and update all JS code that references the old APIs in a single commit.
- user5994461 9y agoI meant the refactoring. I've only ever seen it work on Java. Other languages are much harder to process.
- huherto 9y ago> Interestingly, they only do that for java code. Java has good analysis and refactoring tools I can definitely see this.