I am writing a technical document in which I need to intersperse examples into paragraphs. For example I have a sentence like below:
For example, rather than the following code example:
//This is some bad code
We should use this code example instead:
//This is some good code
This reads as one sentence: "Rather than [thing A], we should do [thing B]." My issue is I'm not quite sure of the proper way to handle punctuation or capitalization. If this is a single sentence, I would think there should be a comma after the bad code example and period after the good code example, but it just seems out of place to have them. I'm also not sure if the colons are appropriate (though again, it looks weird without them). Also, I would think that "We" should not be capitalized, because it is a continuation of the above sentence, but that again, it doesn't look right.
What's the proper way to handle this kind of thing?