编程警句 by Alan J. Perlis

本文翻译自 Yale CS Alan J. Perlis - Epigrams in Programming,作者 Alan J. Perlis。


  1. One man’s constant is another man’s variable.

    汝之常量,彼之变量。

  2. Functions delay binding: data structures induce binding. Moral: Structure data late in the programming process.

    函数延迟绑定;数据结构促成绑定。箴言:编程后期再构建数据。

  3. Syntactic sugar causes cancer of the semi-colons.

    语法糖导致了分号癌。

  4. Every program is a part of some other program and rarely fits.

    每个程序都是其他程序的一部分,而且很少能完美适配。

  5. If a program manipulates a large amount of data, it does so in a small number of ways.

    如果一个程序操作大量数据,它只会通过少数几种方式进行。

  6. Symmetry is a complexity reducing concept (co-routines include sub-routines); seek it everywhere.

    对称是降低复杂度的概念(协程包含子例程);处处寻求对称。

  7. It is easier to write an incorrect program than understand a correct one.

    写一个不正确的程序比理解一个正确的程序更容易。

  8. A programming language is low level when its programs require attention to the irrelevant.

    当一门编程语言的程序需要关注无关紧要的细节时,它就是低级的。

  9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.

    100个函数操作1个数据结构,胜过10个函数操作10个数据结构。

  10. Get into a rut early: Do the same processes the same way. Accumulate idioms. Standardize. The only difference (!) between Shakespeare and you was the size of his idiom list - not the size of his vocabulary.

    尽早形成套路:用同样的方式处理同样的流程。积累惯用法,并将其标准化。你与莎士比亚唯一的区别(!)在于他的惯用法列表的大小,而不是他的词汇量。

  11. If you have a procedure with 10 parameters, you probably missed some.

    如果你的一个过程有10个参数,你可能遗漏了某些。

  12. Recursion is the root of computation since it trades description for time.

    递归是计算之根,因为它用描述换取时间。

  13. If two people write exactly the same program, each should be put in micro-code and then they certainly won’t be the same.

    如果两个人写出完全相同的程序,应该把每个人都写进微码,那样他们就肯定不一样了。

  14. In the long run every program becomes rococo - then rubble.

    从长远来看,每个程序都会变得华而不实——然后化为瓦砾。

  15. Everything should be built top-down, except the first time.

    除了第一次,一切都应该自顶向下构建。

  16. Every program has (at least) two purposes: the one for which it was written and another for which it wasn’t.

    每个程序(至少)有两个目的:一个是它被编写出来的目的,另一个是它没被编写出来的目的。

  17. If a listener nods his head when you’re explaining your program, wake him up.

    如果你在解释你的程序时,听众在点头,叫醒他。

  18. A program without a loop and a structured variable isn’t worth writing.

    一个没有循环和结构化变量的程序不值得写。

  19. A language that doesn’t affect the way you think about programming, is not worth knowing.

    一门不影响你编程思维方式的语言,不值得学习。

  20. Wherever there is modularity there is the potential for misunderstanding: Hiding information implies a need to check communication.

    哪里有模块化,哪里就有误解的可能:信息隐藏意味着需要检查通信。

  21. Optimization hinders evolution.

    优化阻碍进化。

  22. A good system can’t have a weak command language.

    一个好的系统不能有一个弱的命令语言。

  23. To understand a program you must become both the machine and the program.

    要想理解一个程序,你必须同时成为机器和程序。

  24. Perhaps if we wrote programs from childhood on, as adults we’d be able to read them.

    也许如果我们从小就编写程序,成年后我们就能读懂它们了。

  25. One can only display complex information in the mind. Like seeing, movement or flow or alteration of view is more important than the static picture, no matter how lovely.

    人们只能在头脑中展示复杂的信息。就像看东西一样,运动、流动或视角的改变比静态的画面更重要,无论画面多么可爱。

  26. There will always be things we wish to say in our programs that in all known languages can only be said poorly.

    在我们的程序中,总会有一些我们希望表达的东西,但在所有已知语言中都只能蹩脚地表达。

  27. Once you understand how to write a program get someone else to write it.

    一旦你明白了如何编写一个程序,就让别人去写吧。

  28. Around computers it is difficult to find the correct unit of time to measure progress. Some cathedrals took a century to complete. Can you imagine the grandeur and scope of a program that would take as long?

    在计算机周围,很难找到衡量进步的正确时间单位。有些大教堂花了一个世纪才完工。你能想象一个需要同样长时间的程序的宏伟和规模吗?

  29. For systems, the analogue of a face-lift is to add to the control graph an edge that creates a cycle, not just an additional node.

    对于系统来说,类似于“整容”的操作是在控制图中添加一条能产生循环的边,而不仅仅是增加一个节点。

  30. In programming, everything we do is a special case of something more general - and often we know it too quickly.

    在编程中,我们所做的一切都是更普遍事物的特例——而且我们常常过快地知道这一点。

  31. Simplicity does not precede complexity, but follows it.

    简单并非先于复杂,而是随之而来。

  32. Programmers are not to be measured by their ingenuity and their logic but by the completeness of their case analysis.

    衡量程序员的标准不是他们的聪明才智和逻辑,而是他们案例分析的完备性。

  33. The 11th commandment was “Thou Shalt Compute” or “Thou Shalt Not Compute” - I forget which.

    第十一条诫命是“你应该计算”还是“你不应该计算”——我忘了是哪个。

  34. The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information.

    字符串是一种简陋的数据结构,无论它被传递到哪里,都会产生大量的重复处理。它是隐藏信息的完美载体。

  35. Everyone can be taught to sculpt: Michelangelo would have had to be taught how not to. So it is with the great programmers.

    每个人都可以被教导如何雕塑:而米开朗基罗则必须被教导如何“不”去雕塑。伟大的程序员也是如此。

  36. The use of a program to prove the 4-color theorem will not change mathematics - it merely demonstrates that the theorem, a challenge for a century, is probably not important to mathematics.

    使用程序来证明四色定理不会改变数学——它仅仅表明这个挑战了一个世纪的定理,可能对数学并不重要。

  37. The most important computer is the one that rages in our skulls and ever seeks that satisfactory external emulator. The standardization of real computers would be a disaster - and so it probably won’t happen.

    最重要的计算机是我们头颅中那台狂暴的机器,它永远在寻找那个令人满意的外部模拟器。真实计算机的标准化将是一场灾难——所以它可能不会发生。

  38. Structured Programming supports the law of the excluded muddle.

    结构化编程支持“排除混乱”定律。

  39. Re graphics: A picture is worth 10K words - but only those to describe the picture. Hardly any sets of 10K words can be adequately described with pictures.

    关于图形:一图胜过千言——但仅限于描述这幅图的那些话。几乎没有任何一组一万个词可以用图片来充分描述。

  40. There are two ways to write error-free programs; only the third one works.

    有两种方法可以编写无错误的程序;但只有第三种才有效。

  41. Some programming languages manage to absorb change, but withstand progress.

    有些编程语言能够吸收变化,但却抵制进步。

  42. You can measure a programmer’s perspective by noting his attitude on the continuing vitality of FORTRAN.

    你可以通过观察一个程序员对FORTRAN持续生命力的态度来衡量他的视野。

  43. In software systems it is often the early bird that makes the worm.

    在软件系统中,通常是早起的鸟儿制造了虫子。

  44. Sometimes I think the only universal in the computing field is the fetch-execute-cycle.

    有时我认为计算领域唯一普遍存在的就是“取指-执行”周期。

  45. The goal of computation is the emulation of our synthetic abilities, not the understanding of our analytic ones.

    计算的目标是模拟我们的综合能力,而不是理解我们的分析能力。

  46. Like punning, programming is a play on words.

    像双关语一样,编程是一种文字游戏。

  47. As Will Rogers would have said, “There is no such thing as a free variable.”

    正如威尔·罗杰斯会说的,“没有免费的变量这种东西。”

  48. The best book on programming for the layman is “Alice in Wonderland”; but that’s because it’s the best book on anything for the layman.

    对外行来说,最好的编程书籍是《爱丽丝梦游仙境》;但这是因为它本身就是写给外行的最好的书。

  49. Giving up on assembly language was the apple in our Garden of Eden: Languages whose use squanders machine cycles are sinful. The LISP machine now permits LISP programmers to abandon bra and fig-leaf.

    放弃汇编语言就像我们伊甸园里的苹果:使用浪费机器周期的语言是有罪的。LISP机器现在允许LISP程序员抛弃胸罩和遮羞布。

  50. When we understand knowledge-based systems, it will be as before - except our finger-tips will have been singed.

    当我们理解了基于知识的系统时,一切将和以前一样——除了我们的指尖会被烧焦。

  51. Bringing computers into the home won’t change either one, but may revitalize the corner saloon.

    把电脑带回家既不会改变家庭,也不会改变电脑,但可能会让街角的酒吧重新焕发生机。

  52. Systems have sub-systems and sub-systems have sub-systems and so on ad infinitum - which is why we’re always starting over.

    系统有子系统,子系统又有子系统,如此无限循环——这就是为什么我们总是在重新开始。

  53. So many good ideas are never heard from again once they embark in a voyage on the semantic gulf.

    许多好主意一旦踏上语义鸿沟的航程,就再也听不到了。

  54. Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy.

    小心图灵焦油坑,在里面一切皆有可能,但有趣的事情都不容易。

  55. A LISP programmer knows the value of everything, but the cost of nothing.

    LISP程序员知道一切的价值,却不知道任何东西的成本。

  56. Software is under a constant tension. Being symbolic it is arbitrarily perfectible; but also it is arbitrarily changeable.

    软件处于持续的张力之下。作为符号性的,它可以任意完善;但它也可以任意改变。

  57. It is easier to change the specification to fit the program than vice versa.

    改变需求以适应程序比反过来更容易。

  58. Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.

    傻瓜忽视复杂性。实用主义者忍受它。有些人能避免它。天才则消除它。

  59. In English every word can be verbed. Would that it were so in our programming languages.

    在英语中,每个词都可以动词化。要是我们的编程语言也能这样就好了。

  60. Dana Scott is the Church of the Lattice-Way Saints.

    丹纳·斯科特是格路圣徒教会的。

  61. In programming, as in everything else, to be in error is to be reborn.

    在编程中,就像在其他任何事情中一样,犯错就是重生。

  62. In computing, invariants are ephemeral.

    在计算中,不变量是短暂的。

  63. When we write programs that “learn”, it turns out we do and they don’t.

    当我们编写“学习”的程序时,结果是我们学了,而它们没有。

  64. Often it is means that justify ends: Goals advance technique and technique survives even when goal structures crumble.

    通常是手段证明目的的正当性:目标推动技术,而技术即使在目标结构崩溃时也能幸存下来。

  65. Make no mistake about it: Computers process numbers - not symbols. We measure our understanding (and control) by the extent to which we can arithmetize an activity.

    别搞错了:计算机处理的是数字,而不是符号。我们通过能在多大程度上将一项活动算术化的程度来衡量我们的理解(和控制)。

  66. Making something variable is easy. Controlling duration of constancy is the trick.

    让某些东西可变很容易。控制恒定期的持续时间才是诀窍。

  67. Think of all the psychic energy expended in seeking a fundamental distinction between “algorithm” and “program”.

    想想为了寻找“算法”和“程序”之间的根本区别而耗费的所有精神能量。

  68. If we believe in data structures, we must believe in independent (hence simultaneous) processing. For why else would we collect items within a structure? Why do we tolerate languages that give us the one without the other?

    如果我们相信数据结构,我们就必须相信独立的(因此是并行的)处理。否则我们为什么要在一个结构中收集项目呢?为什么我们能容忍那些只给我们其一而不给其二的语言?

  69. In a 5 year period we get one superb programming language. Only we can’t control when the 5 year period will begin.

    在一个5年周期内,我们会得到一门极好的编程语言。只是我们无法控制这个5年周期何时开始。

  70. Over the centuries the Indians developed sign language for communicating phenomena of interest. Programmers from different tribes (FORTRAN, LISP, ALGOL, SNOBOL, etc.) could use one that doesn’t require them to carry a blackboard on their ponies.

    几个世纪以来,印第安人发展了手语来交流感兴趣的现象。来自不同部落(FORTRAN、LISP、ALGOL、SNOBOL等)的程序员可以使用一种不需要他们在小马上携带黑板的语言。

  71. Documentation is like term insurance: It satisfies because almost no one who subscribes to it depends on its benefits.

    文档就像定期保险:它令人满意,因为几乎没有订阅它的人依赖于它的好处。

  72. An adequate bootstrap is a contradiction in terms.

    一个“足够”的引导程序本身就是个矛盾的说法。

  73. It is not a language’s weaknesses but its strengths that control the gradient of its change: Alas, a language never escapes its embryonic sac.

    控制一门语言变化梯度的不是它的弱点,而是它的优点:唉,一门语言永远无法摆脱它的胚胎囊。

  74. It is possible that software is not like anything else, that it is meant to be discarded: that the whole point is to always see it as soap bubble?

    软件可能不像其他任何东西,它注定要被丢弃:难道关键就在于永远把它看作一个肥皂泡吗?

  75. Because of its vitality, the computing field is always in desperate need of new cliches: Banality soothes our nerves.

    由于其活力,计算领域总是迫切需要新的陈词滥调:平庸能抚慰我们的神经。

  76. It is the user who should parameterize procedures, not their creators.

    应该由用户来参数化过程,而不是它们的创建者。

  77. The cybernetic exchange between man, computer and algorithm is like a game of musical chairs: The frantic search for balance always leaves one of the three standing ill at ease.

    人、计算机和算法之间的控制论交换就像一场抢椅子的游戏:疯狂地寻找平衡总是让三者之一尴尬地站着。

  78. If your computer speaks English it was probably made in Japan.

    如果你的电脑说英语,它很可能是在日本制造的。

  79. A year spent in artificial intelligence is enough to make one believe in God.

    在人工智能领域花一年时间,足以让人相信上帝的存在。

  80. Prolonged contact with the computer turns mathematicians into clerks and vice versa.

    长期接触计算机会让数学家变成文员,反之亦然。

  81. In computing, turning the obvious into the useful is a living definition of the word “frustration”.

    在计算中,把显而易见的东西变成有用的东西,是“挫折”这个词的活生生的定义。

  82. We are on the verge: Today our program proved Fermat’s next-to-last theorem!

    我们正处于边缘:今天我们的程序证明了费马的倒数第二个定理!

  83. What is the difference between a Turing machine and the modern computer? It’s the same as that between Hillary’s ascent of Everest and the establishment of a Hilton hotel on its peak.

    图灵机和现代计算机有什么区别?这就像希拉里登上珠穆朗玛峰和在峰顶建一家希尔顿酒店的区别。

  84. Motto for a research laboratory: What we work on today, others will first think of tomorrow.

    研究室的座右铭:我们今天研究的,别人明天才会想到。

  85. Though the Chinese should adore APL, it’s FORTRAN they put their money on.

    虽然中国人应该崇拜APL,但他们把钱押在了FORTRAN上。

  86. We kid ourselves if we think that the ratio of procedure to data in an active data-base system can be made arbitrarily small or even kept small.

    如果我们认为活动数据库系统中过程与数据的比例可以任意小甚至保持很小,那我们是在自欺欺人。

  87. We have the mini and the micro computer. In what semantic niche would the pico computer fall?

    我们有迷你计算机和微型计算机。那么皮可计算机会落在哪个语义生态位呢?

  88. It is not the computer’s fault that Maxwell’s equations are not adequate to design the electric motor.

    麦克斯韦方程组不足以设计电动机,这不是计算机的错。

  89. One does not learn computing by using a hand calculator, but one can forget arithmetic.

    人们不会通过使用手持计算器来学习计算,但会忘记算术。

  90. Computation has made the tree flower.

    计算使树开花。

  91. The computer reminds one of Lon Chaney - it is the machine of a thousand faces.

    计算机让人想起朗·钱尼——它是一台千面机器。

  92. The computer is the ultimate polluter. Its feces are indistinguishable from the food it produces.

    计算机是终极污染者。它的排泄物与它生产的食物无法区分。

  93. When someone says “I want a programming language in which I need only say what I wish done,” give him a lollipop.

    当有人说“我想要一种编程语言,我只需要说出我希望做什么就行了”,给他一根棒棒糖。

  94. Interfaces keep things tidy, but don’t accelerate growth: Functions do.

    接口保持整洁,但不能加速增长:函数可以。

  95. Don’t have good ideas if you aren’t willing to be responsible for them.

    如果你不愿意为好主意负责,就不要有好主意。

  96. Computers don’t introduce order anywhere as much as they expose opportunities.

    计算机与其说是在任何地方引入秩序,不如说是在暴露机会。

  97. When a professor insists computer science is X but not Y, have compassion for his graduate students.

    当一位教授坚持认为计算机科学是X而不是Y时,请同情他的研究生。

  98. In computing, the mean time to failure keeps getting shorter.

    在计算领域,平均无故障时间越来越短。

  99. In man-machine symbiosis, it is man who must adjust: The machines can’t.

    在人机共生中,必须调整的是人:机器不能。

  100. We will never run out of things to program as long as there is a single program around.

    只要还有一个程序存在,我们就永远不会没有东西可编。

  101. Dealing with failure is easy: Work hard to improve. Success is also easy to handle: You’ve solved the wrong problem. Work hard to improve.

    处理失败很容易:努力改进。处理成功也很容易:你解决了错误的问题。努力改进。

  102. One can’t proceed from the informal to the formal by formal means.

    人们无法通过形式化的手段从非形式化走向形式化。

  103. Purely applicative languages are poorly applicable.

    纯应用型语言的适用性很差。

  104. The proof of a system’s value is its existence.

    一个系统价值的证明就是它的存在。

  105. You can’t communicate complexity, only an awareness of it.

    你无法传达复杂性,只能传达对它的意识。

  106. It’s difficult to extract sense from strings, but they’re the only communication coin we can count on.

    从字符串中提取意义很困难,但它们是我们唯一可以依赖的交流货币。

  107. The debate rages on: Is PL/I Bactrian or Dromedary?

    辩论仍在继续:PL/I是双峰驼还是单峰驼?

  108. Whenever two programmers meet to criticize their programs, both are silent.

    每当两个程序员见面批评他们的程序时,两人都沉默不语。

  109. Think of it! With VLSI we can pack 100 ENIACs in 1 sq.cm.

    想想看!通过VLSI,我们可以在1平方厘米内封装100个ENIAC。

  110. Editing is a rewording activity.

    编辑是一种改写活动。

  111. Why did the Roman Empire collapse? What is the Latin for office automation?

    罗马帝国为什么会崩溃?办公自动化的拉丁语是什么?

  112. Computer Science is embarrassed by the computer.

    计算机科学为计算机感到尴尬。

  113. The only constructive theory connecting neuroscience and psychology will arise from the study of software.

    唯一连接神经科学和心理学的建设性理论将来自对软件的研究。

  114. Within a computer natural language is unnatural.

    在计算机内部,自然语言是不自然的。

  115. Most people find the concept of programming obvious, but the doing impossible.

    大多数人觉得编程的概念显而易见,但实践起来却不可能。

  116. You think you know when you learn, are more sure when you can write, even more when you can teach, but certain when you can program.

    当你学习时,你以为你知道了;当你能写作时,你更确定了;当你能教书时,你更加确定;但当你能编程时,你就确信无疑了。

  117. It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical?

    教孩子们编程与现代教育的理念背道而驰。制定计划、培养组织思想的纪律、关注细节和学会自我批评有什么乐趣呢?

  118. If you can imagine a society in which the computer-robot is the only menial, you can imagine anything.

    如果你能想象一个计算机机器人是唯一仆人的社会,你就能想象任何事情。

  119. Programming is an unnatural act.

    编程是一种不自然的行为。

  120. Adapting old programs to fit new machines usually means adapting new machines to behave like old ones.

    使旧程序适应新机器通常意味着使新机器表现得像旧机器。

  121. In seeking the unattainable, simplicity only gets in the way.

    在追求遥不可及的目标时,简单只会碍事。


  1. If there are epigrams, there must be meta-epigrams.

    如果有警句,就一定有元警句。

  2. Epigrams are interfaces across which appreciation and insight flow.

    警句是欣赏和洞察力流动的接口。

  3. Epigrams parameterize auras.

    警句参数化气场。

  4. Epigrams are macros, since they are executed at read time.

    警句是宏,因为它们在阅读时执行。

  5. Epigrams crystallize incongruities.

    警句使不协调之处结晶。

  6. Epigrams retrieve deep semantics from a data base that is all procedure.

    警句从一个全是过程的数据库中检索深层语义。

  7. Epigrams scorn detail and make a point: They are a superb high-level documentation.

    警句蔑视细节,直击要点:它们是极好的高级文档。

  8. Epigrams are more like vitamins than protein.

    警句更像维生素而不是蛋白质。

  9. The last epigram? Neither eat nor drink them, snuff epigrams.

    最后一句警句?不要吃也不要喝,去品味警句。

comments powered by Disqus

2025-07-07


On this page: