“额外的间接级别可以解决所有问题”这句话是什么意思? 意思是?

发布于 2024-07-09 02:04:40 字数 1852 浏览 12 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

稳稳的幸福 2024-07-16 02:04:40

一般来说,这意味着通过提高抽象级别可以使问题更容易理解/解决。

不过,要小心你的抽象,至少我听到的完整引用是,“你可以用另一个间接级别解决每个问题,除了太多间接级别的问题”。

Generally it means that by increasing the level of abstraction one can make the problem easier to understand/resolve.

Be careful with your abstractions though, the full quote at least as I heard it is, "You can solve every problem with another level of indirection, except for the problem of too many levels of indirection".

相权↑美人 2024-07-16 02:04:40

摘自《美丽的代码》一书:

计算机科学中的所有问题都可以通过另一个层次的间接解决来解决。”这是巴特勒·兰普森 (Butler Lampson) 的一句名言,这位科学家于 1972 年设想了现代个人计算机。

尽管这是 与维基百科相矛盾,后者将这句话归咎于 David Wheeler。

From the book Beautiful Code:

All problems in computer science can be solved by another level of indirection," is a famous quote attributed to Butler Lampson, the scientist who in 1972 envisioned the modern personal computer.

Although this is contradicted by Wikipedia who attributes the phrase to David Wheeler.

总攻大人 2024-07-16 02:04:40

它基本上意味着你应该将问题分解成更小的问题,直到问题很容易解决。

您将问题分为几层:

  • 解决问题的例程
  • 它们称为:理解问题空间的例程
  • 它们称为:执行小步骤的例程(加载文件,调整一些位,写入输出)。

顶部的例程(解决问题的例程)是从解决问题的实际方法间接/抽象出来的,使它们能够更灵活地在以后以稍微不同的方式解决相同的问题。

It basically means that you should break your problem into smaller problems until the problems are easy to solve.

You break the problem into several layers :

  • routines that solve the problem
  • They call : routines that understand the problem space
  • They call : routines that do small steps (load a file, twiddle some bits, write an output).

The routines at the top (the problem solving ones) are indirected / abstracted from the actual means of solving the problem, making them more flexible to solve the same problem a slightly different way later.

情何以堪。 2024-07-16 02:04:40

首先我们必须了解添加间接级别的含义。

通常,添加间接级别意味着我们能够提供解决问题的替代方法,最好还具有一些额外的好处。 其他时候,当当前没有任何工作时,间接可能是我们唯一的解决方案。

例如,如果业务需求是“我们需要决定采购多大大小的 IP 块,以便为我们的所有站点提供 IP 寻址”。

问题是,如果我们选择的块太小,那么我们就需要买一个更大的块。 我们的管理员不仅必须获取另一个块,而且现在还必须在我们的路由表中注入额外的前缀才能访问我的站点。 这就需要额外的时间、成本和复杂性。 有没有更好的办法?

如今,IP 地址意味着您登录时的身份以及您所在的位置。

LISP 使用一定程度的间接来解决上述路由问题。

这样做需要一些成本:

  • 现在必须存在一个新的支持 LISP 的服务器来将地址映射到站点

  • 需要两个命名空间(一个用于 以及

一些额外的好处:

  • 添加新块时消除站点重新编号

  • 减少路由表的大小

  • 从一台主机移动到另一台主机)

  • 节省 IPV4 地址空间(未分配给主机的定位器地址空间)

  • 使用 LISP,ISP 可以为每个主机分配更少的地址 使用 LISP ,

下图显示了新的间接层:

在此处输入图像描述

LISP 通过添加新层来解决这个问题em>间接并简化了一些事情,但并不完全简单。 它是不同的,并且在很多方面都更好。

First we must understand what Adding Level of Indirection means.

Usually, Adding Level of Indirection means that we are able to provide an alternate way to solve a problem, ideally with some additional benefits. Other times, when nothing is currently working the indirection could be our only solution.

For example if the business need is, "We need to decide what size IP block to procure in order to provide IP addressing to all our sites."

The problem is that if we choose a block that is too small then we will need to get a bigger one. Not only must our administrator go get another block but the now an additional prefixes must be injected in our routing table to access my sites. That's extra time, cost and complexity. Is there a better way?

Today, an IP address means who you are when you login and where you are located.

LISP uses a level of indirection to solve the routing problem stated above.

It does so with some cost:

  • A new LISP capable server must now exist to map addresses to sites

  • Two namespaces are required (one for Location the other for ID)

And some additional benefits:

  • Eliminate the site renumbering when adding a new block

  • Reduction in size of routing tables

  • ISP can make changes (moving sites from one host to another)

  • Conserves IPV4 address space (locator address space not assigned to hosts)

  • With LISP an ISP can allocate fewer addresses per site

The image below shows the new layer of indirection:

enter image description here

LISP solves the problem by adding a new layer of indirection and simplifies some things, but is not altogether simpler. It's different and in many ways better.

坚持沉默 2024-07-16 02:04:40

这是一个非常重要的概念,但这里的答案却很少。 一般来说,提出的每个问题不一定可以通过直接代码调整来解决,而是以某种形式应用一些代理(忘记模式定义)。 拦截&| 事件的仪器化被严重低估。

Such a very important concept and so few answers here. Generally every problem presented can be solved not necessarily by direct code adjustments but applying some proxy (forget the pattern definition) in some form. The interception &| instrumentation of events is highly undervalued.

隐诗 2024-07-16 02:04:40

这句话的含义非常广泛。 理解的关键是关注“问题”这个词。 问题可以是编程问题/错误,将世界实体转换为其等效的计算组件,与计算解决方案相关的成本。 假设您正在尝试通过自己开发某些东西的成本来解决问题,您可能需要考虑其他专家来为您完成这项工作,在时间和金钱上要便宜得多。 这是间接的另一种用法

This quote is very broad in its implication. The key to understanding is to focus on the word 'problem'. Problem can be a programming issue/bug, translating a world entity to its equivalent computing component, cost associating with computing solution. Lets say you're trying to solve the issue with cost of developing something yourself, you may want to consider another experts to do the work for you much cheaper in time and money. This is another use of indirection

孤独患者 2024-07-16 02:04:40

它源自 Bulter Lampson

“计算机科学中的所有问题都可以通过另一级间接解决”

这显然是一句格言,不能按字面意思理解。 这当然不是一个可证明的定理。

It originates from Bulter Lampson:

"All problems in computer science can be solved by another level of indirection"

It is clearly an aphorism and not intended to be taken literally. It is certainly not a provable theorem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文