编程引言
A good programmer is someone who looks both ways before crossing a one-way street. — Doug Linder, systems administrator
好的程序员这样一类人,这类人在横穿一条单行道前都要先看一下路两边。– Doug Linder, 系统管理员
A most important, but also most elusive, aspect of any tool is its influence on the habits of those who train themselves in its use. If the tool is a programming language this influence is, whether we like it or not, an influence on our thinking habits. — Edsger Dijkstra, computer scientist
关于工具,一个最重要的,也是最不易察觉的方面是,工具对使用此工具的人的习惯的潜移默化的影响。如果这个工具是一门程序语言,不管我们是否喜欢它,它都会影响我们的思维惯式。 –Edsger Dijkstra, 著名的计算机科学家。
Being abstract is something profoundly different from being vague… The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise. — Edsger Dijkstra
抽象和模糊完全地不同,抽象的目的并不是把事情变模糊,而去创建一个新的语义层,在那里是绝对精确的描述。 — Edsger Dijkstra
Commentary: most debugging problems are fixed easily; identifying the location of the problem is hard. — unknown
修复bug很容易,但是定位bug却很困难 – 匿名
Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?’ Improve the code and then document it to make it even clearer. — Steve McConnell, software engineer and author, from Code Complete
好的代码自己本身就是最好的文档。当你打算加注释的时候,问问自己‘我如何才能把我的代码改善到不需增加注释?’重构自己的代码,然后使文档让其更清楚。 — Steve McConnell《代码大全》的作者
More good code has been written in languages denounced as bad than in languages proclaimed wonderful — much more. — Bjarne Stroustrup, from The Design and Evolution of C++
好的代码都都在的批评声中写成的,而差的则是在表杨声中写成的。——Bjarne Stroustrup, 摘自《The Design and Evolution of C++》
Programs must be written for people to read, and only incidentally for machines to execute. — Harold Abelson and Gerald Jay Sussman, computer scientists and authors, from The Structure and Interpretation of Computer Programs
代码应该是写给其他人来读的,而能让机器运行的仅仅是附带着的。—— Harold Abelson 与 Gerald Jay Sussman, 计算机科学家和作家,摘自《The Structure and Interpretation of Computer Programs》
Simplicity is prerequisite for reliability. — Edsger Dijkstra
简单是可靠的前提条件 — 迪杰斯特拉
过早的优化是万恶之源。Premature optimization is the root of all evil!
– Donald Knuth
调试程序的难度是写代码的两倍。因此,只要你的代码写的尽可能的清楚,那么你在调试代码时就不需要那么地有技巧。Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
– Brian Kernighan
Most comments in code are in fact a pernicious form of code duplication.
注释应该是注释Why,而不是How和What,参看《惹恼程序员的十件事》,代码告诉你How,而注释应该告诉你Why。但大多数的程序并不知道什么是好的注释,那些注释其实和code是重复的,毫无意义。
If you only know one language, no matter how well you know it, you’re not a great programmer.
如果你只懂一种语言,准确的说,如果你只懂一类语类,如:Java和C#,PHP和Perl,那么,你将会被局限起来,只有了解了各种各样的语言,了解了不同语言的不同方法 ,你才会有比较,只有了比较,你才会明白各种语言的长处和短处,才会让你有更为成熟的观点,而且不整天和别的程序在网上斗嘴争论是Windows好还是Unix好,是C好还是C++好,有这点工夫能干好多事了。世界因为不同而精彩,只知道事物的一面是有害的。
参考 https://blog.csdn.net/haoel/article/details/5873528