AutoTransform:高效的代码库修改
Every codebase starts off small and modern. While it’s still small, the team can easily keep it up-to-date with current standards, upgrade libraries, and handle any code hygiene issues that may arise. Updating the API of a framework you built is easy when it’s only called in a handful of places. However, as the codebase grows these problems only become tougher. Anyone who has ever refactored a large codebase knows the pain that comes with having to modify hundreds or even thousands of files.
每个代码库开始时都是小而现代的。当它仍然很小的时候,团队可以很容易地使它与当前的标准保持一致,升级库,并处理任何可能出现的代码卫生问题。当你建立的框架的API只在少数地方被调用时,更新它很容易。然而,随着代码库的增长,这些问题只会变得更加棘手。任何曾经重构过大型代码库的人都知道修改数百甚至数千个文件所带来的痛苦。
Larger codebases also tend to have more dependencies that need to be updated more frequently, and more hygiene issues that slow down developers. When you take the cross product of these things, the effort of keeping a codebase well maintained at a reasonable size becomes untenable. First, you give up on hygiene, leaving unused or forgotten experimental code lying around. Eventually, libraries fail to get updated when they should. The rationale is usually that the cost of fixing these things is not worth the value they add, despite the fact that forgotten experimental code is the source of numerous hard-to-track bugs, copying unused code perpetuates legacy patterns into the future, and out-of-date libraries present security or performance risks.
较大的代码库也倾向于有更多的依赖关系,需要更频繁地更新,以及更多的卫生问题,拖累了开发人员。当你把这些东西交叉起来时,在合理的规模下保持一个代码库的良好维护的努力就变得难以维持。首先,你放弃了卫生,让未使用或被遗忘的实验性代码到处乱放。最后,库在应该更新的时候却没有得到更新。理由通常是修复这些东西的成本不值得它们增加的价值,尽管事实上被遗忘的实验性代码是许多难以追踪的bug的来源,复制未使用的代码使遗留模式延续到未来,过时的库会带来安全或性能风险。
In addition to cost, there is the issue of motivation. Very few people like doing this type of work. It’s often slow, tedious, and repetitive. It’s never flashy and doesn’t visibly move core company metrics on its own. It can be exceedingly thankless work and is therefore easy for developers to put off to the side while working on the more visibly impactful features they want to develop. Because of this, al...