编程十诫

作者: 陈加新 | 来源:发表于2014-09-01 19:36 被阅读669次
  1. 理解并接受你也会犯错误。关键在于:在携带盲点投入生产之前要先找到它们。幸运的是,在我们的作业中,除了在实验室开发火箭制导软件,错误并不是招招致命的。我们可以,而且应该学习、放松,并继续学习。

  2. 你不是你的代码。面对公开(公众性)的事物,不要太过个人化(极端)。反思自己,温故而知新。

  3. 山外有山,人外有人。虚心求教,尤其是当你觉得没必要的时候。三人行,必有我师。

  4. 不要在未经咨询参考的情况下重写代码。要知道「修复代码」和「重写代码」之间的区别,在框架内追求风格的改善。独立思考不是独自思考。

  5. 尊重每一个人,保持耐心、求同存异。那些不经常与开发者来往的非技术人员通常认为我们是自傲且脆弱的。不要用你的愤怒和急躁去加深这些刻板印象。

  6. 唯一不变的就是改变。开放包容、乐于接受。当你的需求、平台或者开发工具发生改变时,把它当作一次挑战,逃离舒适区。

  7. 道理(权威)来自于知识(事实),而不是立场(职位)。知识造就道理,道理成就尊重。所以如果你想在一个公正的环境中获得尊重 —— 学,习。

  8. 争你所信。同时,优雅地面对失败。要知道你的观点肯定会被驳回,即使你是对的,也不要咄咄逼人。

  9. 不要做一个「在角落里的程序员」。不要只有在拿苏打水的时候才从黑暗的办公室里出来一次。角落里的程序员是脱节的、淡出视线且失控的。这类人在开放协作的环境中从不出声。在沟通中解决问题,融入办公社区。

  10. 批判程序,而不是批判程序员。尽可能的使用正面积极的评论,一切以改进代码为本。


From The Psychology of Computer Programming , written in 1971, here are The Ten Commandments of Egoless Programming:

  1. Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry. We can, and should, learn, laugh, and move on.

  2. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered.

  3. No matter how much “karate” you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it’s not needed.

  4. Don’t rewrite code without consultation. There’s a fine line between “fixing code” and “rewriting code.” Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.

  5. Treat people who know less than you with respect, deference, and patience. Non-technical people who deal with developers on a regular basis almost universally hold the opinion that we are prima donnas at best and crybabies at worst. Don’t reinforce this stereotype with anger and impatience.

  6. The only constant in the world is change. Be open to it and accept it with a smile. Look at each change to your requirements, platform, or tool as a new challenge, rather than some serious inconvenience to be fought.

  7. The only true authority stems from knowledge, not from position. Knowledge engenders authority, and authority engenders respect – so if you want respect in an egoless environment, cultivate knowledge.

  8. Fight for what you believe, but gracefully accept defeat. Understand that sometimes your ideas will be overruled. Even if you are right, don’t take revenge or say “I told you so.” Never make your dearly departed idea a martyr or rallying cry.

  9. Don’t be “the coder in the corner.” Don’t be the person in the dark office emerging only for soda. The coder in the corner is out of sight, out of touch, and out of control. This person has no voice in an open, collaborative environment. Get involved in conversations, and be a participant in your office community.

  10. Critique code instead of people – be kind to the coder, not to the code. As much as possible, make all of your comments positive and oriented to improving the code. Relate comments to local standards, program specs, increased performance, etc.

相关文章

  • 编程十诫

    人非圣人,孰能无过。理解并接受不完美的自己。// 关键在于正式发布前尽早找到问题行有不得,反求诸代码。// 记住重...

  • 编程十诫

    理解并接受你也会犯错误。关键在于:在携带盲点投入生产之前要先找到它们。幸运的是,在我们的作业中,除了在实验室开发火...

  • 讲座推荐:《出埃及记查经-十诫与会幕》沈保罗牧师

    1、出埃及记查经-十诫 沈保罗 第01集 2、出埃及记查经-十诫 第02集 3、出埃及记查经-十诫 第03集...

  • 诺克斯十条

    推理小说十诫(Ten Commandments of Detection)或称推理十诫,是天主教蒙席,资深编辑暨作...

  • 粉碎熬夜的秘密——我为什么要熬夜?

    【给自己的十诫——第一诫】 ...

  • 热情可以培养吗?

    当我翻开《管理十诫》这本书时,吸引我的是十一诫。因为书名是十诫,怎么还有十一诫,难道错了?印刷错误,还是书名错误,...

  • Google的十诫,互联网人士必背,雷军就会背!

    今天的Google的十诫来源就是雷军的博客,雷军曾经要求金山人人都必须能背google十诫,为了让金山同事更好地理...

  • 典章之颁布(出廿一至廿三章)

    十诫乃神律法之总纲,是大原则。除颁十诫外,神还颁布了很多典章,是执行的细则,也是民法。此外,还包括敬拜、宗教...

  • 理财“十诫”

    3000多年前,摩西在西奈山上,接受上帝给予的“十诫”: 摩西十诫 第一条:我是耶和华,除我之外,你不可有别的神。...

  • 喜乐操练90天~Day10欢乐十诫&Day11快乐新解

    十诫神所要我们遵守的诫命。今日回头来看,为我们爱的人遵守十诫真的不多,也不难,因为爱我愿意。 今天觉得整个人都想好...

网友评论

    本文标题:编程十诫

    本文链接:https://www.haomeiwen.com/subject/mheytttx.html