JavaScript syntax highlighter: is that important?

I stumbled on this review of the most popular JavaScript syntax highlighters. They seem all interesting to me, but the key question is: are they important? The fact that they only present the source code in a good-looking fashion doesn't necessarily mean that this is a feature that a web developer should consider a must for his/her site.

It's vital to notice that an important aspect of the topic has been overlooked: how to add semantics to the elements that will contain our source code? JavaScript highlighters don't add semantics but they only transform a raw sequence of lines into something structured. What about microformats? That would be a semantic feature that could actually improve the quality of our documents. For example:

<span rel="variable">var foo;</span>

This is only one possible application of microformats from the point of view of the semantics of our code. Of course we could also use the too often neglected code and samp elements to provide an extra layer of semantics.

Leave a Reply

Note: Only a member of this blog may post a comment.