The context of this post is Rob Weir's blog post about how Microsoft screwed up the implementation of www.browserchoice.eu.
That web site
exists as a concession to EU anti-trust officials, who objected to the fact that Windows automatically uses Microsoft's own Internet Explorer web browser. This doesn't prevent users from installing and using other browsers in place of IE. But of course most users don't know they can do this, much less why they should. So, a European user who fires up Windows 7 for the first time is presented with the option of going to this web site and installing any of a dozen competing browsers. To insure fairness, the order in which the browsers are listed is randomized each time you access the site.
Except the randomness isn't as random as it should be. If you automatically bring up the site over and over (and of course many people have done that) it becomes obvious that certain placements are much more likely than others. In particular IE tends to come out at position 5 about half the time. Many folks believe this placement is somehow supposed to favor Microsoft.
The reality is another vindication of Hanlon's Law. It can be shown that this screwup reflects a common mistake in the way you write code that chooses a number randomly. Weir talks about the evidence for this and concludes that one should "reach for Knuth".
This is a reference to the Donald Knuth's well know text The Art of Computer Programming. Weir is arguing that whoever wrote this code needs to refresh their understanding of the science of generating random numbers.
Weir is himself making a mistake here. He assumes that all programmers are or should be computer scientists. The fact is most programmers don't have a thorough understanding of computer science, and don't need to. As with any technology, the technologists -- engineers, mechanics, etc. -- have to understand the scientist well enough to comprehend the structure of their work, but doesn't need to be able to reproduce the scientist's work. In fact, technologists who try usually end up being pretty bad scientists.
The Microsoft programmer's mistake was not writing a bad implementation of a random number algorithm. Their mistake was trying to write it at all. There's canned code for this sort of thing, and a good programmer relies on it.
Josh Bloch (who most certainly does rate as a computer scientist) refers to this very use case when he talks about why you should rely on library code.
That web site
Except the randomness isn't as random as it should be. If you automatically bring up the site over and over (and of course many people have done that) it becomes obvious that certain placements are much more likely than others. In particular IE tends to come out at position 5 about half the time. Many folks believe this placement is somehow supposed to favor Microsoft.
The reality is another vindication of Hanlon's Law. It can be shown that this screwup reflects a common mistake in the way you write code that chooses a number randomly. Weir talks about the evidence for this and concludes that one should "reach for Knuth".
This is a reference to the Donald Knuth's well know text The Art of Computer Programming. Weir is arguing that whoever wrote this code needs to refresh their understanding of the science of generating random numbers.
Weir is himself making a mistake here. He assumes that all programmers are or should be computer scientists. The fact is most programmers don't have a thorough understanding of computer science, and don't need to. As with any technology, the technologists -- engineers, mechanics, etc. -- have to understand the scientist well enough to comprehend the structure of their work, but doesn't need to be able to reproduce the scientist's work. In fact, technologists who try usually end up being pretty bad scientists.
The Microsoft programmer's mistake was not writing a bad implementation of a random number algorithm. Their mistake was trying to write it at all. There's canned code for this sort of thing, and a good programmer relies on it.
Josh Bloch (who most certainly does rate as a computer scientist) refers to this very use case when he talks about why you should rely on library code.


Leave a comment