Quora:How do top programmers work?(顶级程序员是如何工作的?)

原文:http://www.quora.com/Software-Engineering/How-do-top-programmers-work

First, they do NOT do a lot of things:

  • They do NOT reinvent a wheel. There's lots of new stuff to do and no time to waste redoing what others have done well. If there are libraries, gems, code snippets, examples, etc they will happily use the tools available and spend their time on the new stuff.
  • They do NOT write code for features they do not need. In other words they keep it simple. When writing something it's common to think "Well some day we may want to do X so I'll go ahead and add Y and Z to this feature in case we need to support it ..." If a good programmer doesn't need something now they do not add it. You never know what you will really need in the future. Stuff changes and writing stuff takes time now and support time later.

They also do a lot of things:

  • They have a mental map/design of the project in their head. Before a drop of code hits the computer a top programmer already has a picture of what it will look like. Just like an artist has imagined their canvas before they have touched the paint a programmer has designed something in their mind. It may be designed in components as they go but they don't start writing blindly with out a mental map.
  • They are working on the project a lot more often then most people notice. Taking a shower, falling asleep, occasionally driving a car, they are architecting their code in their head. The mental map in the above point is evolving all the time. A good programmer in the middle of thinking out a project in the beginning may have a lot in common with an absent minded professor.
  • They test their work as they go. Even a genius will make mistakes. In fact I'd argue a top programmer accepts that mistakes are human and works in a manner where they expect them. They test the components as they build the project. They make sure the beam is strong before the building rests its weight on it. Sometimes they will look slower then others but when they are done there will be a solid master piece.
  • They reference a mental library of experience. Reading and following this or any list will not automatically turn someone into a top programmer. A brilliant mind does not automatically make someone a top programmer. 30 years at the same job will not make someone a top programmer. Top programmers have coded a lot. They have coded in different languages. They have coded on different projects and at different companies. In the back of their head is a natural library of a million things that work and don't work. A million patterns for how things are done in different places. They probably don't realize it but as they work the components they need are built out of this vast experience.


翻译练习:

首先,他们不会做某些事情:

  • 他们不会重复发明轮子。有太多的事情值得去做,而不应该把时间都浪费到一些别人已经做的很好的事情上。如果已经有现成的库、组件、代码段或是例子什么的,他们会欣然使用这些有用的东西,而将时间花费在新的东西上。
  • 他们不会写现在用不上的代码。换句话说,他们会尽量使用最简单的方法解决问题。在编写一些东西时,这样的想法也会很普遍“有一天我可能会在做X,所以我会继续把Y和Z也顺带着一起做了,以防不时之需……”。但要是一个优秀的程序员,如果现在不需要的东西,他是不会加上的。你永远不会知道未来的需求是什么。应该把经历集中在模块目前的变化和编写,而把重构留在将来去解决。

当然,他们会做很多事:

  • 他们会在大脑中构建项目的草图和设计图。在开始敲代码之前,顶级程序员应该在大脑中建立起一个清晰的结构图。就像一位画家会先想象作品在画布上的模样才会去动笔作画,顶级程序员会先在大脑中画出设计草图。It may be designed in components as they go,但是他们不会在还没有想清楚的情况下就动手编写代码。
  • 他们思考的时候别人也许无法察觉到他们正在思考。在洗澡的时候,小睡的时候,开车的时候,他们都在大脑中构思着设计,他们大脑中的草图会在这些时候一点一点得变得清晰。当你面前的优秀程序员开始沉浸于思考时会表现的像是一位心不在焉的专家。
  • 他们总是会做测试。即使是天才也会犯错。当然,我所说的顶级程序员能接受的错误是人员和操作正常时却没有得到期望结果的错误。他们在测试模块时就想在修建一个建筑,他们要确保房梁足以承受预期的重量。有时候他们会比其他的程序员效率低,但是一单模块完成,将是坚固可靠的杰作。
  • 他们把大脑中的知识转化成经验。越多或是关注一个邮件列表不会让人自动成为顶级程序员。在一个岗位干上30年也不会成为顶级程序员。顶级程序员需要编写大量的代码,并且用不同的语言编写代码,他们会编写不同的项目或模块。在他们的大脑中深处,有一个天然的库保存着成千上万的行得通或行不通的例子,也会有成千上万的不同环境下行得通的经验。他们可能没有察觉到这点,但当他们工作时,所依赖的就是这些丰富的经验。
(完)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值