Anthony D. Green [MSFT]

My feedback

  1. 1,639 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      14 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
      Anthony D. Green [MSFT] commented  · 

      Actually, UserVoice is still an appropriate place to file language suggestions. The GitHub project is also a place where language ideas and more formal proposals are written up but the voting mechanism of UserVoice is quite valuable. We try to use the two sites in tandem.

    • 757 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        24 comments  ·  Visual Studio IDE » Extensibility  ·  Flag idea as inappropriate…  ·  Admin →

        Thanks for raising and voting for this suggestion.

        At this point, we’d like to dive further into the specific needs your scenarios will have from the API. If you can spend a few minutes to answer the questions on this survey, we’d greatly appreciate it! Your answers will help us plan and prioritize the work required.

        https://www.surveymonkey.com/r/F5XRQJ7

        Regards,
        Mark Wilson-Thomas
        Program Manager, Visual Studio IDE

        Anthony D. Green [MSFT] commented  · 

        Extend how? We were discussing something like this in a Roslyn diagnostics meeting and I'm curious what scenarios you're envisioning.

        -ADG

      • 3 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          4 comments  ·  Visual Studio IDE » Languages - Visual Basic  ·  Flag idea as inappropriate…  ·  Admin →

          Hey gjuro,

          We’ve considered inline/multiline comments in VB several times. In the past it’s been a very expensive thing to implement because of the way the language parser was designed and the way the IDE integrates with it. The VB and C# code bases are, for historical reasons, very different. Anyway, in Roslyn such a thing isn’t as difficult anymore but we still question the value. In fact “is it worth it” is the real obstacle at this point.

          We don’t actually see much use of inline/multiline comments even in C# which makes us even more hesitant to add them to VB.

          Now, what we have been able to make work in Roslyn is this:

          Dim q = From x In y ’ This is a from clause
          Where x < z ’ And this is the where
          Select x ’ This select is redundant

          That is, comments after implicit…

          Anthony D. Green [MSFT] commented  · 

          Hey everyone,

          If you hadn't heard already last week at BUILD we announced the PUBLIC release of a Preview of the next version of the Visual Basic language and code editing experience powered by "Roslyn". You can download this preview and install it on top of Visual Studio 2013 today!

          While the preview doesn't include support for multiline comments it does have limited support for comments in the middle of a line after an implicit line continuation:

          Dim value = MyFunction(a, ' This is the first parameter
          b, ' This is the second parameter
          c, ' You get the point
          )

          We'd like to extend this to work after explicit line continuations as well.

          You can read about it more here: http://www.codeplex.com/Download?ProjectName=roslyn&DownloadId=824695

          Download the End User Preview @ http://msdn.microsoft.com/en-US/vstudio/roslyn

          I encourage you all to download it, try it out, and send us your feedback.

          Regards,

          Anthony D. Green, Program Manager, Visual Basic & C# Languages Team

        • 327 votes
          Vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)
            You have left! (?) (thinking…)
            under review  ·  28 comments  ·  Visual Studio IDE » Languages - Visual Basic  ·  Flag idea as inappropriate…  ·  Admin →
            Anthony D. Green [MSFT] commented  · 

            Hi again, PavlinII,

            Thanks for all that feedback!

            Here's the reason we're considering Output at the callsite - it would allow us to infer a variable declaration inline. Today because you need to declare the variable before hand you also need to specify its type explicitly and can't use type-inference. A lot of users, myself included, love type inference and this limitation creates an inconsistent experience. With an explicit Output keyword at the call site instead of typing this:

            Dim result As Integer ' No type inference here.
            If Integer.TryParse(stringVariable, result) Then ...

            You could type:

            If Integer.TryParse(stringVariable, Output result) Then ' With type of variable inferred.
            or
            If Integer.TryParse(stringVariable, Output result As Integer) Then ' With type of variable explicit.

            Technically we could still do this without the Output keyword but it's a little harder to predict and see.

            But, even if we did add this feature we'd need to still support doing it the way you do today for back-compat reasons.

            Regards,

            -ADG

            Anthony D. Green [MSFT] commented  · 

            Hi PavlinII,

            Thanks for the suggestion. We thought pretty long and hard about this suggestion and can totally see the pros - particularly in scenarios where being concise is at a premium (like in lambdas), or where duplicate types are very common - user-defined binary operators. There is definitely precedent in the language for what this means. It also raises some interesting questions:

            1) Modifiers/Attributes:
            a) They distribute over the chain:

            ' x and y are integers, both are ByRef.
            Sub M(ByRef x, y As Integer)

            b) They don't distribute:

            ' x and y are integers, only x is ByRef.
            Sub M(ByRef x, y As Integer)

            c) They break the chain:

            ' This is illegal. x has a modifier and must also declare a type explicitly to avoid ambiguity.
            Sub M(ByRef x, y As Integer)

            The existing rules today around modifiers/attributes on fields would suggest we'd go with (a) for this.

            2) Intersection with possible (though not necessarily planned) future features:
            a) What if we let you declare Optional parameters out of order?

            ' These are all optional.
            Sub M(Optional prefix, root, suffix As String)

            But let's say you wanted only the first and last to be optional (yes, this scenario has come up) you could declare it like this:

            Sub M(Optional prefix As String, root As String, Optional suffix As String)

            Which might be fine and is probably clearer. But VB also supports a rapid-prototyping typeless style and you couldn't write this:

            Sub M(Optional prefix, root, Optional suffix)

            In fact in this mode you wouldn't be able to use any modifier without impacting any subsequent parameters in typeless mode. OK, so maybe we decide it either doesn't work in typeless mode or you're just forced to explicitly type out a type in this case.

            b) Let's say we added Output parameters to VB. C# already supports them and they're a pretty common pattern in .NET for multiple return values and the TryXyz pattern (e.g. TryParse, Dictionary.TryGetValue)

            Function Execute(path As String,
            stdIn As Stream,
            Output stdOut, stdErr As Stream
            ) As Integer

            This has the same problem as with Optionals - it's already possible today in C# to declare output parameters in any order. But like before we can require explicit typing in that edge case. Now let's look at the caller side:

            exitCode = Execute("cmd.exe", stdIn, Output stdOut, stdErr)

            Again the question of whether to distribute or not is a problem. If we don't support it you need to repeat the modifier:

            exitCode = Execute("cmd.exe", stdIn, Output stdOut, Output stdErr)

            It's odd that the use site doesn't follow the same rules as declaration, but maybe we can live with it.

            If we don't support it then the original code works but now it's impossible for an Output parameter to precede any non-Output parameters:

            M(Output x, y, Output z)

            Maybe we work around this too by letting you force ByVal and ByRef on the middle argument where it's ambiguous?

            M(Output x, ByVal y, Output z)

            This is probably rare enough that this escape hatch is good, especially for output parameters. The case may not be so cut and dry for ByRef arguments. Now arguably when the argument passing mode changes mid argument list it's probably good to be more explicit but it does mean any translation from C# code would have to potentially know that but we could flag it with a warning or something.

            Now, I'm not saying we're going to do any of these language features but it is important when deciding on any one how it might intersect with a future whole.

            What do you guys think? Do any of these possible worlds sound confusing or make you think the feature is less desirable?

            -Anthony D. Green, Program Manager, Visual Basic & C# Languages Team

          • 220 votes
            Vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)
              You have left! (?) (thinking…)
              3 comments  ·  Visual Studio IDE » Project  ·  Flag idea as inappropriate…  ·  Admin →
              Anthony D. Green [MSFT] supported this idea  · 

            Feedback and Knowledge Base