comment style

Karl Heuer karl at ima.isc.com
Mon Jan 21 13:22:52 AEST 1991


In article <936 at hadron.COM> jsdy at hadron.UUCP (Joseph S. D. Yao) writes:
>I got code [containing "//" comments] from [somewhere] some 12-15 years ago
>(was that you, Karl? since you claimed to be first)

No, I wasn't the first; I merely reinvented the idea before knowing about the
related implementations (BCPL and C++).  But I never wrote any code that way.
(I did once experiment with having my own preprocessor, and I think I wrote a
handful of programs using it, but I quickly abandoned that in favor of writing
portable code.)

>It was the devil to get out so that a "real" (from Ken & Dennis' pen) C
>compiler could compile it.  The point is, if it's not in C, don't use it.

Exactly.  Though I'm willing to bend the rules for stuff that can be simulated
without too much trouble: I used void before it was universally available,
since a simple typedef suffices to make it acceptable to voidless compilers; I
write new code with prototypes, using a style that my deprotoizer can parse.
Since I have a tool that knows the lexical structure of C and C++, I wouldn't
hesitate to start using "//" comments immediately if I thought they'd be part
of standard C in the near future.

Karl W. Z. Heuer (karl at ima.isc.com or uunet!ima!karl), The Walking Lint



More information about the Comp.std.c mailing list