That isn't necessary.
As long as code is posted in php/code/small/pawn tags and it isn't too long to stretch the page in small/pawn tags then it's fine.
The only situation in which code should be posted differently is if it is posted straight into the post or if it is in quote tags without and code-style tags.
posting using small or php is easier to read which makes people more likly to help