Double slash as a comment prefix in VB

C

Cor Ligthert

Tim,

Do you not have a better sugestion than that \\ in C type languages?

Cor
 
H

Herfried K. Wagner [MVP]

* "Tim Anderson said:
Does anyone else think VB should support the // prefix for comments? I keep
using it by accident, because so many other languages use it (unlike the
single quote, which is I believe unique to VB).

If you think VB would be improved by this change, please vote on my
suggestion here:
http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackId=FDBK15038

I voted against this suggestion. In VB.NET, there are already two ways
of starting comments, ''' and 'Rem', and in VB 2005, ''''' for XML
comments. I am strongly against a change of this scheme. Comment
blocks would be nice, but I currently do not have an idea about how to
add them to the language without producing ASCII art ('/*...*/' is
horrible).

What I can think of is an automatical replacement of '//', that turns
'//' into '''. This would keep the language syntax clean and would help
C* programmers to switch to VB.NET.

It's interesting that, as a VB programmer, I never had any problems with
C* languages. There is nothing simpler than remembering the comment
character.

'//' does not fit into the scheme used to choose keywords in VB. It's
ASCII art.
 
H

Herfried K. Wagner [MVP]

* "Tim Anderson said:
// you mean.

But no, I like the double slash.

Out of the same reason a VB programmer could demand ''' as character
starting sequence in C. Unification is only useful as long it doesn't
destroy schemes introduced with a certain programming language. '//'
would not comply with the "spirit of Visual Basic".
 
T

Tim Anderson

What I can think of is an automatical replacement of '//', that turns
'//' into '''. This would keep the language syntax clean and would help
C* programmers to switch to VB.NET.

Could be useful.
'//' does not fit into the scheme used to choose keywords in VB. It's
ASCII art.

You will have to work hard to persuade me that ' is any more intuitive. REM
is true BASIC style I agree, but who wants to type four characters where one
or two will do?

Tim
 
H

Herfried K. Wagner [MVP]

Tim,

* "Tim Anderson said:
Could be useful.


You will have to work hard to persuade me that ' is any more intuitive. REM
is true BASIC style I agree, but who wants to type four characters where one
or two will do?

Why two characters if one character is enough? IMHO, '//' distorts the
visual appearance of code. ''' makes it look more untroubled. So, why
do you want to type two characters when already one will do?

(I am member of the movement that wants '>>' to be replaced with 'Shr'
and '<<' to be replaced with 'Shl'.)

SCNR
 
T

Tim Anderson

Why two characters if one character is enough? IMHO, '//' distorts the
visual appearance of code. ''' makes it look more untroubled. So, why
do you want to type two characters when already one will do?

Because I want comment lines to look different from code lines. The ' is
almost invisible.

Typing the same character twice is very quick, similar to double-click with
the mouse :)

Tim
 
G

Guest

I suppose you know that you can set you comment lines to different colors,
but unfortunately, I don't believe they will print in color nor copy to a
document in color. It would be nice to have comment blocks though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top