Re: [dev] c++-style comments [was fsbm]

From: Bobby Powers <bobbypowers_AT_gmail.com>
Date: Thu, 6 Nov 2014 15:56:54 -0500

Hello,

FRIGN wrote:
> De gustibus non est disputandum. I personally prefer {/*, */}.

Agreed - taste is taste.

> There are many ways to show why {/*, */} sucks less than {//}. Here is
> one:
> If you take a look at C, everything is block-oriented. The smallest
> linguistic entity is "...;", followed by "(...)" and "{...}". The
> traditional comments "/*...*/" are part of this axiomatic system.
> This approach is not line-oriented. Taking preprocessor
> directives and includes aside, you can literally strip all newlines
> from a given C-source and it would still compile.

Since I'm only interested in writing code that runs on an operating
system with a kernel, there is no time where I would create a binary
from C source code that doesn't #include something. This doesn't seem
to simplify any non-toy compiler implementation.

> Given we at suckless work according
> to the UNIX-philosophy, and even though UNIX-streams are mostly
> line-oriented, a C-source should not depend on non-printable characters
> to function properly (except for includes and preprocessor directives).

There is a lot of except and even though in that statement

> Moreover, if you write multiline-comments and use {/*, */} while at the
> same time using {//} for one-liners can really disrupt code consistency,
> and in the end make code harder to maintain and augment.

I happily concede this, and would have no trouble writing /**/
comments in suckless software.

yours,
Bobby
Received on Thu Nov 06 2014 - 21:56:54 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 06 2014 - 22:00:11 CET