Why "//" can't be used as comment-to-end-of-line

Andrew Klossner andrew at orca.UUCP
Sat Dec 15 18:49:59 AEST 1984


[]

	"If you must have a comment-to-EOL convention (great stuff, but
	it may be a bit late to add it to C), the character(s) used to
	mark it preferably should be unshifted and near the home row.
	"//" comes much closer to this than "$$"."

This suggestion keeps coming up.  If "//" were added to the language to
mean "comment from here to end of line", it would break programs
containing lines such as the following:

	quotient = /*numerator*/num//*denominator*/den;

It therefore is not a valid extension for consideration by ANSI X3J11
under there "don't break existing programs" rule.

If you want to use characters on the home row, why not "::"?

  -- Andrew Klossner   (decvax!tektronix!orca!andrew)       [UUCP]
                       (orca!andrew.tektronix at csnet-relay)  [ARPA]



More information about the Comp.lang.c mailing list