/var/log/rant is my code blog. When I want to rant about code, I rant here. And, often, rants about code include code.
My old way of handling it is to use Blogger Syntax Highlighter, where I put in a PRE tag where name is "code" and class is the language in question. I have it set as defaulting to "python", so if I forget to remove it, it doesn't come off as Perl for Iron Man Perl if I'm blogging about something else. It is very powerful, but problematic in escaping characters, so I'm easing away from it.