I realize that this rule might differ from one company's coding standards to another, but in general, which is preferred?
With a space after the line-comment:
int foo = Bar(quux + 1); // compensate for quux being off by 1
foo = Bar(quux + 1) # compensate for quux being off by 1
No space after the line comment:
int foo = Bar(quux + 1); //compensate for quux being off by 1
foo = Bar(quux + 1) #compensate for quux being off by 1
I haven't been able to find anything online regarding this aspect of coding style. My guess is that including a space is the preferred style for all languages, but I'd like some "hard evidence" to confirm or deny this.
Python's official style guide, PEP 8, is very clear about this issue:
Each line of a block comment starts with a # and a single space (unless it is indented text inside the comment).
and:
Inline comments should be separated by at least two spaces from the statement. They should start with a # and a single space.
This confirms everybody's anecdotal evidence, but I think this is the first answer to quote "some official or otherwise published coding standards" as requested;-).