2014年/09月/05日
两篇对代码美学的观点
Code should be, as a #1 priority, maintainable; which means that
I should be able to read and understand existing code quickly; which implies that
The language should provide unambiguous ways of doing things; or, conversely
The language should not allow programmers to do one thing in N ways.
可维护是第一优先级
快速阅读理解
明确的做事方式
一件事情不许有n种方式
beauty of programming is creativity expressed from simple rules;
编程的美是由简单规则表达的创造力
美国程序员普遍认为,编码和音乐制作之间存在高度相关性,即许多编码员都是音乐家,这在美国程序员中颇为普遍
Matz着重于程序员的幸福感,明确表达了对Donald Knuth的文学编程的忠诚
The general lesson that I take away from this bug is humility: It is hard to write even the smallest piece of code correctly, and our whole world runs on big, complex pieces of code.
Careful design is great. Testing is great. Formal methods are great. Code reviews are great. Static analysis is great. But none of these things alone are sufficient to eliminate bugs: They will always be with us. A bug can exist for half a century despite our best efforts to exterminate it.
我从这个错误中获得的一般教训是谦虚:即使正确编写最小的代码也很难,而且我们的整个世界都在庞大而复杂的代码上运行。
精心的设计很棒。测试很棒。形式方法很棒。代码审查很棒。静态分析很棒。但是,仅凭这些事情还不足以消除错误:它们将永远伴随着我们。尽管我们已尽力消除了一个错误,但它仍然可以存在半个世纪。