Here is an amusing text that I ran across. It was in russian, with no author
or title. Everyone at work liked it so much (the russians, anyway) that I
bothered to translate. The style of the original is preserved quite closely.
Dedicated to camz, who does not cease to bring the best out of me
Thanks to Ian for the link to the text.
National programming styles explained
Any russian programmer will, after a couple minutes of reading some code,
jump and tell himself: rewrite the whole damned thing! Then he will have
some second thoughts about how long that would take, so he’ll spend the rest
of the day convincing himself that it only appears to be a big task.
Naturally, it shoud work out just fine if he’ll just sit down and do it. At
least the code will come out right and elegant. Next morning he’s feeling
fresh and self-satisfied and reports to the management that it will only
take one day to rewrite that piece, no more. Yes, no more. Two, in the worst
case and if you adjust for all the risks. In the end, the management will
give him a week and he’ll successfully complete it after 6 months… when
that piece will be seen by another russian programmer.
Meanwhile, in the four neighboring cubicles the work of chinese programmers
does not stop for a second. They manage to report to work before the russian
and leave after him, but do about 3 times less work. This quartet does not
write any code for a long time, they only maintain the code that was
originally written by an indian and since then rewritten twice by the
russians. This code does not just have bugs. That is their nest. The nest
continuously reproduces itself using the favorite chinese code reuse
technology called copy/paste. From there bugs spread out by means of static
variables and pointers passed into functions (since a chinese programmer
can’t live with the inconvinience of not being able to modify outer scope
variables passed into his function by modules being rewritten by the
Recalling this function the russian usually loses the ability to speak
english for some time and switches to some mix of russian and chinese. He
wishes for a while already to rewrite the whole piece that is being worked
on by the chinese, but he lacks the time. The chinese have serious bugs
hanging on them, of which the management is aware and constantly hurries
them up. They hastily reassign the bugs to each other, since they know that
attempts to fix them will only lead to new ones that are even worse. And
they are right in that thought.
To figure out the order in which the static variables change their values
and how exactly that happens only one man in the company can - the indian
programmer. However, he is being in the state of meditation. So, when that
whole quartet will be let go during a layoff… and who else can they let
go? The russian haven’t finished rewriting his piece yet and the indian -
being the main asset of the company - he rarely pays attention to the
project, but when he does - everyone realizes that nobody knows the
architecture quite like he does. So, getting back to the layoff… when the
chinese are gone, their code has two possible fates. The first - it will be
given to the russians and they will rewrite it. The second - it will be
given to a local, canadian programmer.
Oh, the canadian programmer is a special type. He will, like a knight
without a fear, thrust ahead without a minute of hesitation to fix the most
fearsome bug of the chinese code. That Bug lives there for three years and
the chinese have already reported four times (once each) to the management
that it has been fixed. But the Bug always returned, like the Batman. So,
the canadian will do what chinese did not dare to for all those three long
years. He will, using a debugger, catch the place where a static variable
gets assigned the value of 1 instead of the 0 that it is supposed to be and
in a decicive move will create another variable next to it with the right
value. The Bug will die in the unfair fight with the canadian programmer.
However that victory will have a heavy price.
Everything will break and stop working, including the piece just rewritten
by the russian. That will make the russian think about all this for whole
two days and then he’ll come to the quite predictable conclusion that the
whole design was wrong to begin with and everything needs to be rewritten.
That will take a week. Two, at the most… The canadian will bravely go and
try to fix everything, but it will only make things worse, even though
nobody thought it could… This vain will pull the indian out of the state
of meditation and he will come up with a solution worthy a true genius - to
branch the code. According to his plan, they will now support two branches
of the code - one with the Bug but working, the other not working but
without the Bug. The russian, when he hears about the plan will break a
ruler against an edge of a table and call his wife a bitch at home, however
he won’t argue at the meeting.
Fortunately, all that does not affect the business much, since the product
sells anyway. So the management looks generally satisfied and does not cease
to remind everyone that they are selected as the best from the best. And
that we have proved our capability to release a product by releasing it from
time to time.
translated from russian