Re: comment style

Tuukka Toivonen (tuukkat@stekt.oulu.fi)
Mon, 1 Dec 1997 18:28:31 +0200 (EET)


On Mon, 1 Dec 1997, Richard B. Johnson wrote:

>package. It costs about US$100,000. It could not be compiled on any
>available cross-compiler because the Vendor/Producer used '//' for
>comment delimiters.

>We needed to hire a SW Engineer to support this package because it
>contained about 1/4 million lines of code that had to be changed. This

Maybe I am missing something, but I can't understand any reason why
this couldn't be automated by a very simple script that just replaces //
and newline pairs with /* and */\n. Experienced script writer could do it
in 5 minutes or less.

>Personally, I think:
>
>// This looks much better than...
>/* This....*/

I think so too, because it's easier to see where the comment ends (always
on the same line with //). But /* and */ are good for multiline comments.

And besides -- we were now talking about comments in Linux kernel source,
and AFAIK, the source uses already a lot of special features of GCC
compiler. And as GCC supports C++ -styles comments, they aren't a
problem. Almost all ports of Linux use GCC too, maybe the only which
doesn't is Linux/ELKS.

So in my opinion, the only reason why to use (only) old-style comments
are some C source syntax checking programs, which don't know C++-comments.

| Tuukka Toivonen <tuukkat@stekt.oulu.fi>
| Homepage: http://stekt.oulu.fi/~tuukkat/
| Try also finger -l tuukkat@stekt.oulu.fi
| Studying information engineering at the University of Oulu
+-----------------------------------------------------------