Friday, August 15, 2008

Russian Programmers

This text had been originally found in Russian, and then translated for the sake of my coworkers. For many years, it was hiding in backups until I found it again recently - and I think it hasn't lost its actuality since the time it's been translated (about 2000).

Original author is unknown. Original Russian text is lost (UPDATE: found again). If you are the author, or know the author, the chance to add the reference and give credit to the person who absolutely deserves it would be appreciated.

Here goes.

Any Russian programmer will spend just a couple of minutes to read someone else's code, and then will invariably jump and start shouting to himself: The hell with it! Throw it away! Rewrite it all! Then, a glimpse of a doubt will appear in his mind for a split second, and the rest of the day he will spend convincing himself that it is not that hard of a job to rewrite it all. And if approached right, it'll be piece of cake. But it will be The Right Thing, lean and mean and clean and nice. Next morning, he's adamantly convinced and is reporting to the supervisors that rewriting the code will take a day. No more than a day. All risks included, two days. As a result, he will be granted a week, and six months later it will be successfully finished. Until another Russian programmer sees it.

Meanwhile, in the four adjacent cubicles four Chinese programmers will work hard. In some unimaginable way, these programmers are managing to appear earlier in the office than their Russian colleague, they are managing to go home later, and at the same time they are managing to do three times less together than that one Russian guy. These four haven't produced any new code for a long time, they are just maintaining the code once written by an Indian programmer and then rewritten by two Russians. Bugs don't just live in this code. They have their nest in it. This nest is constantly reproducing itself, viciously using favorite Chinese technology known as "copy'n'paste" in other parts of the world. The bugs are proliferating from this code using static and passed by reference variables (because the Chinese programmers can't stand the inconvenience of not being able to change the value of the variables passed to their modules by the calling modules the Russian programmer is busy rewriting).

When coming across this module, the Russian programmer becomes speechless for a short period of time, then starts rapidly talking a mix of Chinese and Russian. He's long planning to rewrite the Chinese module, but he doesn't have time. The Chinese are responsible for critical bugs, and the management knows about it, and is harassing them constantly. The Chinese programmers keep hastily reassigning the bugs to each other, because they suspect that their attempts to fix the bugs will cause new, even more serious bugs. And they are right in their suspicion.

There's the only person in the office able to figure out how exactly the static variables get their values and in which order - the Indian programmer. But he's meditating. Therefore, when the Chinese Gang Of Four is laid off... Why them? Who else?!?!? Russian guy hasn't finished rewriting yet, and the Indian - the company's main asset - rarely pays any attention whatsoever to the project, but when he does, everybody is suddenly reminded that there's no one else who gets the architecture. So, when Chinese are let go, the code has two possible fates. One, Russian gets it and rewrites it. Two, Canadian gets it.

The Canadian is another thing altogether. Without a slightest hesitation, he will rush forward to fix the cruelest and nastiest Chinese made bug. The Chinese reported it fixed four times (each of them once), but every time it was back, even more intimidating, like Schwarzenegger. So, the Canadian will do what Chinese have not dared to do for the last three years. He will use the debugger to find out where exactly the static variable will become -1 instead of correct 0, and with steady hand, will introduce another static variable next to it, with the correct value. The bug will be defeated.

But the price of the victory will be high.

Everything, including the code that the Russian has just finished rewriting, will cease to work. The Russian will be dumbfounded for a couple of days, after which he will announce that of course, the design was wrong from the very beginning, and everything has to be rewritten. It will take a week. No more than a week. The Canadian will valiantly move to fix the bugs, but everything will become ever worse, though who would have thought... The commotion will kick the Indian out of meditation, and he will offer a brilliant solution - to branch the code. There will be two branches - one with The Bug, but working, and another, without The Bug, but not working either. The Russian, upon hearing of such decision, will break his slide rule in half and call his wife names after he gets home, but will say nothing to the management.

Fortunately, none of it will matter at all, because the product is selling anyway. Therefore the management is generally happy and is constantly reminding the employees that they were selected as creme de la creme. And that they have firmly established their ability to release the product by being able to release it. Once in a long while.

No comments:

Post a Comment