这些编程警句摘自《C语言程序设计——现代方法》。而此书的又是从Alan J. Perlis的《Epigrams On Programming》中摘录,并且这些警句来自1982年。html
此书每章首摘录一句,一共26句。ios
若是有人说“我想要一种语言,只需对它说我要干什么就行”,给他一支棒棒糖好了。程序员
When someone says "I want a programming language in which I need only say what I wish done," give him a lollipop.
这让我想起prolog逻辑式语言,同时想起王垠的Prolog与人工智能的没落。sql
某我的的常量多是其余人的变量。编程
One man's constant is another man's variable.
在探索难以实现的问题时,简化是惟一的办法。数据结构
人不是经过用计算器学会的计算,但倒是靠此手段忘记了算术。nosql
One does not learn computing by using a hand calculator, but one can forget arithmetic.
不该用以聪明才智和逻辑分析能力来评判程序员,而要看其分析问题的全面性。编程语言
是否是应该讨论下招聘及KPI? :P模块化
不值得编写没有循环和结构化变量的程序。函数
A program without a loop and a structured variable isn't worth writing.
请别搞错:计算机处理的是数而不是符号。咱们用对活动算术化的程序来衡量咱们的理解力(和控制力)。
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.
若是程序操纵着大量的数据,那它必定是用较少的方法办到的。
If a program manipulates a large amount of data, it does so in a small number of ways.
想到如今的大数据。虽然,我尚未接触Hadoop。
若是你有一个带了10个参数的过程,那么你极可能还遗漏了一些参数。
If you have a procedure with 10 parameters, you probably missed some.
正如罗杰斯可能会说的那样:“没有像自由变量这样的东西。”
As Will Rogers would have said, "There is no such thing as a free variable."
who's 罗杰斯?
我忘记了第十一条戒律是“你应该计算”,仍是“你不该该计算”。
The 11th commandment was "Thou Shalt Compute" or "Thou Shalt Not Compute" - I forget which.
优化阻碍发展。
Optimization hinders evolution.
很难从字符串中找到感受,但它们倒是咱们能期望的惟一交流纽带。
It's difficult to extract sense from strings, but they're the only communication coin we can count on.
在程序里咱们始终有话要说,可是全部已知的语言都没法表达得很好。
There will always be things we wish to say in our programs that in all known languages can only be said poorly.
很难找到正确的时间单位来衡量计算机的发展。有些大教堂用了一个世纪才建成。你能想象一个壮丽辉煌的大程序也能花这么长的时间吗?
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?
函数延迟绑定:数据结构致使绑定。记住:在编程过程后期再结构化数据。
Functions delay binding: data structures induce binding. Moral: Structure data late in the programming process.
人们只会在脑海显示复杂的信息。好比看,静景不管多么生动,都不如景色的运动、流动和改变重要。
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.
让一些事情可变很容易,而掌控不变的期限则须要技巧。
只要有模块化就有可能发生误解:隐藏信息意味着须要检查沟通。
Wherever there is modularity there is the potential for misunderstanding: Hiding information implies a need to check communication.
当程序要求关注不相干的内容时,所用的编程语言就是低级的。
A programming language is low level when its programs require attention to the irrelevant.
每一个程序都是某些其余程序的一部分,但不多是正合适的。
Every program is a part of some other program and rarely fits.
在人机共生的世界中,必须调整的是人:机器是没法调整的。
In man-machine symbiosis, it is man who must adjust: The machines can't.
与计算机过长时间的接触把数学家变成了书记员,反之亦然。
Prolonged contact with the computer turns mathematicians into clerks and vice versa.
编写无错程序的方法有两种:但只有用第三种方法写的程序才行得通。
Every program has (at least) two purposes: the one for which it was written and another for which it wasn't.
哈,意指不可能写出无错的程序。
若是您的计算机说英语,那么它可能产自日本。
If your computer speaks English it was probably made in Japan.
肯定程序参数的应用是用户,而不该该是它们的创造者。
It is the user who should parameterize procedures, not their creators.
这让我想到TDD。严格的测试驱动会强迫你既是代码的创造者,同时也是使用者。
关于C语言的书。你们都知道K&R的那本《C语言程序设计》,我也在里奇过世的时候买了一本,我看完了,可是对如何将C应用到实际项目中,没有指导做用。后来,我又找到了《C语言程序设计——现代方法》。我只能说与“现代方法”比起来,K&R那本只能用来作收藏。
“现代方法”,对“K&R”也有所评论:随着C语言的迅速普及,一系列问题也接踵而至。编写新的C语言编译器的程序员们都把“K&R”做为参考。可是遗憾的是,“K&R”对一些语言特性的描述很是模糊,以致于编译器经常会对这些特征进行不一样的处理。并且,“K&R”也没有属于C语言的特性和属于UNIX系统的内容进行明确的区分。况且在“K&R”出版之后,C语言仍在不断变化,增长了新特性而且去除了少许过期的特性。
关于编程警句,原文一共有130句,惋惜,我英语水平不足以翻译得好,期待牛人编译。