You have less worries
Yes, the sky is blue

Markup, not HTML, for source code

15 May 2008, by Ben    

Jeff Atwood’s idea to use HTML for his upcoming stackoverflow.com site is not a terrible one, except for one thing: source code. Even inside <pre> tags, < and & characters aren’t escaped. So instead of saying

if y < 32:
    x = (y << 3) & 0xFF

you have to write

if y &lt; 32:
    x = (y &lt;&lt; 3) &amp; 0xFF

Please, no!

Admittedly, it wouldn’t be hard for them to have their back-end convert these characters to HTML entities if they’re inside a <pre> tag. But then you can ask, is it really HTML anymore?

And would it correctly interpret “if n<pre: x >>= 3”?

Even apart from all that, however, I much prefer the simplicity and relative beauty of a good markup language (read: Textile or Markdown). And it’s hardly a learning barrier if you’ve got a pop-up “help window” nearby, like reddit or this blog do (see “formatting help” below).

Add a comment

We reserve the right to edit or remove your comment if it’s spammy, offensive, unintelligible, or if you don’t give a valid email address. :-)

We’ll never share your email address.