comment style

Tom Jaskiewicz tj at Alliant.COM
Thu Jan 10 08:15:22 AEST 1991


My first impression of // comments was that they are a harmless addition
to the language.  After reading some of the discussion in this newgroup
I now believe that they are not harmless.  // comments would add no new
capabilities to the language (comments are already possible), but would
add an interesting set of interactions with other language features.

If you do add // comments to c, what does the following code do?

/*	printf("One\n");	/* 1 */
	printf("Two\n");	/* 2 */
/*	printf("Three\n");
//	printf("Four\n");	/* 4 */
	printf("Five\n");	/* 5 */
//	printf("Six\n");	/* 6
	printf("Seven\n");	/* 7 */
/*	printf("Eight\n");
// */	printf("Nine\n");
	printf("Ten\n");	/* 10 */

This makes // look like a dangerous idea.
-- 
##########################################################################
# The doctrine of nonresistance against arbitrary power, and oppression is
# absurd, slavish, and destructive of the good and happiness of mankind.
#   -- Article 10, Part First, Constitution of New Hampshire



More information about the Comp.std.c mailing list