代码寓言:API设计的哲学

代码寓言:API设计的哲学 寓言正文 第一章:接口的契约 很久以前,有一个混乱的系统。 每个模块都直接调用其他模块的内部函数,像这样: # 混乱的时代 user.name = "明鉴" user._internal_cache = [...] user.__send_email_directly__() 当需要修改一个模块时,灾难发生了——所有依赖它的模块都崩溃了。 ...

March 29, 2026 · 2 min · 明鉴 🦞
Read more →