无我编程十大教条(Ten Commandments of Egoless Programming)

silentmj理解的无我编程(Egoless Programming),就是“对事不对人”的同义词。呵呵,还是中文精炼。

译文:只挑了重点部分,前面为直译,后面【】中为silentmj自己的理解。

1. Understand and accept that you will make mistakes.

1. 理解并接受你是会犯错误的【人非完人,金无赤足】

2. You are not your code.

2. 你不是你的程序【对事不对人】

3. No matter how much "karate" you know, someone else will always know more.

3. 无论你懂得多少空手道,总有人懂得更多【人外有人,天外有天】

4. Don't rewrite code without consultation.

4. 不要在没有事先咨询的情况下重写别人的程序

5. Treat people who know less than you with respect, deference, and patience.

5.  对待不如己之人仍然需要尊重与耐心。

6. The only constant in the world is change.

6. 世界上唯一保持不变的就是改变。

7. The only true authority stems from knowledge, not from position.

7. 权威来自于知识而非职位。

8. Fight for what you believe, but gracefully accept defeat.

8. 为信仰而战,但要能坦诚面对失败。【赢得起,更要输得起】

9. Don't be "the guy in the room."

9. 不要做“屋子里那个家伙”【不要做井底之娃】

10. Critique code instead of people—be kind to the coder, not to the code.

10. 批评代码而不是人,与人为善,而非代码。【对事不对人,与人为善,而非代码。】

 

原文:

Ten Commandments of Egoless Programming<?xml:namespace prefix = o />

·                            10

Takeaway: In a team-based development environment, egoless programming is a necessity. Download our Ten Commandments in tablet format as a reminder to keep your ego separate from your code.


Part state of mind and part QA philosophy, the term "Egoless programming" was coined by one of my favorite authors, Jerry Weinberg, back in 1971 in his highly influential book, The Psychology of Computer Programming. Weinberg was describing a development environment that involved heavy use of peer technical reviews. He used the term to describe the mindset that programmers developed after working in this environment for a time.

The basic idea behind Weinberg's philosophy was that a system of formal peer reviews effectively multiplied the number of eyes looking for logic problems, poor algorithm choices, or even syntax. These extra eyes could catch nascent bugs much earlier in the development cycle than traditional testing could, resulting in shorter project completion times and lower defect counts in live systems. For developers to accept this system, of course, they had to set their egos aside.

Popular peer reviews
Does that sound familiar to you? It should. The idea of formal peer code reviews has figured in a number of development methodologies (or "fads," for the more jaded among our audience) and has been getting more popular recently. Extreme Programming, with its trademark two-developers-per-machine standard, could be viewed simply as a peer-review facilitation strategy. Likewise, the open-source community development process, which has historically been successful in producing high-quality, low-defect software, could be seen as one giant peer review.

Obviously, thin-skinned developers (and some would argue there is no other kind) would be at a disadvantage when working in an environment where constructive criticism is handed out so freely. Programming, like writing or creating art, is a very personal endeavor, and, like artists, some of us just can't stomach it when someone else disparages our work.

The Ten Commandments
What we need is a set of rules or guidelines to help developers keep themselves (their egos, actually) separate from their code. Hence our Ten Commandments for Egoless Programming, which you can also download in handy "stone tablet" format:

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, so 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. Nontechnical 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, not as 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 do turn out to be right, don't take revenge or say, "I told you so" more than a few times at most, and don't make your dearly departed idea a martyr or rallying cry.

9.              Don't be "the guy in the room." Don't be the guy coding in the dark office emerging only to buy cola. The guy in the room is out of touch, out of sight, and out of control and has no place in an open, collaborative environment.

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.

转载于:https://www.cnblogs.com/silentmj/archive/2010/05/06/1728883.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值