关于“简单设计”的引文的阐述
A Simple Design : Antonie de Saint-Exupery,
the Fresh writer and aircraft designer, said that,
*"A designer knows he has arrived at perfection
not when there is no longer anything to add,
but when there is no longer anything to take away."*
More programmers should judge their work by this criteria.
请问有人可以详细说明一下吗?
当作者说“...带走”时,他的意思是什么?
An excerpt from Programming Perls:
A Simple Design : Antonie de Saint-Exupery,
the Fresh writer and aircraft designer, said that,
*"A designer knows he has arrived at perfection
not when there is no longer anything to add,
but when there is no longer anything to take away."*
More programmers should judge their work by this criteria.
Can any one elaborate this, please?
What does the author mean when he say "...TAKE AWAY"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
带走部分意味着如果剩下的都是必要的组件,那么设计可以被认为是简单的,如果你拿走任何东西,它就不起作用。
the Take Away part means that the design can be considered simple if all that remains are essential components, if you take away anything, it won't work.
基本上,这意味着当您无法进一步简化它时,您就完成了。
Basically it means when you can't simplify it any further, you are done.
作者的意思是简约中蕴藏着优雅。
早在计算机出现之前,安东尼·德·圣埃克苏佩里就不是一名程序员,而是一名作家和工程师(他写了《小王子》)。
The author means there is elegance in simplicity.
Antoine de Saint-Exupery was not a programmer, but a writer and engineer, long before computers were around (he wrote "The little prince").
就编程而言,这意味着删除代码行。原则是你应该努力寻求当然正确的解决方案,但也要优雅、简单等。
这样做有很多好处,但对于初学者来说,更少的代码使你的程序更容易维护,因为它们对于任何阅读它们的人来说都更容易理解。它还可以提供更大的灵活性,因为在修改更简单的解决方案时,您需要更改的代码更少,并且可以更加确信您的更改没有破坏应用程序的其他部分。
In terms of programming, it would mean deleting lines of code. The principle being that you should strive for solutions that are of course correct, but also elegant, simple, etc.
There are many benefits of this, but for starters having less code makes your programs easier to maintain, since they are easier for anyone reading them to understand. It can also allow for more flexibility, since when modifying a simpler solution you have less code to change, and can be more confident that your changes have not broken other parts of the application.
这是一个很好的原则的优雅表达方式——“让你的代码尽可能简单”。
但请注意不要误解这一点 - 重点是消除设计复杂性,而不是减少打字。需要去掉的好东西的示例有:
需要去掉的坏东西:
变量和函数名
将代码库分成
清晰定义的模块(如果您愿意,可以将其视为未来可维护性的“基本功能”)
It's an elegant way of expressing what is a very good principle - "make your code as simple as possible".
Be careful not to misinterpret this however - the point is to take away design complexity, not do less typing. Example of good things to take away are:
Bad things to take away:
variable and function names
separate the code base into
cleanly defined modules (if you like you can consider this an "essential feature" for future maintainability)