返回资讯中心
外部精选
软件工程
#开发者实时流

Grocery stores are great abstractions

The purpose of a programming abstraction is to hide complexity. Modules and libraries abstract away complex code; coding languages abstract away complex assembly; assembly abstracts away complex binary operations; binar…

Hacker News 最新friendshaver2026/10/29 · 今天4 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

The purpose of a programming abstraction is to hide complexity. Modules and libraries abstract away complex code; coding languages abstract away complex assembly; assembly abstracts away complex binary operations; binary operations abstract away complex transistor chemistry. A person working at any given layer is, ideally, spared the cognitive load of understanding the complexity of the layers beneath. The quality of an abstraction is measured by how effectively it hides its internal complexity behind a clean interface.

Whenever I'm designing software, my aspiration is to abstract as effectively as a grocery store does. To purchase a carrot at a grocery store, you walk in, grab a carrot from the bin, pay at the register, and walk out. You don't need to think about the top-lifting harvester that pulled that carrot from the ground. You don't need to think about the factory that produced that harvester or the mines that supplied its metal. You don't need to think about the networks of boats, trains, and trucks that brought that carrot from the farm to your city. You don't need to think about the musculoskeletal system of the shelf stocker who was able to dexterously move the carrot from its shipping box to the bin. You don't need to think about the data analysts who, over months of meetings, arrived at the guidelines for how that bin should be placed within the store. You don't need to think about the financial system that trades on carrot futures and how its fluctuations affect farmer incomes. You just buy a carrot.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →