数学研发论坛

 找回密码
 欢迎注册
查看: 4856|回复: 14

[分享] 最佳编程语录

[复制链接]
发表于 2010-11-11 12:05:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?欢迎注册

x
  • 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
  • Besides a mathematical inclination, an exceptionally good mastery of one’s native tongue is the most vital asset of a competent programmer. — Edsger Dijkstra

    除了数学爱好,对于一个有能力的程序员来说,出色地掌握自己的母语是最宝贵的财富。– Edsger Dijkstra
  • C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. — Bjarne Stroustrup, developer of the C++ programming language

    C很容易使你搬起石头砸自己的脚,而C++把这事变得更难,但是如果一定要这么做,那么你的整条腿都会被炸飞 -Bjarne Stroustrup, C++语言的发明者
  • Commentary: most debugging problems are fixed easily; identifying the location of the problem is hard. — unknown

    修复bug很容易,但是定位bug却很困难 – 匿名
  • Considering the current sad state of our computer programs, software development is clearly still a black art, and cannot yet be called an engineering discipline. — Bill Clinton, former President of the United States

    看看当前计算机程序糟糕的事态,软件开发明显一直是一门妖术,其仍然不能被称为一个工程学。 –比尔.克林顿 美国前总统
  • For a long time it puzzled me how something so expensive, so leading edge, could be so useless, and then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match. — Bill Bryson, author, from Notes from a Big Country

    长期以来,有个事一直困扰着我,那就是越是昂贵的,越是前沿的,就越可能是没用的。然后,困扰我的另一个事是,计算机是一个死的机器,却可以不可思议地去完成那些巧妙的事情,而计算机程序员是那么聪明人却在做着不可思议的愚蠢的事情,简而言之,他们真是天生的一对。– Bill Bryson旅游文学作家 Big Country中的笔记
  • Given enough eyeballs, all bugs are shallow (e.g., given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and the fix obvious to someone). — Eric S. Raymond, programmer and advocate of open source software, from The Cathedral and the Bazaar

    足够多的眼睛,就可让所有问题浮现(比如:只要给于足够多的beta测试者和开发人员一起工作,那么,几所所有的问题都会很快的出现,而修正也会是显而易见的)
  • 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《代码大全》的作者
  • Hey! It compiles! Ship it! — unknown

    嘿,编译通过了!出货!–匿名
  • Inside every well-written large program is a well-written small program. — Charles Antony Richard Hoare, computer scientist

    在每个编写精良的大程序里面都是一个编写精良的小程序。 –Charles Antony Richard Hoare,计算机科学家
  • It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter. — Nathaniel S. Borenstein, computer scientist

    需要注意的是,没有哪个经过规范培训的工程师会赞成写一个DestoryBaghdad(摧毁巴克达)的函数。最基本的职业规范会告诉他们应该去写一个叫DestoryCity的函数,然后把“Baghdad”(巴克达)当成这个函数的参数。—— Nathaniel S. Borenstein, 计算机科学家
  • Managing programmers is like herding cats. — unknown

    管理程序员就如同养一群猫一样 –匿名
  • Measuring programming progress by lines of code is like measuring aircraft building progress by weight. — Bill Gates, co-founder of Microsoft Corporation

    用代码行数来衡量编程的进度,就如同用航空器零件的重量来衡量航空飞机的制造进度一样。——Bill Gates,微软创始人
  • 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》
  • Real programmers don’t comment their code. If it was hard to write, it should be hard to understand. — unknown

    真正程序员从来不写代码的注释,如果代码非常难写,那么同样代码的注释也会非常难懂 –匿名
  • Simplicity is prerequisite for reliability. — Edsger Dijkstra

    简单是可靠的前提条件 — 迪杰斯特拉
  • The C programming language — a language which combines the flexibility of assembly language with the power of assembly language. — unknown

    C语言—— 一门同时具有了汇编语言灵活性和汇编语言强大能力的语言。– 匿名
  • The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time. — Tom Cargill, object-oriented programming expert at Bell Labs

    开始的90%的代码用了90%的开发时间,而剩下的最后的10%的代码会需要另外90%的开发时间。– Tom Cargill,贝尔实验室的面向对象编程专家。
  • The important point is that the cost of adding a feature isn’t just the time it takes to code it. The cost also includes the addition of an obstacle to future expansion. Sure, any given feature list can be implemented, given enough coding time. But in addition to coming out late, you will usually wind up with a codebase that is so fragile that new ideas that should be dead-simple wind up taking longer and longer to work into the tangled existing web. The trick is to pick the features that don’t fight each other. — John Carmack, computer game programmer

    增加一个功能特性的成本并不单单是为这些功能编码所花费时间的成本,还这个成本应该包括特性扩展的障碍成本。当然,任何的功能清单都可以被实现,只需要有足够的时间。但是除些之外,你应该对你的代码库的脆弱性感到紧张,而那些新的想法应该足够的简单,而不是去花费更多更多的时间去纠缠于现有的蜘蛛网。这里的决窃是挑选那些不会和别人冲突的的功能。
  • The key to performance is elegance, not battalions of special cases. The terrible temptation to tweak should be resisted unless the payoff is really noticeable. — Jon Bently and M. Douglas McIlroy, both computer scientists at Bell Labs

    表现的关键是精美和典雅的,并不是使用大量的特殊案例。对于任何调整的冲动都应该是被限制的,除非其回报真的是值得注意的。– Jon Bently and M. Douglas McIlroy, 二者都是贝尔试验实的计算机科学家
  • The last good thing written in C was Franz Schubert’s Symphony Number 9. — Erwin Dieterich, programmer

    最后一件用C做的好作品就是弗朗茨.舒伯特的C大调第9交响曲 — Erwin Dieterich, programmer程序员
  • The problem with using C++ … is that there’s already a strong tendency in the language to require you to know everything before you can do anything. — Larry Wall, developer of the Perl language

    使用C++最大的问题是..在C++语言里,存在这一种很强的趋势,就是如果你不明白C++语言的细节,你就无法做好任何事情。– Larry Wall, developer of the Perl language
  • The sooner you start to code, the longer the program will take. — Roy Carlson, University of Wisconsin

    你越早开始都手编码,你所花费来编程的时间就越长 — Roy Carlson, University of Wisconsin
  • The value of a prototype is in the education it gives you, not in the code itself. — Alan Cooper, software author, from The Inmates are Running the Asylum

    原型的价值在于他给你的教训,而不是代码自身 — Alan Cooper, software author, from The Inmates are Running the Asylum
  • There are only two kinds of programming languages: those people always bitch about and those nobody uses. — Bjarne Stroustrup

    世界上只有两类编程语言:人们都抱怨的语言和从来没有人使用的语言 — Bjarne Stroustrup
  • There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. — Charles Antony Richard Hoare

    世界上有两个设计软件的方法,一种方法是设计的尽量简单,以至于明显的没有什么缺陷,另外一种方式是使他尽量的复杂,以至于其缺陷不那么明显。
  • Ugly programs are like ugly suspension bridges: they’re much more liable to collapse than pretty ones, because the way humans (especially engineer-humans) perceive beauty is intimately related to our ability to process and understand complexity. A language that makes it hard to write elegant code makes it hard to write good code. — Eric S. Raymond

    丑陋的程序就像一座丑陋的吊桥:他们相比漂亮的良好的吊桥起来,更有可能会坍塌,这是因为人类(尤其是工程师)感知漂亮的东西是和我们处理和理解复杂问题的能力相关的。所以,一个程序语言如果很难以优雅地方式编程,那么其就很难写出好的代码。
  • Weeks of programming can save you hours of planning. — unknown

    多做几周的编程可以节省你做计划的时间 —— 匿名 (意思为,只有实践过了,你才更容易做计划,没有实践过,做起计划来将会很头痛)
  • When a programming language is created that allows programmers to program in simple English, it will be discovered that programmers cannot speak English. — unknown

    当程序语言被设计成允许程序以很简单的英语来编程的时候,人们将会发现编写程序的程序员都来自不会说英语的地方。 –匿名
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-11-11 16:43:43 | 显示全部楼层
,  
Hey! It compiles! Ship it!
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2010-11-11 17:03:56 | 显示全部楼层
修复bug很容易,但是定位bug却很困难

我对上面这句话感受颇深。

有一个bug害我和同事解了近两周,源代码追踪也查不出原因所在。
相关的光学、电子工程师都自查了一遍也不知所以然。
后来才查出是PM应某客户要求关闭了一功能(通过专门的tool实现),而影响了正常流程。
知道bug的所在,不到1个小时就解决了,PA测试顺利通过。

点评

二分法找bug很难吗?花了两周才找到,我有些不相信  发表于 2013-7-26 16:06
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-11-26 13:27:55 | 显示全部楼层
When a programming language is created that allows programmers to program in simple English, it will be discovered that programmers cannot speak English. — unknown

当程序语言被设计成允许程序以很简单的英语来编程的时候,人们将会发现编写程序的程序员都来自不会说英语的地方。 –匿名
----------------------
这个
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-11-26 14:50:00 | 显示全部楼层
Weeks of programming can save you hours of planning. — unknown

多做几周的编程可以节省你做计划的时间 —— 匿名 (意思为,只有实践过了,你才更容易做计划,没有实践过,做起计划来将会很头痛)

----
是不是把意思理解错了?

我觉得应该这样理解:

多做几周的编程只能节省你做计划的几个小时 —— 匿名 (意思为,只有认真规划过了,才能提高实践的效率,没有计划的实践往往是徒劳)
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-11-26 23:00:12 | 显示全部楼层
记得高纳德说过“过早的优化时一切罪恶的根源”,不知道原句是怎样的!
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-11-30 16:51:46 | 显示全部楼层
5# KeyTo9_Fans

是不是把意思理解错了?

恩,是的,
原意是 大量的实践经验能有助于你快速的计划~~,呵呵
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-11-30 16:54:12 | 显示全部楼层
我觉得 ,programming = planning + coding ,


所以,这话应该改成这样:
Weeks of coding can save you hours of planning.
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-5-18 18:19:37 | 显示全部楼层
我一直为自己的英语差感到悲观,原来也有好处。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-5-18 21:55:46 | 显示全部楼层
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》

本文转自:数学研发论坛(bbs.emath.ac.cn)

点评

和我感觉差不多,我也喜欢这样,代码就是给人看的,所以注释是必须的,没有注释的代码和垃圾差不多!  发表于 2013-7-26 09:31
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2019-12-11 04:53 , Processed in 0.067965 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表