Let's say I have the following text:
The first program a computer science student sees is usually
program HelloWorld(output); begin WriteLn('Hello, World!'); end.or
10 PRINT "Hello World!"The second program ...
How should I punctuate such a text? Putting a period in front of "The second program ..." looks really ugly. With mathematical equations, it's possible to add punctuation at the end of an equation, but for code samples it's impossible, as it would break the code. For example, the first code snippet must end with the period, while the second one must not.
There are a few other question (like For formal articles, should a displayed equation be followed by a punctuation to conform to the language grammar ?) that deal with a similar problem, but only for mathematical equations, not for code samples, where the situation is different.