天天看点

程序员的七个坏习惯Top 7 programmers bad habits程序员的七个坏习惯

Top 7 programmers bad habits

程序员的七个坏习惯

1.- The all code is crap, except mine,

1 所有的代码都很烂,除了我自己的.

I have bad news for you buddy, all code is crap. No matter how much effort you put on it, there is always a majority of programmers who are going to think that your code sucks and that they could have done it 10 times better. I have already covered this topic in previous posts, you can find more information of what exactly I mean when I say that all the code is crap here and here.

朋友,我有一个坏消息要告诉你,所有的代码都很糟糕.无论你多么努力,仍然有大多数程序员认为你的代码很糟糕,并且他们可以做的比你好10倍.在以前的帖子里,我就已经讨论过这个问题了,在那些帖子里你就能知道为什么我现在说所有的代码都很烂.

How to fix it: Don’t criticise others people code, it could be yours the one in the spotlight, try to make objective and professional observations instead, but don’t judge. Be humble and try to learn from everyone around you, hopefully then your code won’t be so bad.

如何改正:不要批评别人的代码,因为有一天你的代码也会暴露在聚光灯下(让别人评价),最好就是做一个客观而专业的观察者,同时不要做评论.谦虚地像你周围的所有人学习,并且期待一会你自己的代码不会那么糟糕.

2.- The “I fix that in a second” catastrophe.

2.-"我能很快地修复它"  这是一个大灾难

Taking shortcuts is very tempting, everyone has done it. There are actually situations where they are necessary, but in overall, they are dangerous, very dangerous and should be avoided. A shortcut which goes wrong may save you a few hours, but may cause months of pain.

走捷径是个很诱人的东西并且我们每个人都用过.确实,也有很必要

使用快捷键的情况,不过总的来说,快捷键很危险应该避免使用.一个快捷键的使用错误有可能给你节省了几个小时,但是后果是在以后几个月的时间里你都得为它头疼.

How to fix it: Don’t trust yourself when carrying delicate activities. Ask someone else to review what you are doing. Make sure that if you are about to take a shortcut, you make very clear to the stakeholders what the reasons and the risks are. Try to get a manager to sign off every time you are about to take a shortcut, aka “cover your ass”.

如何改正它:当你在完成精细的模块时不要相信自己.请别人来审查一下你自己的代码.如果你自己计划要走捷径,最好让你的负责人知道这样做的原因和风险.在每次你决定做捷径的时候,尽量让你的经理签字,也就是让他给你擦屁股(aka “cover your ass”).

3.- The “That will only take a second” misconception.

3.-这只需要几秒钟. 绝对的错误观念

Being Barcelona my hometown, I am very proud of the Sagrada Familia Cathedral, which is very well know for its beautiness, and also for the time is estimated it will take to complete, (in construction since 1882), but that’s probably because they didn’t ask a programmer to estimate, otherwise the estimate would probably have been somewhere around 2 weeks.

在我的家乡Barcelona,我为神圣家族教堂而骄傲,因为美丽她闻名于世.同时还有她的工程预估期(始于1882年,到现在还没有完工)但是这也有可能是因为没有让一个程序员的估计,否则,程序员给出的构建时间有可能就是两周左右.

How to fix it: For starters, is important to understand that accurate estimations in software development for non trivial solutions are impossible, we can only guess. Also remember that is very likely that you will find so many things which you didn’t foresee when you start developing that is worth multiplying the estimate to cover for those, I usually go with 1.5 or 2.

如何改正它:首先,要明确一点,那就是要精确地估计那种大型的软件开发项目的时间是不太可能的,我们只能猜测.同时也得记住,在项目中你会遇到很多前期没有预见到问题,而就是这些问题,会让你的预期日程加倍,我认为通常是1.5倍到2倍.

4.- The ego spiral.

4.-以自我为中心

Many programmers discussions look more like rooster fights than human discussions. This usually happens in design and architectural meetings. It is actually quite easy to detect this ego spirals, you just have to substitute most of what the contenders are saying with COC! COC! COCOCOOCCC! COOC!

许多程序员在讨论问题的时候就想一只斗鸡而不是一个正常的人类.这通常发生在对设计和架构的讨论会议上.你很容易就能看到他们自负,你也可以把竞争者的话直接换成"咕咕咕 咕咕咕 咕咕 咕咕"

How to fix it: Leave your ego at home. Big egos are one of the biggest non technical issues for any programmer. Keep in mind some basic considerations when making decisions.

如何改正:把你的自负放在心底.对于任何一个程序员来说,自负是最大的非技术问题.在做任何决定之前,都要确保心里有个基本的构想.

5.- “It wasn’t me!”

5.- "这不是我的错"

In my opinion, other bad habit from most programmers is the lack of accountability. We always have an excuse… It’s like if we were saying that under normal conditions we would never make a mistake, which honestly is quite hard to believe.

在我看来,大多数别的程序员的坏习惯都是确实责任感.我们总是有理由...就想总有人说,在正常情况下, 这是不会错的,但实际情况下,这很难让别人相信.

How to fix it: No need to cry, or to perform seppuku, (aka harakiri), when we make a mistake. Having a healthy attitude where we can you just say something like: “yeah, sorry, now we need to do this to fix this issue, my fault” is a very professional attitude, and it will help you to build a reputation and to be better considered by your colleagues.

如何改正:其实在出了问题的时候,我们不需捶胸顿足,也没有必要切腹自杀以谢天下.其实,只要一个健康的心态说一句"哦,对不起呀,我们得修复这个问题,这是我的错误"这才是专业的态度,同时这也会帮你建立名誉也让你的同事更加地尊重你.

6.- The demotivated genius.

6.-消极的精神状态

Repetitive and simple tasks are not the best motivators, but they need to be done, programmers tend to get demotivated and very unproductive when they need to complete them.

简单重复的认为不是最好的激励方式,但是这些事还都得做,当程序员要完成这些任务的时候,就会变得很消极,效率也会很低.

How to fix it: Discipline. Unfortunately, there isn’t any other remedy I can think of.

如何改正:纪律.很遗憾,我也想不出其他的什么补救方式.

7.- The premature programmer.

7.-不成熟的程序员.

 If programming was sex, there would be a lot of unsatisfied computers. You can just not go in, do things halfway through and then fall sleep.One of the concepts that I find most programmers struggling with is the concept of “Done”. Remember that done means: tested (and not only unit tested), documented, committed, merged…

如果把编程看做是做爱的话,肯定有很多欲求不满的电脑(汗 大汗 瀑布汗).你还没有进去,只干了一半就呼呼大睡了.(你可以看看上面的英文......)我发现有一种理念是大多数程序员都认同的是"完成".记住,完成意味着:测试(不只是单元测试)还有文档解释,注释,系统集成.

How to fix it: This one is tricky, the complexity of non apparent necessary tasks to fully complete some functionality is quite high and usually requires discipline and training. Probably the two easiest ways to help a programmer understand if some code is done are peer reviews and demos.

如何改正:这是一个很麻烦的问题,相对于完全的完成某些功能性问题而言,这些并不是显得很有必要的任务会很庞杂和难处理,通常需要你有纪律性和受过培训。也许有两个更简单的方法能帮助程序员判定他们的代码是否已经写好那就是相互复查和演示.

原文地址

www.makinggoodsoftware.com/2011/05/23/top-7-programmers-bad-habits/

参考翻译

http://user.qzone.qq.com/289065406?ptlang=2052&ADUIN=460795365&ADSESSION=1370779283&ADTAG=CLIENT.QQ.4375_FriendTip_QzoneFolder.0#!app=2&via=QZ.HashRefresh&pos=1358335322

继续阅读