Sujet : Re: Which code style do you prefer the most?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 27. Feb 2025, 08:45:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vpp57g$318u4$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 26.02.2025 22:44, Lawrence D'Oliveiro wrote:
On Wed, 26 Feb 2025 14:26:41 +0100, Janis Papanagnou wrote:
Personally (in "C") I prefer '//' though.
I don’t know why, really.
Beyond punctuation cluttering that I already mentioned it is its
simplicity, less typing, better readability, and also less issues
with it. - I see that bart already answered that sufficiently.
C started with the “/* ... */”, and that remains
more versatile with its ability to be inserted in more places.
Historic decisions are not (per se) a reason to use something.
There's reasons why '//' had been introduced, and I understand
perfectly why.
I acknowledge that you have different preferences.
BTW, there's many languages that use this comment syntax type.
E.g. '#' in Shell, Awk, and other scripting languages, '--' in
Eiffel, '//' in C++. It's noteworthy that ASN.1 (for example)
uses '--' to start a comment (up to the end of the line) but
you can also end the comment within the same line with another
'--'.
Then we have the brace-types, C's /*...*/, or Pascal's (*...*),
or Algol's 'co' ... 'co', or 'comment' ... 'comment'.
Then we have Simula's [explicit] (multi-line) 'comment' ... ;
or its (syntactically not explicitly marked) 'end'-comments.
You take what the language provides, or what suits you best in
case you have options.
Janis