Jump to content











Photo
- - - - -

Commenting Style


  • Please log in to reply
15 replies to this topic

Poll: Commenting Style (27 member(s) have cast votes)

What commenting style do you want?

  1. // (10 votes [37.04%])

    Percentage of vote: 37.04%

  2. ' (1 votes [3.70%])

    Percentage of vote: 3.70%

  3. ; (7 votes [25.93%])

    Percentage of vote: 25.93%

  4. {} (0 votes [0.00%])

    Percentage of vote: 0.00%

  5. (* *) (0 votes [0.00%])

    Percentage of vote: 0.00%

  6. /* */ (1 votes [3.70%])

    Percentage of vote: 3.70%

  7. rem (1 votes [3.70%])

    Percentage of vote: 3.70%

  8. # (7 votes [25.93%])

    Percentage of vote: 25.93%

Vote Guests cannot vote

#1 smiley

smiley

    Silver Member


  • .script developer
  • 905 posts
  •  
    Greece

Posted 26 November 2006 - 09:23 AM

It's time to establish a common comenting style for the scripts before there is an anarchy with many scripts with different syntaxes. Please choose what you think is better :P

#2 yahoouk

yahoouk

    Silver Member


  • .script developer
  • 518 posts

Posted 26 November 2006 - 01:05 PM

............... what you think is better :P


I prefer SemiColum commenting sytle because many programs are related with INF files and same comments in them. :P

#3 edborg

edborg

    Frequent Member


  • .script developer
  • 387 posts
  •  
    Italy

Posted 27 November 2006 - 08:39 AM

On the other hand, // results more visible when debugging scripts, though ; is more generally accepted outside WB.
I also use rem, which is evidenced in WB, when I want to add comments.
Now every character is accepted. Everyone can use other people's scripts without problems.
Why not continue like that?
I don't see consistency issues with this. :P

edborg

#4 was_jaclaz

was_jaclaz

    Finder


  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 27 November 2006 - 12:13 PM

Just for the sake of it, a character that I find VERY visible is #, though cannot say if it can be used.

jaclaz

#5 TheHive

TheHive

    Platinum Member


  • .script developer
  • 4138 posts

Posted 27 November 2006 - 12:23 PM

;

#6 smiley

smiley

    Silver Member


  • .script developer
  • 905 posts
  •  
    Greece

Posted 27 November 2006 - 12:50 PM

I have added rem and # in the list :P

#7 was_jaclaz

was_jaclaz

    Finder


  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 27 November 2006 - 08:32 PM

I have added rem and # in the list

GOOD! :P

But you should also "reset" the voting, and ask members to vote again, I already have a number of #'s that came to me protesting they have been discriminated.... :P

jaclaz

#8 smiley

smiley

    Silver Member


  • .script developer
  • 905 posts
  •  
    Greece

Posted 27 November 2006 - 08:40 PM

GOOD! :P

But you should also "reset" the voting, and ask members to vote again, I already have a number of #'s that came to me protesting they have been discriminated.... :P

jaclaz


Should I reset it now?

#9 Alexei

Alexei

    Silver Member


  • .script developer
  • 664 posts

Posted 28 November 2006 - 11:54 PM

Should I reset it now?

I would prefer to have some flexibility with comments :P
For ex. Delphi allows:
// - starts comment (auto terminated at end of line)
(*...*) - anywhere in the text
{...} - anywhere in the text
I voted for #, as it allowes beautifications like that:
######################

#  Text			  #

######################


#10 curare

curare

    Member


  • .script developer
  • 96 posts
  •  
    Philippines

Posted 13 December 2006 - 09:00 AM

;

#11 curare

curare

    Member


  • .script developer
  • 96 posts
  •  
    Philippines

Posted 14 December 2006 - 01:52 AM

;

where you can do this...

;######################

;#  Text			  #

;######################

:P

#12 Ove

Ove

    .script developer


  • .script developer
  • 192 posts
  • Location:Fagaras, Romania
  •  
    Romania

Posted 15 April 2007 - 03:48 PM

I like C style comments:
// a single line comment

/* a block comment*/

The block comment can be arranged like this for added effect:
/***********************************\
| COMMENTS... |
| This is a VALID C/C++ |
| comment |
\***********************************/

(the | in the comment box should be alligned with the top and bottom right corners)

#13 Moon Goon

Moon Goon

    Frequent Member


  • Advanced user
  • 270 posts

Posted 15 April 2007 - 07:55 PM

The language I am currently using uses the "//" so that's easiest for me. The ";" is used in some languages to signify the current instruction line has stopped thus would be confusing.

#14 Alexei

Alexei

    Silver Member


  • .script developer
  • 664 posts

Posted 04 June 2007 - 04:04 PM

There are 3 types of comments:
1. to indicate comment line
2. to indicate the rest of the line is a comment
3. to insert comment anywhere in the program text

"//" and ";" are OK for 1 and 2
# is OK only for 1

For consistensy reasons I would prefer Ove's proposal:
"//" (for 1,2) and "/*...*/" (for 3)

In addition, ";" better be reserved for future extensions of WB scripting language.

:confused1:
Alexei

#15 Galapo

Galapo

    Platinum Member


  • .script developer
  • 3841 posts
  •  
    Australia

Posted 10 August 2007 - 09:53 PM

How about "//* ... *//" for number 3? That would keep some kind of consistency between commenting, namely, the use of "//".

#16 Alexei

Alexei

    Silver Member


  • .script developer
  • 664 posts

Posted 11 September 2007 - 05:52 AM

How about "//* ... *//" for number 3? That would keep some kind of consistency between commenting, namely, the use of "//".

"//*" would also create a conflict, because "//" means: "the rest of the line is a comment regardless of its contents".
It's also important, that "//* ... *//" is two characters longer then "/* ... */". Save you fingers! :loleverybody:
:w00t:
Alexei




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users