The Random Counter page

I had figured that a counter CGI program that generated a random number would be a neat hack, and about as useful as most real counter. However, Randal Schwartz beat me to it on his home page. Then I saw Abigail's Counter Attack page, which selects 25 counters at random from her list of counters. I suddenly realized that the phrase random counter could be interpreted in more than one way - as selecting a random counter from a list. So I went ahead and did it, and added it to my home page for the amusement of others.

The obvious question is, why do this, except for hack value? The answer is that page counters in and of themselves serve no useful purpose other than hack value - and they are all over the net. By pointing this out, maybe we can do something to stop the spread of these things.

As to why they serve no useful purpose, you must consider that there are two ways to implement counters (and my counter only returns one of them):

IMG counters
which run a script and return an image of the number for inlined images.
server-side counters
which count accesses by having the server parse the HTML and run programs as it does so.

Both types of counter suffer from not being counted by people who are reading the page from a cache.

Server-side includes - in fact, server-side processing in general - are a bad idea. See my page on why server-side processing is evil for details.

IMG counters run into even more accuracy problems than server-side counters, as they aren't incremented unless someone loads the image. Given that 25% of the people loading my home page don't load images, this is a noticable undercount. To add to the difficulty, other people are now including IMG counters that aren't theirs (in fact, the Random Counter script did just that, choosing a victim at random), causing the count to be incremented when someone didn't read the page.


Mike W. Meyer