Re: Coding Standards



"Lew" <lew@xxxxxxxxxxxxx> wrote in message
news:TcidnTxh24np4kXbnZ2dnUVZ_uejnZ2d@xxxxxxxxxxxxxx
Another trick someone showed me years ago for in-code comments (as opposed
to Javadoc comments) is to start them at some defined position, say,
column 45 (1-based). Then you can read down the right side of the source
listing and see comments, down the left side and see code.

Sort of like:
/** Javadoc comments here. */
public void foo()
{
doSomething(); // do a vital thing
cleanUp(); // close all connections
logResults(); // log to system-defined output
fireEvents(); // notify registered listeners
}

He had probably been an assembly-langauge programmer; it was very common for
assemblers, especially those which read punched cards, to have fixed fields
for (say) label, operator, operands, and comments, e.g.

start: mov r0 -(sp) push start address
mov r1 -(sp) push size
mov r2 -(sp) push destination address
jsr copy copy block



.