Jul. 20th, 2007
ученые подсчитали
Jul. 20th, 2007 03:48 pmУченые предсказывают повышение уровня смертности в летний период во всем мире в связи с изменение климата. Причем рост смертности от жары не компенсируется ее снижением зимой из-за глобального потепления.
Об этом говорят исследователи из Школы экологического здоровья при университете Гарварда.
Как ожидают специалисты, к 2100 году средняя температура на Земле увеличится от 1,7 до 4,9 градусам Цельсия. Это приведет к увеличению количества теплых летних дней и сокращению морозных зимних.
Я ихний русский не очень понимаю ("увеличится от 1,7 до 4,9 градусам Цельсия"), но немного потепления не помешалбо бы: последние годы я никак не наблюдаю "сокращения морозных зимних" - этой зимой и бугенвилия повымерзла, и жакаранты тоже хреново себя чувствовали... и какие-то там забыл какие цветы в горшках тоже померзли.
Lightweight Coding Manifesto
Jul. 20th, 2007 06:42 pmIf you are a good, respoinsible, dependable programmer, you are pretty familiar with unittesting, test-driven development, refactoring, large refactoring... in short, all the great things Josh Kerievsky has been teaching those willing to listen. Say, you start developing a neat piece of code, and of course, if you are a serious developer and the stuff you are writing is not an html table rendering script, you'd start with tests. They tell you what you are looking for. Tests fail, developer succeeds.
Now imagine you are given a piece of shit. That's what happens to us all the time. Someone in India wrote that piece of shit and ran away; now it is your responsibility to turn it into candy. Apply the same technology: unittests, refactoring to patterns, and in half a year you may produce a good piece of code. If the underlying idea happens to be good - which is not always the case.
And of course, if you are a Rus sian programmer, you'll complain aloud: "Fuck those Indians", etc. If it happens that you get a piece of shit written by a Russian, you'll shout something like "Never deal with Russian programmers, they are crazy!". Here's the list of crazy programmers ethnicities whose code I have been dealing for the last several years: Americans, French, Russians, Chinese, Indians, Brazilians, Romanians... either there are no other programmers in this world, or the Germans and the Japanese prefer not to show me their code.
What I want to say: we are all idiots in the eyes of other idiots.
Imagine, you write a neat, complicated code solving a non-trivial problem in the most efficient way possible. Then there comes a dumb guy of ethnicity X, does not understand a shit in what you wrote (with all the header comments and tests... he just does not know what is "reverse index", "Markov chain" and "regular grammar"); do you think he thinks you are smart? He thinks you are a moron. The problem can be solved by just maintaining a couple of tables, instead of parsing indirect set of data. Like figuring out a girl's phone number - you can look her up on the web, sign up for a service, just $20 bucks a months, they'll let you know in 5 business days - or you can just ask her. Well, not that I am interested in men, but the contractor I need to install a window of my house, I never asked his phone number, I look him up on the web, and dial. Which must be considered stupid from the contractor's point of view.
What do you think, who is smarter, a guy in Bangalore, who spent a week writing a piece of code he'll forget about in the next week, or a Russian guy in Sunnivale who, chained to the company by his greencard process pending, spends the next two years trying to work with that piece of code?
Of course it it hard to tell in general, who wins. Once our team worked on a construction site, and we were kicked out by the middleman when we were almost done. Yes, we got paid. But no, we did not get the bonus for finishing the stuff. The last truck of concrete was laid by the guy's friends, with all the consequences.
What makes us, stupid Russian programmers, to spend time over Indian or Chinese spaghetti code? Why did not the Indian guys accompany the code with unittests and good comments? First of all, they were not paid for it. They were paid for writing a prototype, and they were good at writing a prototype. It looks like a working code, and it even works at times. Why bother?
Say, you write your own code, and then what? You are going to maintain it all your life (like I maintain myjavatools.com)? No; you will, most probably, move on in a couple of years. Or you write something that can be sold. A cheap crappy concoction of PHP and mySQL. In a year the guys who wrote it get their $100M and move on. Or retire. And your task will be to rewrite the crap into Java, redesign it, make it robust, scalable, impenetrable to attacks... and then what? When it is perfect, nobody needs it anymore. You switch to another prototype writen by college students or by someone in India.
You should not. This does not pay. PHP and mySQL does; Java does not. Being good does not help. Nobody asked PHP guys how come their code has so many bugs. They'll ask you. They think you are a sucker.
And who needs a three-year old code anyway? Who needs all those great general libraries solving general problems in a way that nobody will need 5 years from now. Yes, you'll be proud of yourself. But you can be proud of yourself even doing nothing.
So, here's what I suggest. Stop working on Other People's Code. It sucks, and you know it. Stop writing an eternally-perfect code. Where's the beautiful code written 30 years ago? In museums, write? But not the kind of museums where they keep beautiful paintings of 300 years ago. A very different kind.
Don't use obscure languages; you won't be able to sell it to the idiots around. Do you think Shakespeare would be known in our days if he wrote in Inuktikut or Northern Ndebele?
Sure you can use all the new technologies - for yourself, if they help you roll out the stuff as fast as possible. But if they make the code robust, reliable, everlasting - forget about it. Even if the code still works 10 years from now, they won't pay you royalties. But the genius who slapped a bunch of stupid PHP or Visual Basic and made it a popular toy for the millions, and whose code was rewritten into Java, he is getting royalties. Like, a bucks for each new customer. It may not make him a billionaire, but we are professionals here, not greedy corporate hogs, right?
And when you write your pop=app, do you care about Kolmogorov complexity? Hardly. How many people are sincerely, daily interested in checking whether Riemann hypothesis has been verified? How much will they pay you if you know the answer?
I know, I know. So many of us prefer to be a Grisha. But confess to yourselves, are you any close to the kind of a problem he has solved? The problems we solve, mathematically speaking, are so primitive... The beautiful code we write will be forgotten 10 years from now. Why care if it is 10 years and not 10 days? Guys in India manage to forget their code within 10 days; why should we bother then? What's so important that we produce by spending nights saving bytes?
Nothing.
Now imagine you are given a piece of shit. That's what happens to us all the time. Someone in India wrote that piece of shit and ran away; now it is your responsibility to turn it into candy. Apply the same technology: unittests, refactoring to patterns, and in half a year you may produce a good piece of code. If the underlying idea happens to be good - which is not always the case.
And of course, if you are a Rus sian programmer, you'll complain aloud: "Fuck those Indians", etc. If it happens that you get a piece of shit written by a Russian, you'll shout something like "Never deal with Russian programmers, they are crazy!". Here's the list of crazy programmers ethnicities whose code I have been dealing for the last several years: Americans, French, Russians, Chinese, Indians, Brazilians, Romanians... either there are no other programmers in this world, or the Germans and the Japanese prefer not to show me their code.
What I want to say: we are all idiots in the eyes of other idiots.
Imagine, you write a neat, complicated code solving a non-trivial problem in the most efficient way possible. Then there comes a dumb guy of ethnicity X, does not understand a shit in what you wrote (with all the header comments and tests... he just does not know what is "reverse index", "Markov chain" and "regular grammar"); do you think he thinks you are smart? He thinks you are a moron. The problem can be solved by just maintaining a couple of tables, instead of parsing indirect set of data. Like figuring out a girl's phone number - you can look her up on the web, sign up for a service, just $20 bucks a months, they'll let you know in 5 business days - or you can just ask her. Well, not that I am interested in men, but the contractor I need to install a window of my house, I never asked his phone number, I look him up on the web, and dial. Which must be considered stupid from the contractor's point of view.
What do you think, who is smarter, a guy in Bangalore, who spent a week writing a piece of code he'll forget about in the next week, or a Russian guy in Sunnivale who, chained to the company by his greencard process pending, spends the next two years trying to work with that piece of code?
Of course it it hard to tell in general, who wins. Once our team worked on a construction site, and we were kicked out by the middleman when we were almost done. Yes, we got paid. But no, we did not get the bonus for finishing the stuff. The last truck of concrete was laid by the guy's friends, with all the consequences.
What makes us, stupid Russian programmers, to spend time over Indian or Chinese spaghetti code? Why did not the Indian guys accompany the code with unittests and good comments? First of all, they were not paid for it. They were paid for writing a prototype, and they were good at writing a prototype. It looks like a working code, and it even works at times. Why bother?
Say, you write your own code, and then what? You are going to maintain it all your life (like I maintain myjavatools.com)? No; you will, most probably, move on in a couple of years. Or you write something that can be sold. A cheap crappy concoction of PHP and mySQL. In a year the guys who wrote it get their $100M and move on. Or retire. And your task will be to rewrite the crap into Java, redesign it, make it robust, scalable, impenetrable to attacks... and then what? When it is perfect, nobody needs it anymore. You switch to another prototype writen by college students or by someone in India.
You should not. This does not pay. PHP and mySQL does; Java does not. Being good does not help. Nobody asked PHP guys how come their code has so many bugs. They'll ask you. They think you are a sucker.
And who needs a three-year old code anyway? Who needs all those great general libraries solving general problems in a way that nobody will need 5 years from now. Yes, you'll be proud of yourself. But you can be proud of yourself even doing nothing.
So, here's what I suggest. Stop working on Other People's Code. It sucks, and you know it. Stop writing an eternally-perfect code. Where's the beautiful code written 30 years ago? In museums, write? But not the kind of museums where they keep beautiful paintings of 300 years ago. A very different kind.
Don't use obscure languages; you won't be able to sell it to the idiots around. Do you think Shakespeare would be known in our days if he wrote in Inuktikut or Northern Ndebele?
Sure you can use all the new technologies - for yourself, if they help you roll out the stuff as fast as possible. But if they make the code robust, reliable, everlasting - forget about it. Even if the code still works 10 years from now, they won't pay you royalties. But the genius who slapped a bunch of stupid PHP or Visual Basic and made it a popular toy for the millions, and whose code was rewritten into Java, he is getting royalties. Like, a bucks for each new customer. It may not make him a billionaire, but we are professionals here, not greedy corporate hogs, right?
And when you write your pop=app, do you care about Kolmogorov complexity? Hardly. How many people are sincerely, daily interested in checking whether Riemann hypothesis has been verified? How much will they pay you if you know the answer?
I know, I know. So many of us prefer to be a Grisha. But confess to yourselves, are you any close to the kind of a problem he has solved? The problems we solve, mathematically speaking, are so primitive... The beautiful code we write will be forgotten 10 years from now. Why care if it is 10 years and not 10 days? Guys in India manage to forget their code within 10 days; why should we bother then? What's so important that we produce by spending nights saving bytes?
Nothing.