2026-08-19
每日一句 · 技术圈趣话
There are only two hard things in Computer Science: cache invalidation and naming things.

计算机科学中只有两件难事:缓存失效和命名。

Phil Karlton(据传)

背后的故事

这句话最早出自 Netscape 的资深架构师 Phil Karlton,他在 1990 年代的一次内部讨论中感叹编程的复杂性。技术圈之所以津津乐道,是因为它精准戳中了两个痛点:缓存失效会导致状态不一致,即便写得再好的缓存代码,也常在并发或版本更新时出现诡异错误;而命名——变量、函数、类名——看似简单,却需要深刻理解业务和设计模式,一个糟糕的名字会让代码可读性暴跌,维护时令人抓狂。许多程序员在改 bug 或重构时,都会下意识想起这句话,并会心一笑。它后来被马丁·福勒等大师在各种演讲中引用,成为软件工程界的经典名言。

小测

1. What does the quote imply about 'naming things' in programming?

2. Who is widely credited with coining the first part of this quote?

← 回到今天的「每日一文」