is possible to change VB.NET's ' to C++'s //?
I want to change it because // is cool
Printable View
is possible to change VB.NET's ' to C++'s //?
I want to change it because // is cool
No, it's not.
only if you use C# ... but then it's not VB...
why? WHY THE VB IS SO RETARDED?
Yes...but to do so you would have to secure employment with Microsoft and get placed on their VB.NET development team.
Next, you would need to submit a change request that ran through your boss up throught the Microsoft VB.NET Team Lead, who would have to get sign offs from a variety of company officials above him/her.
Naturally, legacy support for the apostrope would have to be retained even if your request to include the double backslashs in the next, and all future releases of VB.NET, were to be accepted.
On the contrary...it is very advanced with the C++ being behind the times.
To type a comment in VB all you need to do is type one character then your comments. The other thing requires the typing of two characters and then your comments. Why do you want to double your own work? :confused:
// looks cool
VB's ' has twice the power of C's / ... that's why it takes two / to equal one '
-tg
The change I would like to see is the ability to have the C style /*....*/ comments. While VB allows you to easily comment/uncomment a block, it still isn't all that convenient for typing lengthy comments, such as at the beginning of methods.
Other than that, if your choice of language is due to style of the single line comment identifier, you are paying more attention to the chaff than the wheat. Do you also see all the other operators in C-style languages as being 'more cool' than the words used in VB? I thought that using &, ^, !, and | operators made for some pretty tight looking code...then I tried using them in practice. What a pain. Any good typist will do better in VB than in C-style languages, and this is true for the comment designator as well as all the other operators.
Shaggy - did you know that if you type ''' just above the method, you get a comment block? And if you start typing in the Comment/Summary section, and press enter, it will add the leading ''' to the next line:
-tgCode:Public Class Form1
''' <summary>
''' if you start typing here, and simply press return
''' it will auto comment the new line for you.
''' handy for comment blocks in VB...
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
No, I certainly didn't. That is almost what I want, and I can certainly see the value of that, since it can be used for structured commenting. I guess that was one of the items that was added more or less recently (since 2003), which I have not yet made use of.
Not sure if it was in 2005 or not, but it was there by 2008 (where I copied that from). It's even smart enough to pick up the parameters too and prefill what it can.
It's designed to go with Sandcastle for producing automated MSDN-style documentation for your app.
-tg
dbasnett - beats me... it just does it... if you look at the code I posted above, all I did was tap that ' key three times.... and it takes the parameters from the method, and creates the parameter nodes exactly as you see it. Other than ''', the only text I entered was the three lines in the summary node.
Now... what it DOESN'T do is pick up new parameters if you add something... it only pre-fills the parameters that are there when the comment block is first created. After that, it's up to you for maintenance.
-tg
Also, if you Right Click the method, you can select 'add comment' (mouse drivers and keyboard drivers are both accommodated...)
If you add a parameter, you can add the parameter to the comment for that parameter quite easily; typing '<' will bring up a drop-down menu with any missing, uncommented, parameters.
All these comments are available in the XML documentation file generated at compilation (unless the XML documentation selection is unchecked).
Now I see
Code:''' <summary>
'''
''' </summary>
''' <param name="bar"></param>
''' <param name="xyz"></param>
''' <param name="loob"></param>
''' <remarks></remarks>
Private Sub foo(ByVal bar As Integer, ByVal xyz As String, ByVal loob As Boolean)
End Sub
Now that I didn't know. Typically, when I can, I stick to keyboard shortcuts. Still, good to know.Quote:
if you Right Click the method, you can select 'add comment'
-tg
dbasnett - now remove one of the parameters from your procedure signature... you should then get a schema error in the comments block for the removed parameter. Unfortunately it doesn't do the same for added parameters.
-tg
WOW! What it does with IntelliSense is priceless!
here are some links for those not having themCode:Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
If foo( 'fix me <<<<<<<<<<<<<<<<<<<<<<
End Sub
''' <summary>
''' The is cool!
''' </summary>
''' <param name="bar">bar is cool</param>
''' <param name="xyz">xyz starts with x</param>
''' <param name="loob">is bool backwards</param>
''' <returns>returns a double</returns>
''' <remarks>who need remarks</remarks>
''' <exception cref="DivideByZeroException">
''' When you divided by zero, DUH!
''' </exception>
Private Function foo(ByVal bar As Integer, ByVal xyz As String, ByVal loob As Boolean) As Double
Try
Catch ex As DivideByZeroException
End Try
Return New Double
End Function
http://msdn.microsoft.com/en-us/magazine/dd722812.aspx
http://msdn.microsoft.com/en-us/libr...%28v=VS.100%29
I used to be driven crazy because with VB you couldn't multiline comment. But then I figured out that if highlight the section you want commented then do CTRL-K, then CTLR-C will do the trick. To Uncomment do CTRL-K, CTRL-U. There's a cheat sheet for all the commands at
http://www.microsoft.com/downloads/e...c-84036160639f
I've also found out that bookmarks are nice too.
There are also buttons on the toolbar that will do all that commenting with single button clicks if you can't remember the ctrl keys.
If you like the above, then you might want to take a look at GhostDoc:
http://submain.com/products/ghostdoc.aspx
Also, if you throw StyleCop into the mix:
http://code.msdn.microsoft.com/sourceanalysis
It will tell you when you have parameters that don't have matching XML comments, and vice versa.
Gary