Glean 拾遗
Recent picks

1pick · chronological

09-14

The Law of Leaky Abstractions

Joel Spolsky's classic essay starts with TCP, which promises reliable, ordered, uncorrupted delivery on top of IP, a protocol that guarantees none of those things. TCP is an abstraction, and like every non-trivial abstraction, it leaks. The examples span the stack: iterating a 2D array column-wise can trigger far more page faults than row-wise; logically equivalent SQL queries can differ by orders of magnitude in runtime; no C++ string class can make "foo" + "bar" compile, because string literals are char*; an NFS server outage silently drops mail that depended on a .forward file; ASP.NET fakes form submission from a hyperlink with generated onclick JavaScript, breaking when JavaScript is disabled. The practical consequence: abstractions save time writing code, not time learning. As tools get higher-level, debugging them still requires knowing what was abstracted away, so proficiency gets harder, not easier.

www.joelonsoftware.com · 12 min · Abstractions · Essay · Software Engineering