Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Cory Smith
    @DualBrain
    In this episode of *VB Supported"... check out https://gist.cafe/#project/vb
    Cory Smith
    @DualBrain

    WinForms and WPF devs, help us decide if we should build a new feature for .NET desktop platforms and what should be our priorities in the future. Schedule a call with me via https://aka.ms/dotnetdesktopcall. Your feedback is super valuable! Folded hands

    This was posted on Twitter... just had my call (I was apparently the very first to sign up) with them and I encourage others to do the same.

    Paul M Cohen
    @paul1956
    Not on twitter but if you covered dark mode and high DPMI, I am good. About to board a ship for a few weeks so a call is probably not going to happen.
    Cory Smith
    @DualBrain
    I did, but I think it would be a good idea to get multiple people to provide the one-on-one feedback; I'm one lone voice... the more of us that voice this the better. With that out of the way, I did share the CSharpToVB project as an example of "how hard it is to try to 'hack' together dark mode in WinForms" so they could see it in person.
    Cristian FRC
    @cristianlt23
    @DualBrain thanks for answering the question I asked regarding the F# community, according to your answer they have done a great job
    Cristian FRC
    @cristianlt23
    I would like to know why this .Net Blog post was removed from the date string.
    https://devblogs.microsoft.com/dotnet/whats-new-for-visual-basic-in-visual-studio-2022/
    Cristian FRC
    @cristianlt23
    all posts from November 8, 2021 are still there, except the VB article
    Cristian FRC
    @cristianlt23
    I did a little research with students from the software engineering course at the university in my city.
    I asked:
    1) what prevents you from using VB.NET?
    the main answer was:
    1) Lack of clear and objective documentation with examples and scenarios where VB can act (work)
    2) found the VB documentation on the MS website insufficient for web development
    Could we as a community do something in any way?
    Cory Smith
    @DualBrain

    I would like to know why this .Net Blog post was removed from the date string.

    I guess I'm confused as I see the article; is there something I'm missing?

    Could we as a community do something in any way?

    There's not an easy answer to this; with that said I'm working on writing a blog post regarding a particular angle related to this subject... when I get it finished I'll update here with a link. I have a very rough first draft and want to spend some time expanding on it as I want to back up what I'm saying with additional facts that can be referenced.

    Cristian FRC
    @cristianlt23

    @DualBrain

    I guess I'm confused as I see the article; is there something I'm missing?

    if you go to: https://devblogs.microsoft.com/dotnet/
    and start browsing the blog, you'll notice there's no news about VB unless you use the magnifying glass to search and type "VB"

    However, this news
    https://devblogs.microsoft.com/dotnet/whats-new-for-visual-basic-in-visual-studio-2022/

    was visible on the blog and now doesn't come with all the other news anymore.

    I joined the blog on November 8, 2021 and saw the news about Kathleen's VB, now if you don't look in the magnifying glass you won't find it on the blog.

    I found it strange that this happened

    Cristian FRC
    @cristianlt23
    Today I answered the Jetbrains survey and it is clear that VB.NET was the most used language in my daily life
    https://surveys.jetbrains.com/s3/Ssrvey-panel-validation
    Cory Smith
    @DualBrain

    Looks like there might be something taking place regarding language change...

    The feature is called CallerArgumentExpression with the C# spec found at https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/caller-argument-expression

    The VB specific activity can be found at dotnet/roslyn#54132

    There's also a conversation taking place regarding setting the default language version to be the same as the latest; or at the very least setting the "default" language version in VS2022 to be 16.9. I very much agree on both accounts... dotnet/roslyn#57093
    Cory Smith
    @DualBrain

    The TLDR of this is that Visual Studio 2022 v17.1 should see VB "16.9" being the default language version (it is currently "16.0").

    For anyone interested about the process of getting changes done around "language changes" that will impact developers; take a moment to review:

    dotnet/roslyn#57688

    Keep in mind that this a conversation among members of the Roslyn team about a change requested (initiated) by a manager. Don't get me wrong, I'm happy to see this type of thing taking place... just because some people think that it is a "small change" that most likely won't affect anyone, the policies are in place to help ensure/guarantee that things are looked at. When outsiders encounter this level of "push-back", there are complaints that the team is resisting change... but I don't see this as being the case. If you want to contribute something, you have to do so following the same level required by the team members. I just find the chain of events and conversation in this pull request enlightening and take some solace in the idea that we really do have people on the team doing their best to ensure we continue to have a high quality product that requires a consistent high-bar with regard to changes being made.

    Cory Smith
    @DualBrain
    What if it were possible to do the following in VB?
    10 PRINT "HELLO WORLD!"

    Right now, to do the same thing:

    Imports System
    
    Module Program
      Sub Main(args As String())
         Console.WriteLine("HELLO WORLD!")
      End Sub
    End Module

    or more accurately...

    Imports System
    
    Module Program
      Sub Main(args As String())
    10:
         Console.WriteLine("HELLO WORLD!")
      End Sub
    End Module
    With the concept of Top-Level Code, the theory would be that it would look something like:
    Imports System
    
    10:
      Console.WriteLine("HELLO WORLD!")
    Cory Smith
    @DualBrain

    The reason why I include line numbers in the first example is to think about the following example:

    10 PRINT "HELLO WORLD!"
    20 X = X + 1
    30 IF X > 10 THEN GOTO 50
    40 GOTO 10
    50 END

    which would (theoretically, if Top-Level Code existed in VB) to:

    Imports System
    
    Dim x As Integer
    
    10:
      Console.WriteLine("HELLO WORLD!")
      x=x+1
      If x > 10 Then GoTo 50
      GoTo 10
    
    50:
      End

    or, depending on if you had certain Project options set appropriately...

    10:
      Console.WriteLine("HELLO WORLD!")
      x=x+1
      If x > 10 Then GoTo 50
      GoTo 10
    
    50:
      End

    For a really insane option, what about the following?

    ? "HELLO WORLD!"

    What if, indeed...

    Cory Smith
    @DualBrain

    AND... what if... and I do ask this in all seriousness... this were possible WITHOUT changing the VB compiler? It might just indeed be possible to support this with the tools that currently exist where (once available) all you would have to do is simply add a nuget reference.

    Which then leads me to ask what would PRINT (or ?) do for different project types? In a Console application it would output text to the, well, Console. In a WinForms application, would it be equivalent to a Debug.Print or for "logging"? In an ASP.NET type application, would it be for sending content to the browser (HTML)?

    DISCLAIMER: This may be something that requires a team of people to participate in (ultimately) to accomplish.

    Paul M Cohen
    @paul1956
    It would be fantastic count me in
    Cory Smith
    @DualBrain

    I'm in the process of learning more about Roslyn (navigating through syntax trees) and in the process of exploring how I want to handle certain things I discovered that ? is something that is specifically looked for. Just for giggles, tried the following code in a method:

      ? "HELLO WORLD!"

    And the error one receives will be similar to "Expression statement is only allowed at the end of an interactive submission."

    This statement, though, is completely recognized and parses correctly since it is legal in the interactive side of things and, at least to me, it's interesting to see entry.Kind = SyntaxKind.PrintStatement.

    This will make it a little more difficult (in some ways) to do what I'm wanting to do... however, it also makes it easy to detect (since it already can do so).

    Point being that ? is does (technically) exist in VB (Roslyn) but is only used (assumption) in limited scope (interactive")... (NOTE: It might not actually be used outside of the error checking, I'm making an assumption that the very limited interactive stuff in VS is using this; it might not be as it could still be using the old way* since we don't have VB scripting available to us.) I may explore this more in the future; but if anyone else knows any more details, please share.

    Paul M Cohen
    @paul1956
    After a long wait my fix to handling formatting _ ‘ is in the current release of Visual Studio 2022. I want the thank @CyrusNajmabadi and @SamHarwell for making it happen. This continues to give me hope to be able at add additional feature to VB by community in the future.
    Cory Smith
    @DualBrain

    After a long wait my fix to handling formatting _ ‘ is in the current release of Visual Studio 2022. I want the thank @CyrusNajmabadi and @SamHarwell for making it happen. This continues to give me hope to be able at add additional feature to VB by community in the future.

    AWESOME!

    Paul M Cohen
    @paul1956
    It was announced today but is actually in next update/preview.
    Cristian FRC
    @cristianlt23
    Congratulations @paul1956
    Cory Smith
    @DualBrain

    This continues to give me hope to be able at add additional feature to VB by community in the future.

    My view is that the answer has (all along) not been a (hard) "No!"... but rather the bar is pretty high in order to get a "Yes!". Also, "no plan" doesn't mean "nothing is going to happen"; or, more specifically, plans can and do change over the course of time. Changes are indeed taking place both within Roslyn as well as in .NET / Visual Studio / WinForms / etc. that DIRECTLY impact VB.

    Cory Smith
    @DualBrain

    to answer your question about VB, I'm working on trying to make things more async, and to work on perf not causing blocking issues in it in the typing experience -- @CyrusNajmabadi

    Can you take a moment to update about the work you were referring to when you posted this a while back?

    Mohammad Hamdy Ghanem
    @VBAndCs
    I see no value of using ? for printing, even if it possible. In C#, we use cw+tab shortcut for Console.writeline snippent, which doesn't exist in VB, and there is an issue about that dotnet/roslyn#37049
    However, we can add this snippet to vs. Add this to a file and name it writeline.snippet:
    <?xml version="1.0" encoding="utf-8"?>
    <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
        <CodeSnippet Format="1.0.0">
            <Header>
                <Title>Console.WriteLine</Title>
                <Author>M. Hmdy Ghanem</Author>
        <Shortcut>cw</Shortcut>
            </Header>
            <Snippet>
                <Code Language="VB">
                    <![CDATA[Console.WriteLine($msg$)]]>
                </Code>
      <Declarations>
        <Object>
          <ID>msg</ID>
          <Type>System.String</Type>
          <ToolTip>The message you want to write.</ToolTip>
          <Default>"Hello"</Default>
        </Object>
      </Declarations>
            </Snippet>
        </CodeSnippet>
    </CodeSnippets>
    Now, write cw and press tab, to get:
    Console.WriteLine("Hello")
    The "Hello" text will be highlighted so you can replace it.
    Mohammad Hamdy Ghanem
    @VBAndCs
    It will be helpful to have this snippet added to VS to be available for all vb users. I will add a comment to that issue and vote for it.
    Note: I tried to use ? as a shortcut for the snippet, but didn't work as it is used to show the snippet context menu. It would be nice ;)
    Mohammad Hamdy Ghanem
    @VBAndCs
    One more anointing thing: After writing cw, you need to press Esc to dismiss the auto completion list before pressing Tab, otherwise the editor will convert cw to ChrW!
    one solution to avoid this, is to change the snippet shortcut to cwl.
    or any other shortcut that has no corresponding auto-completion word. I go for cw to be the same as C#.
    Mohammad Hamdy Ghanem
    @VBAndCs
    Of course it would be better if intellisense take snippets shortcuts into account.
    CyrusNajmabadi
    @CyrusNajmabadi
    please file issues and/or fixes.
    currently snippets are in maintenance mode only
    so this would be backlogged unless you can contribute the fixes.
    we've mentioned this before, but backlog items are already lower pri than what the team can currently afford to look at.
    Mohammad Hamdy Ghanem
    @VBAndCs
    I am putting these notes if the filed isue dotnet/roslyn#37049
    Adam Speight
    @AdamSpeight2008

    @CyrusNajmabadi
    Does the visual basic specification and compiler, assert atomicity within "multi-part" block structures.
    For example the ElseIf in an If Then ... End If block.

    We have the following code (as is).

    ' statements 0
    If someCondition = True Then
       ' statements 1
    ElseIf someCondition = False Then
       ' statements 2
    Else
       ' statements 3
    End If
    ' statements 4

    is transformed into

    ' statements 0
    If someCondition = True Then
       ' statements 1
    Else
      ' *** What prevents evaluate of someCondition being different from prior evaluation.
       If someCondition = False Then
          ' statements 2
       Else
          ' statements 3
       End If
    End If
    ' statements 4

    Is someCondition asserted to be atomic ( non-changing ) between each usage?
    As from my knowledge the lowered form does not seem to have that "ambient property", or does the transformation production obtain that "ambient property" from the transformation of an ElseIf statement.
    If it doesn't would a copy of the value of "someConditon" into "tmp" prior to the If Block, and rename the usage of "someCondition" with on this block to "tmp". Gain that guarentee.

    I think this is something to do with Side-Effects and/or Contract propagation.

    CyrusNajmabadi
    @CyrusNajmabadi
    1. it entirely depends on what 'someCondition' is (like a field/prop/parameter/local).
    if it's a field/prop, definitely not. indeed, it's the opposite. each time it will be read from teh original source
    if it's a parmaeter/local. sure. however, it will depend on what is in the rest of hte method