注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Faye Euler's blog

技術交流歡迎留言

 
 
 

日志

 
 

为什么程序员都是夜猫子Why programmers work at night  

2011-12-27 14:36:52|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

为什么程序员都是夜猫子Why programmers work at night - Faye - Faye Eulers blog

一种很流行的说法是,程序员是把咖啡因转化成程序代码的机器。

说的是实情,随便问一个程序员,问他什么时候工作最有状态,估计他很有可能说是深夜。有人稍微早一点,有人更晚。有一种流行的趋势是凌晨4点起床,在破晓之前这段时间里做一些事情。而另一些人喜欢凌晨4点才睡觉。

所有这些的主要目的是躲避打搅。但是你把自己反锁在屋里不就行了?为什么对夜晚情有独钟?

我想,这事归纳下来有3点:工人的时间表,疲倦的大脑和明亮的电脑屏幕。

工人的时间表

Paul Graham 在2009年写了一篇关于 工人的时间表的文章——主要是说这个世界(主要)存在两种时间表。传统的管理者的时间表——一天的时间别分成了很多小时,一次十分钟的分心至多会浪费你1个小时的时间。

而另一种情况是程序员们所说的工人的时间表——生产东西的人的时间表。研究一个大型的抽象的系统,需要把整件事情装进大脑——这样的一些人类似于用珍贵的水晶玻璃搭建一间房子,一旦有人打搅你,整个结构都会滑落,摔成无数的碎片。                                                 

这就是为什么被打扰的程序员会如此的生气。

为什么程序员都是夜猫子Why programmers work at night - Faye - Faye Eulers blog

因为这是一种巨大的精力上的投资,在没有几个小时不被打搅的环境中的酝酿,你不可能开始工作。如果你好不容易在大脑中构建了整个要思考的事情的模型,而在半个小时后被人摧毁,这是很大的浪费。

事实上,在跟很多的企业创办人交谈后,你会发现,他们都感觉在白天根本无法做任何事情。持续不断的打扰、重要的事情需要注意、大量的邮件需要处理,环境不允许他们坐下来做事。于是他们大部分人都在夜晚,人们都入睡的时候去完成他们要做的事做完。

疲倦的大脑

但是程序员仍然在晚上会困倦。程序员不是超人。程序员甚至在白天都会感到疲劳。

为什么我们要把智力上最复杂的事情放到我们的大脑想去睡觉的时间段里去完成,而在我们的大脑最敏锐最清醒的时候去做相对简单的事?

因为疲倦让我们编写出最好的代码。

跟ballmer峰值相似,疲倦能使我们的精力更容易集中,因为你的大脑疲倦了,不得不集中精力!没有多余的脑能量来提供你去三心二意。

对我来说,如果喝了太多的茶或在错误的时间喝了提神饮料,我反而干不了什么事。我会过度兴奋,一会查看微博,一会看看新闻,不知道自己该做什么。

为什么程序员都是夜猫子Why programmers work at night - Faye - Faye Eulers blog

你会认为我应该更有效率的工作——精力充沛,大脑超频。但正好相反,我东一榔头西一耙子,根本无法在一件事情上定神2分钟。

而反过来,当我稍微有点疲倦时,我却能把屁股安稳的放到椅子上开始编程。在大脑稍微有点疲倦的情况下,我能连续编程数小时,毫不考虑微博或Facebook。好像这互联网根本不存在。

我感觉大部分程序员都是跟我的感觉是一样的。对于日常工作中80%的任务,我们的脑能力都是过剩的——除非你需要写的是在当前程序运行的环境中让它增速10的算法。即使你开发的是最高级的机器学习想象功能,其中大部分的工作也只是简单的整理数据和以一种合适的方式表现输出结果。

当你的大脑不是满负荷运转时,它总是想找点事情做。疲乏会让你迟钝,手头的工作就已经够你消化了。

明亮的电脑屏幕

为什么程序员都是夜猫子Why programmers work at night - Faye - Faye Eulers blog这一点非常的简单。在晚上老是盯着明亮的光源,你的睡眠周期会推迟。你忘了该是睡觉的时候了,直到凌晨3点。然后你早上11点才能起来,当晚上再次到来时你不再感到困倦,因为你11点才起床!

反复这样的作息规律,你的身体会进入另外一个时区。更有趣的是,这种周期不会一直推迟下去,一旦你进入了这

种3点或4点才去睡觉的生理平衡状态,你会一直留在这种状态里。

也许这是一种警讯在起作用,社会在告诉我们,如果我们在下午2点吃早餐,会被认为是很邋遢的人。

最后

总结一下,程序员喜欢在晚上工作,是因为这时没有何时应该停止工作的限制,这让人感到更放松,你的大脑不再思考让你分心的事情,明亮的屏幕使人清醒。

原文:

A popular saying goes that Programmers are machines that turn caffeine into code.

And sure enough, ask a random programmer when they do their best work and there’s a high chance they will admit to a lot of late nights. Some earlier, some later. A popular trend is to get up at 4am and get some work done before the day’s craziness begins. Others like going to bed at 4am.

At the gist of all this is avoiding distractions. But you could just lock the door, what’s so special about the night?

I think it boils down to three things: the maker’s schedule, the sleepy brain and bright computer screens.

The maker’s schedule

Paul Graham wrote about the maker’s schedule in 2009 – basically that there are two types of schedules in this world (primarily?). The traditional manager’s schedule where your day is cut up into hours and a ten minute distraction costs you, at most, an hour’s worth of time.On the other hand you have something PG calls the maker’s schedule – a schedule for those of us who produce stuff. Working on large abstract systems involves fitting the whole thing into your mind – somebody once likened this to constructing a house out of expensive crystal glassand as soon as someone distracts you, it all comes barreling down and shatters into a thousand pieces.

This is why programmers are so annoyed when you distract them.

Because of this huge mental investment, we simply can’t start working until we can expect a couple of hours without being distracted. It’s just not worth constructing the whole model in your head and then having it torn down half an hour later.

In fact, talking to a lot of founders you’ll find out they feel like they simply can’t get any work done during the day. The constant barrage of interruptions, important stuff ? to tend to and emails to answer simply don’t allow it. So they get most of their “work work” done during the night when everyone else is sleeping.

The sleepy brain

But even programmers should be sleeping at night. We are not some race of super humans. Even programmers feel more alert during the day.

Why then do we perform our most mentally complex work work when the brain wants to sleep and we do simpler tasks when our brain is at its sharpest and brightest?

Because being tired makes us better coders.

Similar to the ballmer peak, being tired can make us focus better simply because when your brain is tired it has to focus! There isn’t enough left-over brainpower to afford losing concentration.

I seem to get the least work done right after drinking too much tea or having a poorly timed energy drink. Makes me hyperactive and one second I’m checking twitter, the next I’m looking at hacker news and I just seem to be buzzing all over the place..

You’d think I’d work better – so much energy, so much infinite overclocked brainpower. But instead I keep tripping over myself because I can’t focus for more than two seconds at a time.

Conversely, when I’m slightly tired, I just plomp my arse down and code. With a slightly tired brain I can code for hours and hours without even thinking about checking twitter or facebook. It’s like the internet stops existing.

I feel like this holds true for most programmers out there. We have too much brainpower for ~80% of the tasks we work on – face it, writing that one juicy algorithm, requires ten times as much code to produce an environment in which it can run. Even if you’re doing the most advanced machine learning (or something) imaginable, a lot of the work is simply cleaning up the data and presenting results in a lovely manner.

And when your brain isn’t working at full capacity it looks for something to do. Being tired makes you dumb enough that the task at hand is enough.

Bright computer screens

This one is pretty simple. Keep staring at a bright source of light in the evening and your sleep cyclegets delayed. You forget to be tired until 3am. Then you wake up at 11am and when the evening rolls around you simply aren’t tired because hey, you’ve only been up since 11am!Given enough iterations this can essentially drag you into a different timezone. What’s more interesting is that it doesn’t seem to keep rolling, once you get into that equilibrium of going to bed between 3am and 4am you tend to stay there.

Or maybe that’s just the alarm clocks doing their thing because society tells us we’re dirty dirty slobs if we have breakfast at 2pm.

Fin

To conclude, programmers work at night because it doesn’t impose a time limit on when you have to stop working, which gives you a more relaxed approach, your brain doesn’t keep looking for distractions and a bright screen keeps you awake.

  评论这张
 
阅读(699)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018