This has bothered me for a while... Ever since the bulky padding and gray background were added to <code>
elements, really. But I kept hoping I would get used to it...
...I didn't. It's ugly, it's distracting, it makes me not want to mark inline code and identifiers when I'm answering questions.
The problem
Here's what I'm talking about:
The horror http://shog9.com/so_code_slur.png
Note how the keywords and identifiers pop out of their surrounding text, completely destroying my best efforts to integrate language keywords with the grammar of the sentences referencing them. That's annoying.
But that's not the worst of it. The background shading, coupled with the excessive padding, can lead to something not unlike rivers when code appears on adjacent lines:
Way down down along lazy river road http://shog9.com/so_code_river.gif
This is terribly distracting. What's the point of carefully marking up key parts of text if the result is ugly and distracting?
A solution
First, get rid of the padding:
getting better... http://shog9.com/so_code_no_padding.png
This already helps. The text isn't so broken-up, and you can kinda separate the code on adjacent lines. But it's not enough. That background color still intrudes, tainting what should be clean, white space around the letters. Ditch it, and color the text itself. Maybe increase the weight, if you're really worried about it blending in too much:
ahh... much better http://shog9.com/so_code_subtle.png
There. No gray padding ghetto, no rivers... Much less offensive. At least, I think so. Anyone else?
gif
is irritating me terribly.<code>
to highlight ... y'know ... actual code.<code>
block. How will this post compile, if you don't properly and obsessively mark every single thing that could possibly be code.. with the<code>
tag?<pre>
block with .. actual code. Not enough words. So either add more words that explain around the code, or just make it all code and forget about prose altogether. Things that are bad (tons of marked up code with almost zero plain, readable explanatory prose) should look bad.