TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Examples of Complecting

1 点作者 oskarkv将近 13 年前
I recently watched Rich Hickey's excellent talk <i>Simple Made Easy</i> http://www.infoq.com/presentations/Simple-Made-Easy/. After watching it I have noticed that a lot of tips I've heard and problems I've encountered boils down to what Rich was talking about; complecting.<p>For example this http://unlikekinds.com/post/17192015158 blog post argues that, when programming games, one shouldn't use inheritance for game objects. While a good piece of advice, using inheritance in this case is just a special case of complecting things.<p>But I've also noticed, and Rich mentions, that complexity (in the sense Rich was talking about) can be hard to spot. The more common the practice, the harder to spot. One example Rich brought up is positional arguments, or using lists to store certain kinds of data. For example: Storing a person's telephone number and name in a list [phone-number, name] complects the two. First, one has to remember the order. Second, if one needs to store, say, the person's address too, one needs to make changes to all the code that relies on the list's structure. A map {:phone-number the-number, :name the-name} does not have those problems.<p>I want to become more aware of, and sensitive to, complexity. HN, do you have any interesting or enlightening examples of complecting? Examples of complecting that a lot of programmers are blind to, like positional arguments, are especially welcome.

暂无评论

暂无评论