Programming design style

Someone needs to come up with a slick name for “designed to fail during test instead of production” or for the more common “soft” type of programming. When we write code, we assume we screwed up somewhere, an assumption based on years of bitter experience (well, we assume someone screwed up, maybe in the tools, maybe in the spec, maybe in hardware that comes with 10G of obscure errata, or maybe even now and then someone else in the company). In any case, we test and fix. We design code to fail on the slightest suspicion that something is not right – so our tests can catch failure. Soft programming is full of palliatives that have the effect of causing catastrophes. Here’s an example: out of memory process killers in page allocators. The idea is that when memory becomes too tight, some randomly chosen (or heuristically chosen, comes to the same thing) process is terminated to make room for the others and to prevent deadlock. Somewhere down the line the OOM Killer will kill exactly the wrong process at exactly the wrong moment – because, contrary to what OS developers think, the applications are the purpose the the whole system. That somewhere down the line is improbable but inevitable. So OOM Killers make it unlikely that tests of OOM conditions will find the worst case. That seems exactly wrong. You should want your tests to find every possible flaw as soon as possible so that you can root them out of your released code. Is that so wrong?

Advertisements

Afghanistani mountain village ponders Microsoft business tactics

From Rory Stewart’s book the places in between about his absurd/wonderful walk accross Afghanistan in 2002:

That night we stopped in Dahan-e-Rezak, Dr. Habidullah’ mothers village. This was my first night in a tribal hill village. … Everyone in Rezak was descended from a single grandfather. There were six houses and seventy people in the village … the village diet was limited to plain nan bread for breakfast and lunch and occassional beans for dinner. … As we went to sleep [in the common room in the headman’s house VY] someone turned on a radio tuned to the BBC Dari service. A Bill Gates speech on American policy towards monopolies was being translated into Dari. The men listened intently. I wondered what these illiterate men without electricity thought of bundling Internet Explorer with Windows.

My grandmother grew up in an isolated village where the next meal was a subject of much concern and where news of the big outside world came from incomprehensible tales and old newspapers brought by peddlers on foot. I can imagine the villagers gravely contemplating news of the doings of French railroad barons in exactly the same way.