AgentHubAgentHub
返回全部博客

There's No Limit to How Bad Code Can Get

Simon Willison··3 分钟阅读·67 次阅读
There's No Limit to How Bad Code Can Get
原文来源:Simon Willison
查看英文原文

My comment on There's No Limit to How Bad Code Can Get — Lobste.rs.

[In reply to a comment about burning it down to start from scratch when technical debt becomes overwhelming]

In my experience it's so rare for that to work.

You announce the old thing is irrecoverably drowning in tech debt. You spin up a team to rewrite it from scratch. Work begins.

Meanwhile the old thing remains a moving target: it's running the core business, so changes are still necessary. The developers working on it know that it's going to be made obsolete by the new thing soon, so they don't have any incentive to go beyond the smallest effort possible to add the new features. Technical debt continues to mount.

Meanwhile, the team working on the new thing are ambitious and probably a little naive. They start out at a great pace - it's greenfield after all - but as time progresses it becomes apparent that nobody fully understands the behavior and scope of the thing they are replacing. If it was well documented and tested it wouldn't need to be replaced, after all...

After months (or even years) without delivering value, the pressure is on to "ship it", so the new system is launched to handle a subset of what the old system handled - or often for some new feature that was too hard to build with the now mostly unmaintained old system.

... so now you have TWO systems in production - the janky old system that nobody wants to touch, and a new system which handles just a few production features and is 80% inactive code that is meant to replace the old system, eventually.

If you're really lucky the company won't have lost patience with the new system and will allow that work to continue. The longer this all takes, and the longer the old system stays in production and stubbornly continues to work, the higher the risk that "priorities have changed" and the new system total replacement work is abandoned, leaving you with two systems where you used to have one.

The best article I've read about completing this process responsibly is Migrations: the sole scalable fix to tech debt by Will Larson.

If I run into a situation like this in the future, my strong recommendation will be to shore up the old system with as much automated testing as possible and then seeing if targeted refactors can get it to the desired shape. My hunch is that in many cases that will have a much higher chance of success than the siren call of a greenfield replacement.

Tags: migrations, technical-debt

版权与学习声明:本文整理自海外公开技术博客【Simon Willison】,原文版权归原作者所有。中文对照版本主要用于中文开发者社区的技术交流与知识探索,严禁用于商业侵权。

推荐阅读

最佳实践

12 个真正好用的提示词:把要求写成验收标准

从站内 1,018 条提示词里挑出 12 条覆盖开发、汇报、数据、决策与自动化的实用模板,逐条给出正文、适用场景和它有效的原因,并说明三类最常见的失效与修法。

最佳实践

设计师该装的 5 个 Skill:把设计标准写成说明书

我们逐个读完上游仓库里 SKILL.md 的原文,从设计向候选里留下 5 个真的写了可执行标准的:Anthropic 官方的 frontend-design 管视觉方向与排版、theme-factory 管配色与字体主题、canvas-design 先写设计哲学再出海报,加上 ui-ux-pro-max 的本地设计资料库和 popular-web-designs 的 54 套真实设计系统。附安装命令、五步组合工作流与踩坑提醒。

最佳实践

让 AI 替你办事的安全清单:授权怎么给、钱怎么管、出事怎么办

把邮箱、网盘甚至支付入口交给 AI 之后,风险从“它说错话”变成“它办错事”。这份清单按事前、事中、事后三段展开:授权分只读/待确认/执行三层给,账号与插件要可牺牲,支付走限额的一次性虚拟卡而不是主账户;再给出四个跑偏信号和三分钟事后检查。

最佳实践

Jev 使用教程:从注册拿 Key 到接入 Claude Code,只会做选择题的模型手把手上手

Jev 是 TypeSafe AI 发布的 System One 决策模型:给它情况描述和预设选项,它只返回选项、概率与置信度,不生成一个字。本教程覆盖 console.typesafe.ai 注册拿 Key、Choice/Noul/Score 三种题型的 Python SDK 与 curl 调用示例、Claude Code 插件两行命令接入、置信度路由写法,以及新手必踩的 8 个坑。

探索更多生产力神器

不想只停留在理论?立即体验下一代 AI 工具与 MCP 插件

收录 ChatGPT 6、Claude 3.7、Devin 等热门 AI,以及 3000+ 开发者开源 MCP 插件与一键安装脚本。