“未来程序员的工作,可能不再是逐行检查每一处实现,而是更多地审查架构、需求、测试覆盖以及最终行为。”
anthropic 的工程博客好像也是这么写的
但是我个人有更细化的做法,就是在
AGENTS.md 里面限制代码的行为:
Optimize for local static reasoning: keep control flow, state transitions, effects, and call targets inferable from nearby code.
Use explicit, concrete data structures and types that encode exactly the valid states and alternatives; handle alternatives with explicit case analysis.
Use polymorphism only for genuine parametric genericity; do not use inheritance or runtime dispatch.
Avoid explicit loops unless explicitly allowed; use idiomatic functional combinators such as map, filter, fold, and language-specific equivalents.
Except where required by third-party APIs, mutable state may exist only as state threaded through fold.
Keep a stable name stem for a value while it should be mentally tracked as the same thing; carry it across local bindings and function boundaries rather than renaming it for how it is produced, stored, moved, or accessed. Change the name only when a new distinction must itself be tracked thereafter.
有了这些限制之后,阅读代码的速度将会得到提升。
最后的最后,你会发现,上面这个工作最终的导向,我认为还是 effect system 赶紧实装。