老板会因为你拼命写代码而感谢你吗?

时间:2011-11-1 23:03:00 来源: www.skorks.com 点击:
  • 程序员热衷于长时间地工作。我想说的是,你就承认吧,你的工作老板并没有让你这样做,你自己要这样做而已。当然,我知道,也许并非所有程序员都喜欢长时间的编程。

程序员热衷于长时间地工作。我想说的是,你就承认吧,你的工作/老板并没有让你这样做,你自己要这样做而已。当然,我知道,也许并非所有程序员都喜欢长时间的编程。不过肯定的是,随着加班成为业内的普遍现象,至少一半的程序员必须喜欢加班,不是吗?

我早已听到以下这类借口。“不,不是那样的,我们只是喜欢炫酷的技术活,而且不想遗留未解决的问题。实际上,加班是一件好事,它让我们变得出色!”

我认为,你不能只见树木,不见森林。从某个角度来说,你这样做并非为了自己,而是为了“某个人”。无须质疑,他也许是个高尚的人,但你并不是他的奴隶。从其他角度来说,你有多少次加班,是为了解决问题,研究新技术,编码实现某些东西,以及在截止时间之前完成任务?但是,你在业务上是机智过人的程序开发者,你在帮助公司获得成功。公司管理者已经向你说明了公司的经济状况——必须这样做,公司依靠你。我想说的是,除非这个管理者现在就在你旁边,半夜2点还在陪你聊天,否则他的话将一文不值。

让我来讲述一个朋友曾经跟我说过的故事。这个故事是关于一个天才程序员的,姑且叫他John吧。

John是一个百万程序员当中才出现一个的超级明星。他理解和编写代码的能力高超,工作效率是其他任何人的20倍。有一天,公司拿到了一项短交期的大项目。客户提供了一本厚得让所有人沮丧的规格说明书。John出手相助,他把说明书带回家,此后三天没有人有关于他的消息。他回来上班的时候,样子十分憔悴,但他看懂了整本说明书并完成了项目的基本框架。除了一小部分不可能完成之外,说明书的其余部分,甚至连客户自己也不甚了解的需求,John也完成了。真让人吃惊!

当我第一次听说这个故事时,感受颇深,我问了第一个问题“那john现在何处?”我朋友回答——“他死了,生活太艰难了!”或许用编程过劳死来形容更加合适。这个故事令人意外的是——John才30岁而已。

程序员从分享死亡竞赛故事来获得反常的快乐。甚至当我们带着厌恶的情绪去这样做的时候,这种厌恶也带着一丝得意,以此怂恿同事去做得“更好”。但这有点像那些穿着短裤的家伙,他们的短裤短到你都看得到他们的内裤;也有点像一些把抽烟当时尚的人,他们和他们的朋友觉得这很酷,其他人却觉得愚蠢。

使糟糕的情况更糟

我可以理解偶尔付出一些额外努力以及一两天加班到半夜的必要性。但是,当偶尔变成经常,当老板不再因为你的努力而经常感谢你,而是习以为常时,我们就遇到了麻烦。老板希望程序员经常加班,这不仅是你的悲哀,也是整个行业的。人类就像狗一样,非常容易受到正面和负面强化的影响。整个行业的发展受到长年因过度加班而死亡的悲剧影响,直到某个阶段,在那个阶段甚至还奖励这种行为。我们每次陷入长时间的争论中,都持续消极地加剧了这种趋势。

这不能帮助我们管理团队。你只需要让一个人做主,其他人遵守。内疚带来平等——“我们不能让我们的伙伴独自去做困难的事情,我们得帮帮忙”。遵守的人越多,那些抛下同伴的人压力就会越大,直到整个团队半夜里聚在一起喝可乐,吃披萨。但他们如何容纳一个同样的人进入他们的世界,因为在这里也有一个因特立独行而著名的程序员。当我们还是学生时,我们乐于把所有事情都推给某个人处理,然后在校内做我们想要做的事;但当我们走上工作岗位时,一切都要靠我们自己。真让人困惑。

有趣的是,有时候这些大量的努力甚至并没有得到正常合理的追踪记录,好像它反而让项目看起来很糟糕一样。所以他们“作假帐”,正如客户只关心每个人每周工作40小时(或者他们拿的是40个小时的工资),也许还会关心项目在目前的进度,但他们从不在意小组每个成员花费在项目上的另外40个小时。好吧,或许他们会在“第二套假账”中追踪记录的团队成员的真正努力。虽然会计会因为此类造假而锒铛入狱,但在IT业内,没有人会反对这种造假的要求。

可接受的进度成果

大多数敏捷开发过程都会就可接受的开发进度进行讨论。不过,我也见过有些甚至自认为灵活的团队会花几个小时的时间坐下来一起讨论交流如何让程序更加高效合理,等等,你懂的。尽管团队成员的思维依旧敏捷,你却不敢说出其他东西。

每当我想起这东西,我总想到律师。你就像一个刚入门的律师,付出了大量的努力和时间,这是你在这个行业中获得成功的常规途径。没有一个程序员想要跟律师做比较,但情况经常很相似,除非你不希望跟程序开发人员一样通过长时间的加班取得进步(就跟律师一样,除非你在4大咨询公司打工,也可以成为一名律师)。所以,律师跟程序员,哪个是呆子?

关于一周工作时间超过40小时导致生产力下降的研究呈现出令人不安的规律性。作为程序员,如果你的创造力下降了,你的失误就会增加,你就会遗漏现存的问题,等等;直到到达某个阶段,这个阶段中,你做错的东西比做对的东西还要多。当你花了很多的时间在同样的活动中时,我是否应该特别提到健康问题。关于饮食,你只能靠可乐存活很长一段时间——可怜的John甚至活下来不到40小时。

你现在能清楚我在反对长时间的工作和面临死亡威胁的行军了吗?你的睡眠时间和睡眠质量达标了吗?或许最近某一天我会告诉你我如何收到叫醒电话(wake up call),这是一个有趣的故事。把猫赶在一起,很容易与在相同的方向下让程序员取得预期的成果这种情况相比较,这是我对我们的人(程序员)又爱又恨的地方。但我希望过段时候后,所有聪明的程序员要一个明确的立场,坚决消除十分糟糕和违背生产力的业内趋势之一。正如我所提到的,聪明的程序员不喜欢长时间工作,也不会因为迫于压力而加班,他们把更多的时间用于享受生活。

Did Your Boss Thank You For Coding Yourself to Death?
by Alan Skorkin on February 25, 2010

Programmers love to work long hours! There I said it, c'mon admit it, your job/boss doesn't make you do it, we do it to ourselves. Alright, I'll concede, maybe not all programmers love long hours, but surely with the amount of overtime that is prevalent in this industry at least half of us must love it. Right?

I can hear the excuses already. "No, no that's not it, we just love working with cool tech and don't want to leave a problem unsolved. It is actually a good thing it's what makes us awesome!"

I say – you're not seeing the forest for the trees. Here is some perspective, you're not doing this for yourself, you're doing it for "the man". Admittedly he might be a nice man, but you don't owe him slavish commitment. Here is even more perspective, how often are you actually playing with interesting problems and cool tech and how many times are you churning out code desperately trying to get something delivered and meet some arbitrary deadline that someone has assigned to you? But hey, you're a business savvy developer, you're helping the company succeed, your manager has explained the financial situation to you – it has to be done, we're relying on you. Well, unless that same manager is right there with you, entertaining you with amusing anecdotes at 2 am, his words are worthless.

Let me tell you a story that a friend once told me. It is about a brilliant developer – lets call him John.

John was a superstar, a one in a million programmer. He had an uncanny ability to understand and write code and was 20 times more productive than anyone else. One day the company got a big contract that needed a fast turn-around. The client sent a massive spec document – to everyone's dismay. John came to the rescue, he took the spec home and noone heard from him for 3 days. When he came back to work, he looked like hell, but he had gone through the whole spec and had an outline of the solution already finished. Except for one bit which was impossible to implement, though the spec said otherwise – even the client didn't realise this, but John picked it up. Amazing!

When I first heard that story, I was pretty impressed, my first question was, "So, where is this guy now?". To which my friend replied – "He is dead, too much hard living!". Too much hard coding would be more like it. Kinda takes the wind out of that story a little bit – John was in his early 30s.

Programmers take a perverse pleasure from sharing death-march war stories. Even when we do it with disgust, it is a disgust tinged with pride – daring our peers to do "better". But it is a bit like those guys who wear their pants so low you can see ALL of their underwear or the people who take up smoking for the "trendy image". They and their friends think it's cool – everybody else thinks it's stupid.

Making A Bad Situation Worse
I can see the necessity of occasionally putting in some extra effort and burning the midnight oil at work for a day or two. But when "occasionally" turns to "often", when your boss stops thanking you profusely for your efforts and just treats it as norm, this is when we're all in trouble. It sets bad expectations, not just for you, for the whole industry. Humans are like dogs, we're eminently susceptible to positive and negative reinforcement. And this whole industry has been conditioned by years of death-marches to the point where it even rewards this behaviour. Every time we give-in to the long hours argument, we continue to negatively reinforce this trend.

It doesn't help that we're herd animals, you only need to get one person and everyone else wants to conform. Guilt comes into the equation – "we can't leave our mates by themselves to do the hard-yards, we gotta help them". The more people conform, the more pressure on the rest of the herd to do so until the whole team is chugging coke and eating pizza at midnight. But how do they suck even one person in, where is that famed programmer independence. We're happy to "stick it to the man" and do whatever we want in school, but as soon as we're in the workforce all bets are off. It is puzzling.

Interestingly, sometimes these gargantuan efforts aren't even tracked properly, as it would make the project look bad. So they "cook the books", as far as the client is concerned everybody is doing 40 hours a week (i.e. they get billed for 40 hours) and the project is coming in on schedule (maybe), never mind the other 40 hours that everyone on the team puts in. OK, maybe they'll track the real effort in a "second set of books". Accountants go to jail for these kinds of shenanigans, but our industry expects it – nay almost demands it.

The Sustainable Pace Effort
Most Agile processes talk about sustainable development pace. But, I've seen even self-confessed agile teams knuckle under and put in the hours, you know, for the greater good and all. They were still agile though, and don't you dare say otherwise.

When I think about this stuff I am always reminded of lawyers. You come in as a new lawyer and you put in massive amounts of effort and time, it is the accepted way to get ahead in that industry. No developer wants to be compared to lawyers, but often the situation is similar except you're not going to get ahead by doing a lot of overtime as a developer (unless you're working for a big 4 consulting company and then you might as well be a lawyer :)). So, lawyer vs programmer, which one is the chump?

Studies about productivity declines when working more than 40 hours a week surface with disturbing regularity. As a developer your creativity declines, you make more mistakes, you miss existing issue etc., to the point where you're doing more harm than good. Should I even mention the health concerns when you spend that much time engaged in the same activity (they even had rules about spending too much time at work in the Soviet Union, and those guys were all about putting in the time for the good of the people). What about diet, you can only survive on coke for so long – poor John couldn't even make it to 40.

Can you tell that I am against long hours and death marches yet :)? Maybe one of these days I'll tell you how I got my wake-up call, it is an interesting story. Herding cats is easy compared to getting developers to make a concerted effort in the same direction, it is something I both love and hate about our people (programmers) :). But I do wish that once in a while all the smart developers just took a stand to eliminate at least one of the truly crappy and counter-productive trends in our industry. As far as I am concerned, smart programmers don't like to work long hours and won't be pressured into it – there is more to life.