www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Comments in C, C++, C# and D major

reply wolfgangamadeus <wolfgangamadeus_member pathlink.com> writes:
I dislike the c style comments.  I know for compatability reasons 
that this might be impossible but shell script pound comments are better.
I prefer the pound comment to that hideous // /* */ trogolith from C.
I can't understand what Kernighan and Ritchie chose them for C because C style
comments in short, they are a disaster.  Even Perl uses pound comments.

You should be able to use a single character to denote a comment like the pound
sign in the Bourne Shell.  I think the pound sign is a vast improvement.

Instead of some C comment for:

/* This comment really sucks because it is to verbose to comment 

*/
// or even this is stupid because you have to enter two keys to comment your 
// line. plus the double dash is a really ugly kretin from hell 
// which I have no idea
// why it was chosen.

You can use a pound shell comment (as in Perl and Shell scripts) for:








I think the pound comment is much better although it might be to politically
infeasible to swallow.
Jun 04 2004
next sibling parent reply Charlie <Charlie_member pathlink.com> writes:

though we already have three comment markers, I would welcome this addition,
though I dont have much hope that it will be adopted.  Choose your battles :/.

I prefer the pound comment to that hideous // /* */ trogolith from C.
Trogolith ? Fun word! But i couldnt find a defintion ? C In article <c9rja9$31d4$1 digitaldaemon.com>, wolfgangamadeus says...
I dislike the c style comments.  I know for compatability reasons 
that this might be impossible but shell script pound comments are better.
I prefer the pound comment to that hideous // /* */ trogolith from C.
I can't understand what Kernighan and Ritchie chose them for C because C style
comments in short, they are a disaster.  Even Perl uses pound comments.

You should be able to use a single character to denote a comment like the pound
sign in the Bourne Shell.  I think the pound sign is a vast improvement.

Instead of some C comment for:

/* This comment really sucks because it is to verbose to comment 

*/
// or even this is stupid because you have to enter two keys to comment your 
// line. plus the double dash is a really ugly kretin from hell 
// which I have no idea
// why it was chosen.

You can use a pound shell comment (as in Perl and Shell scripts) for:








I think the pound comment is much better although it might be to politically
infeasible to swallow.
Jun 04 2004
parent "Marc" <iam here.net> writes:
I prefer the pound comment to that hideous // /* */ trogolith from C.
Trogolith ? Fun word! But i couldnt find a defintion ?
Searching Trogolith gaved nothing. Trying with Trogolite brings a page with some synonyms. One of them was 'Trogolyte" Then , from this page: http://dictionary.reference.com/search?q=troglodyte "troglodyte" <jargon> (Commodore) 1. A hacker who never leaves his cubicle. The term "Gnoll" (from Dungeons & Dragons) is also reported. 2. A curmudgeon attached to an obsolescent computing environment. The combination "ITS troglodyte" was flung around some during the Usenet and e-mail wringle-wrangle attending the 2.x.x revision of the Jargon File; at least one of the people it was intended to describe adopted it with pride. May be...
Jun 04 2004
prev sibling next sibling parent Ant <duitoolkit yahoo.ca> writes:
On Sat, 05 Jun 2004 04:48:09 +0000, wolfgangamadeus wrote:

 I dislike the c style comments.
You are very lucky if this the worst think you can find in D :) Ant
Jun 05 2004
prev sibling next sibling parent Dick Zantow <rzantow ntelos.net> writes:
wolfgangamadeus <wolfgangamadeus_member pathlink.com> wrote in
news:c9rja9$31d4$1 digitaldaemon.com: 

 I dislike the c style comments.  I know for compatability
 reasons that this might be impossible but shell script pound
 comments are better. I prefer the pound comment to that hideous
 // /* */ trogolith from C. I can't understand what Kernighan and
 Ritchie chose them for C because C style comments in short, they
 are a disaster.  Even Perl uses pound comments. 
 
[...] value = somefunc( p1 /* required */, p2 /* may be null*/ ); Not that I ever comment anything, but still ....
Jun 06 2004
prev sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
wolfgangamadeus wrote:
<snip>
 You should be able to use a single character to denote a comment like
 the pound sign in the Bourne Shell.  I think the pound sign is a vast
 improvement.
<snip> "preprocessor directive", even if they don't* exist in D. Actually, one has been kept, namely #line.
 /* This comment really sucks because it is to verbose to comment 
 
 */
I think you mean "too verbose to" not "to verbose to". AIH, the D compiler isn't as forgiving as many humans are....
 // or even this is stupid because you have to enter two keys to comment your 
 // line. plus the double dash is a really ugly kretin from hell 
 // which I have no idea
 // why it was chosen.
Because it doesn't conflict with any pre-existing C(++) syntax. You can always use // for single line comments, and /* */ for multiline comments. That way, you won't need to type more than 4 comment delimiter characters however long it is. And most comments are somewhat longer than 4 characters! Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
Jun 07 2004