More about web development: do not try to be cool

Just one more little thing about web development: the less you try to be cool, the better result you get.

Take an example. I am looking now at the Doxygen documentation. It has some examples, marked with \code…\endcode. These commands are intended to produce beautifully marked up code, with syntax highlighting, fixed-width font etc. And indeed it does very nice job, but for some reason in HTML Doxygen output it sets “font-family: Fixed, monospace; font-size: 95%;” for it. I do not understand this “font-size: 95%” even a little bit! What the hell is it doing here? Font sizes are really very unstable thing, they tend to differ on almost any platform and difference of “5%” is unlikely to make things significantly better. In fact, it will actually more often make them worse, triggering some kind of badly implemented font scaling mechanism.

In my browser it looks a kind of crappy, but it is not those “5%” fault. Actually, these “5%” do not seem to do anything in my browser on my platform, and I am quite happy with it. The problem is caused by that “Fixed” font. For some reason it does not look good here. Removing this “Fixed” and leaving just “monospace” (note, standard CSS font family!) makes things look just fine.

And what exactly the reason for this “Fixed” to be there. It is code, so it should be displayed in fixed-width font, yes. So “monospace” is necessary. But why the hell is “Fixed”?! Not even “standard” “Courier New” or something. Probably because it was looking very cool on that guy’s platform. So he tried to make things look cool for everyone and inevitably failed.

Web is not the place for excessive artwork. If you are not sure whether you need this thing or not, better leave it out. This may make things look not-so-cool on just one platform, but will greatly decrease probability of looking them awfully on a lot of other platforms.

Leave a Reply