Class struggle

I’m irked by the fact that I keep running into web sites that use mark-up class names that follow the content language. The web and its mark-up are open to the world, to both humans and machines. For better or for worse in terms of mark-up English is the lingua franca and its metadata should at least also be in English. An ID on the other hand can be part of the content (ie fragment identifier) and when it is it ought to follow the content language of the current document. It can get a little messy, but there is method to the madness.

The Dutch government’s web guidelines on descriptive IDs and class names suggest in examples that we can use a language other than English. This is in my opinion complete and utter nonsense and even harmful. For one lumping class names and IDs together like that is to obscure their specific relevance to the structure and content. Shame on them.

The key is that one is a classification and the other an identifier. A classification is best when it is a noun and has descriptive/semantic meaning. This semantic meaning is not directly related to the content but to its context. This is an important difference and why you shouldn’t base class names on the content language. The main reason why I think class names should be in English is that HTML’s tag approach is English-based. English is the de-facto language for modern high-level programming and why meta systems like Microformats use a human-readable language as a universal way to catalogue content. In fact, effectively all metadata systems that tie content together are in English. There is no reason for the metadata not to be in English. To add fragmentation to this ecosystem by inserting an alternate linguistic layer is foolish because it immediately excludes the content from a larger pool of content on the Internet. You, in one stroke, would have abstained from adding value through richer context.

Class names are metadata and not content. Metadata conventions use English and so should your class names.

Next entry: The Web Stack is the next native platform
Previous entry: Pay me