i know in java and other nice languages it's possible to comment out a bunch of lines at the same time. is it possible to do this in vb.net?
Stumbled on this wondering if something new had been added to Visual Basic I wasn't aware of to address this.
The answer remains the same, at this point.
To keep with best practices (of which the definition can be argued) you really only have two options that directly act as a comment, both of which have been mentioned.
You can use the apostrophe/single quotation at the beginning of each line to create a comment
You can use the REM
keyword ("remark") to also create a comment. Just like the first method, each line would also need to begin with the REM
keyword.
' This is a comment. You must begin each line with a carat.
REM this is also considered a "comment"
ALSO
If you have a large amount of commented code that perhaps you want to collapse, you can make use of the #Region and #End Region directives to make everything inbetween those directives collapsible in the IDE. The #Region directive must have a string literal identifier. See example below
#Region "This string shows up when collapsed"
' Some code and/or comments
' Everything in the middle here is collapsed if you collapse the region.
#End Region