[This post is part of a series, "wish-list for future versions of VB"]

IDEA: Allow comments within multi-line statements, and in blocks, and within expressions.

    Sub g(ByVal f As String,  ' filename

          ByVal y As String   ' access mode

         )

        Console.WriteLine("{0}-{1}",f,y)

    End Sub

 

 

    Dim h = Sub()  ' a small subroutine

            End Sub

 

    Dim l = From g In gs   ' out of all the gin joints in all the world

            Select g.sam   ' you had to pick this one

       

    Dim k = {"hello",   ' the first element of the array

             "world"    ' the second

            }

 

    (* This is a multi-line

       comment block

    *)

 

   

    Sub f(ByVal f As String (* filename *), ByVal y As String (* access mode *))

    End Sub

 

    Dim x = <xml>

                <a></a>  ' comment impossible here because we’re in XML-land

            </xml>

 

SCENARIO: Now that we’ve removed the need for line-continuation characters, and introduced more multi-line constructs (lambdas, array literals, LINQ queries), we have a stronger need for comments within these statements and expressions.

 

Provisional evaluation from VB team: This is a decent idea. However, the current compiler architecture dates back from the days that VB was strictly line-oriented language so we’d have to refactor the compiler first (see “Req0: Don’t add to (or change) the language”).