View previous topic :: View next topic |
Which do you like? |
'< ... >' |
|
0% |
[ 0 ] |
/' ... '/ |
|
50% |
[ 1 ] |
/* ... */ |
|
50% |
[ 1 ] |
None of the above |
|
0% |
[ 0 ] |
|
Total Votes : 2 |
|
Author |
Message |
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 19th, 2012, 5:35pm Post subject: Block comments |
|
|
I'm not sure anymore that I like the syntax for block comments that I selected a while ago. For that reason, I'm making it a popularity contest.
Please choose one of the provided options above or suggest one of your own. Examples follow.
Code: | '<
Option #1
>'
/'
Option #2
'/
/*
Option #3
*/ |
This poll will run for 30 days. _________________ Brent |
|
Back to top |
|
|
STPendl Full Member
Joined: 20 Aug 2007 Posts: 161 Location: Austria
|
Posted: May 19th, 2012, 6:58pm Post subject: Re: Block comments |
|
|
How about the following?
_________________ Stefan
Any code I post can be freely used, just give credit. |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 19th, 2012, 8:03pm Post subject: Re: Block comments |
|
|
Stefan, that looks fine for a multi-line comment, but I'm not so sure about a middle-of-the-line comment, though that's quite rare. Another aspect that I think makes a good commenting syntax is how easy it is to type. IMO, the harder you make it to comment code, the less programmers want to do it. Many BASIC proponents say they prefer the language because it rarely forces them to press the Shift key. The C-style comment can avoid the Shift key if you use the numeric keypad, but with the greater popularity of laptops these days, that convenience is diminishing. _________________ Brent |
|
Back to top |
|
|
STPendl Full Member
Joined: 20 Aug 2007 Posts: 161 Location: Austria
|
Posted: May 20th, 2012, 9:03am Post subject: Re: Block comments |
|
|
On my German keyboard I have to use the [Alt Gr]-key (right [Alt]-key) to access the following keys: @ | { [ ] } \ ~
The [Shift]-key must be used for these: ! " $ % & / ( ) = ? * ' ; : _
This tells us that a German keyboard isn't developer-friendly at all.
The only good thing is the separate numerical keypad that my 17" wide-screen notebook offers.
This would allow me to create the C-like block comment with single key presses.
For the middle of the line comments I would use the single line comment character (apostrophe) (have to look, if there is one).
I have never started a multi line comment in the middle of a line, that looks really strange. _________________ Stefan
Any code I post can be freely used, just give credit. |
|
Back to top |
|
|
tsh73_cannot_log_in Guest
|
Posted: May 21st, 2012, 7:48am Post subject: Re: Block comments |
|
|
gosh, I have a problem logging - so no poll for me. Anyway.
(If I think about adding multiline comment in BASIC) I would choose a syntax there start / end marker looks like a comment to BASIC (and BASIC programmer) (like Stefan suggestion).
Well, this language is not BASIC , so you as well might choose something different.
Why don't use some common convention, tried by other languages then?
C-ctyle option #3 looks fine, and many people will recognize it from the start.
Pascal has just {for comments}, and this way you never lose half of comment marker - unless your language uses {} for something else?
As for {} harder to type - well, show me single C/C++ programmer complaining about that Don't see a problem really. |
|
Back to top |
|
|
tsh73_cannot_log_in Guest
|
Posted: May 21st, 2012, 7:51am Post subject: Re: Block comments |
|
|
>>Many BASIC proponents say they prefer the language because it rarely forces them to press the Shift key.
Never ever heard of that. Really, sounds like utter noncence for me. |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 21st, 2012, 9:20pm Post subject: Re: Block comments |
|
|
tsh73_cannot_log_in wrote: | gosh, I have a problem logging - so no poll for me. |
Please try clicking the link that reads "I forgot my password." If that doesn't work, please post to the General Discussions forum. _________________ Brent |
|
Back to top |
|
|
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: May 21st, 2012, 9:27pm Post subject: Re: Block comments |
|
|
tsh73_cannot_log_in wrote: | >>Many BASIC proponents say they prefer the language because it rarely forces them to press the Shift key.
Never ever heard of that. Really, sounds like utter noncence for me. |
Well, I think that person was refering to Visual Basic, which discourages the use of the old sigils ($, %, &, etc). _________________ Brent |
|
Back to top |
|
|
|