Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Aaron Glover
    @aarondglover
    I think getting new templates into visual studio out of the box is the biggest thing in making VB devs understand these project types and azure platforms services are available to them
    The biggest killer for VB though was made years ago when it was excluded from .NET Core MVC/RAZOR etc
    I watched VB.net support languish on the asp.net core roadmap for years only for it to be unceremoniously dumped and told that most VB devs dont write web apps!!! 😩
    rskar-git
    @rskar-git
    @VBAndCs Thumbs-up for Vazor and getting on VS Magazine!
    rskar-git
    @rskar-git
    @DualBrain Re: #VisualBasic, I think there's just one thing left for us to do: “Don’t just stand there, do something!” Like @tverweij and @VBAndCs. If this "Walter Mitty" type (i.e. me) may suggest, we need to rally around a specific Github fork that makes real all that we desire of VB on .NET (and Azure and MVC and Internet-Of-Things, etc.). But for that to work, then there needs to be a few somebodies who can, and will, regularly spare maybe 20 hrs per week for several years. If it's going to be volunteers, then the odds for success are linked to their having real needs to address; this would provide natural motivation for timeliness of enhancements and bug fixes. Once they reach a point of having something stable, useful, and interesting, can they then easily attract other volunteers who can help out with documentation, wikis, and otherwise provide feedback, alpha testing, and beta testing.
    Mohammad Hamdy Ghanem
    @VBAndCs
    @rskar-git Thanks.
    I agree with your practical approach. And I add: we need to convince regular VB.NET developers to publish VB samples and small apps and libraries on GitHub. VB is nearly vanished from Stackoverflow and rarely exist on Github. MS is convinsed that All vb developers can use C# to ask, read sources, and write new apps, so what is the need for VB?
    Mohammad Hamdy Ghanem
    @VBAndCs
    VB developers seem to be either lazy or selfish. Or all they need is already there in C# so, there is nothing to add! This ended up killing VB
    Mohammad Hamdy Ghanem
    @VBAndCs
    I am trying now to write Blazor app in VB.NET. I found out the Mono translates CIL to webasm, so VB.NET can run on broswer if we just created the assembly that mono expects. My big issue now is to use a virtual file provider with Blazor. Another issue that may appear, is that Blazor auto generates C# classes based on the .razor files. I added those in the VB project as a Vazor code behind class, but I am not sure this will until I provide the .razor file virtually to Blazor. If the trial succeeded and VB worked on the browser, we can start creating web controls like main and context menus in VB.NET to make writing asp.net apps much like wpf and silver light. If the trial failed, I will look at the Blazor source code to find a suitable point to plug VB in.
    Cory Smith
    @DualBrain

    If someone were to make a sample that could provide me the following:

    • a drawing surface, or possibly an "image" surface where I could create a image/bitmap in memory and update the display surface - using system.drawing.
    • a way to capture keyboard/mouse input

    In as pure of a VB model as possible... I'd be all over WASM.

    Some nice things to have would be to have events/api for:

    • startup
    • shutdown
    • surface resize
    • focus state

    From here it would be possible, in theory, to write a simple 2D game... from there... we could start implementing line-of-business type display components.

    Unfortunatly, I haven't been able to find a simple, straight forward sample that shows how to do any of this (even in C#) - and I haven't had time to dig into the specifics of WASM and/or Blazor. You'd think this would be something that would already exists... it's basically a "hello world" for a graphics based interface. If anyone does know how to create a sample (even in C#) of how to do the above... I would then be very interested in continuing forward with several ideas that I have (and a couple of projects that I think would be perfect to demonstrate this). I have one project right now that is literally a WinForms application with nothing but a PictureBox for the display -- where I draw to an image in memory and then update the "display" by updating the Image of the PictureBox... all UI is done through code - buttons, popups, text entry, menus, etc.

    Even if a sample was a raw as initializing a display and drawing (and able to redraw) a single pixel... I could then take the ball and run. ;-)

    (Note, it would also need to be able to have multiple assemblies. ;-) )
    Mohammad Hamdy Ghanem
    @VBAndCs
    this is the tool.. Dig around https://github.com/BlazorExtensions/Canvas
    Paul M Cohen
    @paul1956
    @DualBrain there are at least 2 VB - Core 3.1 demo's that do most of what you want under https://github.com/dotnet/samples (Conrad's Game of Life and Sudoku).
    Cory Smith
    @DualBrain
    But these are for WinForms, right? I'm looking for something similar that is VB targetting WASM as the execution engine.
    @paul1956 (With or without Blazor... for what I want to do, the Blazor components are of little-to-no-interest to me.) @VBAndCs Thanks for the link... I'll have to try to find some time to carve out to explore that more.
    Paul M Cohen
    @paul1956
    @DualBrain sorry misunderstood.
    Cory Smith
    @DualBrain
    @paul1956 No problem.
    Cory Smith
    @DualBrain
    Just found "Run C# natively in the browser through the web assembly via mono-wasm" (https://itnext.io/run-c-natively-in-the-browser-through-the-web-assembly-via-mono-wasm-60f3d55dd05a) article by Ali Bahraminezhad. It's interesting as it has NOTHING to do with Blazor and not the "AOT" (I'm guessing) method that Mono is also persuing. Instead, it spins up an assembly on a .NET runtime within WASM. I was able to get this sample working using #VisualBasic! (His sample can be found at https://github.com/0x414c49/mono-wasm-example) I also found a pretty good TypeScript oriented video on building a WASM compiler that does (what I think) I'm looking for regarding how to interact with the "canvas" (or similar) - watched the video and haven't had a chance to dig deeper into his repo (https://colineberhardt.github.io/chasm/) (Video: https://youtu.be/OsGnMm59wb4). He also has a weekly WASM newsletter that you can find at https://wasmweekly.news/. According to his video, he makes mention that WASM has ZERO I/O... you can only expose functionality across the host boundry. With that said, when he gets to discussing the drawing of the output he mentions "shared memory" and basically setting up a video buffer.
    Cory Smith
    @DualBrain
    I've also been thinking... I'm a BIG fan of .NET. With that said, I'm extremely concerned that the trajectory of .NET is at risk due C# zeolots and they don't seem to understand what it is that they are doing. From the inside (their side), they think that things are going GREAT... however, from outside (our side) things are starting to look at lot like Java. (Yes, I know, there are multiple languages that target the Java runtime... but that doesn't change the fact that Java is about Java...) To me, the beauty of .NET is a platform that KICKS ASS that "just works" across languages that are designed for the platform. This isn't a #VisualBasic thing... this is what our programming world should be. The problem as I see it is that people (including Microsoft) are creating frameworks, api stacks and execution platforms that are actively excluding other languages. Don't get me wrong, I don't give a rats rearend regarding what other languages can and can't do within the context of their language... but what they create with those (after it's compiled) with the intent of getting wide adoption (as a platform)... it should be done within the context of language neutrality. Additionally, I remember (I was there...) a time when .NET user groups were EVERYWHERE; however, one thing that I saw universally was language diversity was not being celebrated/excepted/welcomed. I remember having someone come in to talk about Boo and it blew me away the absolute closed mindedness of the audience to be open to even a remote possibility that another language might be something of interest in our collectively toolbelts. I don't know what we can do to fix this; but, as they say, identifying the problem is the first step to solving it. With that said, in my mind, it is my believe that .NET needs mutliple first class citizen languages to remain relevant... otherwise, what's the point. And as I recently saw on Twitter, more specific to #VisualBasic... as much as I love .NET... at the end of the day, if I'm honest, I'm on .NET because of #VisualBasic and the familiar environment that is WinForms. Don't get me wrong, I also really enjoy building Console apps and what library (assemblies) affords me... but at the end of the day, I'm on .NET because of #VisualBasic. Finally, when my latest late night experimenting; I'm happy to see that there does appear to be some hope with regards to a #VisualBasic and WASM story... it might not be Blazor and that's OK. We can walk our own path as long as there is a path that can be walked. ;-)
    Jay Asbury
    @vbjay
    I think .net 5 will help with that situation.
    I just did an example project recently. https://github.com/vbjay/ImageProcessing
    Cory Smith
    @DualBrain
    @vbjay I agree...
    Mohammad Hamdy Ghanem
    @VBAndCs
    @DualBrain Try a vb code that contains lambdas. I don't think it will run on webasm. I am facing troubles with such codes in Blazor, although I am using identical VB classes to thise in C#.
    Cory Smith
    @DualBrain
    @paul1956 Love some of your comments in the initial submission over at dotnet/winforms#3050 - especially the one about no automated tests. (HUGE HIGH FIVE!)
    Paul M Cohen
    @paul1956
    When I did initial work on porting VB file I/O to core all the code was VB from reference source and I wrote all the tests in VB as well. The code stayed VB but someone ported all the tests to C# after I was done, so I want going to bother. I did do one test in C# for the repo, all my testing is in another project that needs single instance.
    Cory Smith
    @DualBrain
    @paul1956 I'm simultaneously happy and tramatized watching the work take place on the whole SingleInstance process through github. It's awesome to see that there is a ton of review and a lot of eyes - if this much effort goes into everything... no wonder the wheels turning so slowly. ;-) I suppose in the end it's a good thing... helps to protect all of us in the end.
    "I believe Using statement should be avoid." <--- Huh?
    Paul M Cohen
    @paul1956
    Yes, after a few comments I decided to ignore the rest. It’s Jared’s that I find most disturbing, “Ignore editor.Config”and follow the style of decades old code” that to me was the Huh? The one file had 1/2 of the style violations of the entire Repo.
    Adam Speight
    @AdamSpeight2008
    Jared is too focused on the "style of the code" rather than the function of the code.
    Paul M Cohen
    @paul1956
    Agreed.
    Mohammad Hamdy Ghanem
    @VBAndCs
    I hope you participate in this discussion about Vlazor (VB.NET Blazor) dotnet/vblang#534
    Cory Smith
    @DualBrain

    I have to point out something that is not only annoying me, but also affecting @paul1956 . It is pretty silly that the VB style of checking for whether or not a string has a value or not is warned against.

    If MyString <> "" Then

    The suggested "fix" is that you have to write:

    If String.IsNullOrEmpty(MyString) Then

    Seriously????

    Why do I, as the writer (and ultimately reader) have to conform to such a mechanism? The first way is a) eaiser to type and b) from at least my point of view, easier to read.

    Sure... we could also write:

    If MyString?.Length > 0 Then

    But why?

    Having Visual Studio constantly bark at me because I'm doing it the VB way... in VB... is really damned annoying.

    Furthermore, having the dotnet team complain about the VB... way... really?!?!

    Annoying...

    Jeff Bowman
    @InteXX
    @DualBrain I agree. In my case, at least, I've been able to mitigate the issue somewhat by using a pair of extension methods in a private package that I add to all my projects by default.
      <Extension>
      <DebuggerStepThrough>
      Public Function IsNothingOrEmpty(Instance As String) As Boolean
        Return String.IsNullOrEmpty(Instance)
      End Function
    
      <Extension>
      <DebuggerStepThrough>
      Public Function IsNothingOrWhiteSpace(Instance As String) As Boolean
        Return String.IsNullOrWhiteSpace(Instance)
      End Function
    Paul M Cohen
    @paul1956
    These don’t stop VS from complaining. All my code used to include them but they are not understood by Analyzers. The analyzer is wrong for VB where Nothing = “” is True. I am still confused about CType(Nothing, String). IsNothingOrWhitespace because I always thought it worked but there say be some extensions that fail to check for Nothing.
    Paul M Cohen
    @paul1956
    I think there needs to be an Attribute (maybe that is what Nullability is about) that I can put on my Extension to tell the analyzer that a VB Extension is Null/Nothing safe.
    Jeff Bowman
    @InteXX
    @paul1956 I'm interested in this. Could you provide some repro steps?
    Paul M Cohen
    @paul1956
    @InteXX not sure what you are asking?
    Jeff Bowman
    @InteXX
    @paul1956 VS doesn't complain about these extension methods, at least to me. I'd like to be able to reproduce what you're talking about.
    Paul M Cohen
    @paul1956
    Are you using editorConfig and/or Dotnet/Roslyn?
    # editorconfig.org
    
    # top-most EditorConfig file
    root = true
    
    # Default settings:
    # A newline ending every file
    # Use 4 spaces as indentation
    [*]
    indent_style = space
    indent_size = 4
    
    [*.json]
    indent_size = 2
    
    # C# and VB files
    [*.{cs,vb}]
    charset = utf-8-bom
    insert_final_newline = true
    trim_trailing_whitespace = true
    
    # avoid this. unless absolutely necessary
    dotnet_style_qualification_for_field = false:suggestion
    dotnet_style_qualification_for_property = false:suggestion
    dotnet_style_qualification_for_method = false:suggestion
    dotnet_style_qualification_for_event = false:suggestion
    # use language keywords instead of BCL types
    dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
    dotnet_style_predefined_type_for_member_access = true:suggestion
    
    # name all constant fields using PascalCase
    dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
    dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols  = constant_fields
    dotnet_naming_rule.constant_fields_should_be_pascal_case.style    = pascal_case_style
    
    dotnet_naming_symbols.constant_fields.applicable_kinds   = field
    dotnet_naming_symbols.constant_fields.required_modifiers = const
    
    dotnet_naming_style.pascal_case_style.capitalization = pascal_case
    
    # static fields should have s_ prefix
    dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
    dotnet_naming_rule.static_fields_should_have_prefix.symbols  = static_fields
    dotnet_naming_rule.static_fields_should_have_prefix.style    = static_prefix_style
    
    dotnet_naming_symbols.static_fields.applicable_kinds   = field
    dotnet_naming_symbols.static_fields.required_modifiers = static
    
    dotnet_naming_style.static_prefix_style.required_prefix = s_
    dotnet_naming_style.static_prefix_style.capitalization = camel_case
    
    # internal and private fields should be _camelCase
    dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
    dotnet_naming_rule.camel_case_for_private_internal_fields.symbols  = private_internal_fields
    dotnet_naming_rule.camel_case_for_private_internal_fields.style    = camel_case_underscore_style
    
    dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
    dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
    
    dotnet_naming_style.camel_case_underscore_style.required_prefix = _
    dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
    
    # Code style defaults
    dotnet_sort_system_directives_first = true
    
    # Expression-level preferences
    dotnet_style_object_initializer = true:suggestion
    dotnet_style_collection_initializer = true:suggestion
    dotnet_style_explicit_tuple_names = true:suggestion
    dotnet_style_coalesce_expression = true:suggestion
    dotnet_style_null_propagation = true:suggestion
    
    # C# files
    [*.cs]
    # New line preferences
    csharp_new_line_before_open_brace = all
    csharp_new_line_before_else = true
    csharp_new_line_before_catch = true
    csharp_new_line_before_finally = true
    csharp_new_line_before_members_in_object_initializers = true
    csharp_new_line_before_members_in_anonymous_types = true
    csharp_new_line_between_query_expression_clauses = true
    
    # Indentation preferences
    csharp_indent_block_contents = true
    csharp_indent_braces = false
    csharp_indent_case_contents = true
    csharp_indent_switch_labels = true
    csharp_indent_labels = one_less_than_current
    
    # only use var when it's obvious what the variable type is
    csharp_style_var_for_built_in_types = false:none
    csharp_style_var_when_type_is_apparent = false:none
    csharp_style_var_elsewhere = false:suggestion
    
    
    # Code style defaults
    csharp_preserve_single_line_blocks = true
    csharp_preserve_single_line_statements = false
    
    # Expression-bodied members
    csharp_style_expression_bodied_methods = false:none
    csharp_style_expression_bodied_constructors = false:none
    csharp_style_expression_bodied_operators = false:none
    csharp_style_expression_bodied_properties = true:none
    csharp_style_expression_bodied_indexers = true:none
    csharp_style_expression_bodied_accessors = true:none
    
    # Pattern matching
    csharp_style_pattern_matching_over_is_
    Above is from WinForms should be identical to DotNet defaults and Roslyn.
    I am also using Version 16.6.0 Preview 3.0
    Jeff Bowman
    @InteXX
    @paul1956 I am not. I probably should be.
    Paul M Cohen
    @paul1956
    image.png
    The problem is when the string is passed in as a Parameter to a public function even though I call extension IsNullOrWhitespace the analyzer don't know about it.
    Paul M Cohen
    @paul1956
    Hence the little green squiggle above.
    Jeff Bowman
    @InteXX
    @paul1956 OK, I see now. Yes, that's pretty ugly.
    Paul M Cohen
    @paul1956
    That is why I stopped using by own extensions which is unfortunate because I would like the "Not" versions as well.
    Jeff Bowman
    @InteXX

    @paul1956 What happens if you wrap x in a Trim() call?

    If Trim(x).IsNullOrWhiteSpace Then
      Return ""
    End If

    I realize that breaks your conditional test, but I'm just curious.

    Paul M Cohen
    @paul1956
    image.png