Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. .Net 5 Freakin Annoying

.Net 5 Freakin Annoying

Scheduled Pinned Locked Moved The Lounge
dotnetcsharp
37 Posts 20 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • realJSOPR realJSOP

    Yeah, and in my original message, I stated that I did that. The code I was trying to convert has been around for 10 years, and has been working flawlessly the entire time. I've already done the defensive coding that's needed. I've been coding for over 40 years. I think I know pretty much how to do this stuff. And making an object nullable doesn't mean you don't still have to check it before using it, so you gain nothing at all by making it nullable in terms of how much code you have to write.

    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
    -----
    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
    -----
    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

    M Offline
    M Offline
    Member 9167057
    wrote on last edited by
    #28

    You don't have to check by making an object non-nullable. Suppose, I have a function Decode(List Buffer), not Decode(List? Buffer). Well, the moment a null gets passed to this function, the runtime throws an exception. I don't have to check anything in the function, the runtime does for me. More importantly, it throws at the exact point where a null gets converted to a can't-be-null, when taking a List? (or List with nullable disabled), any point in my function using this object can throw and depending on how the code is written, the crash stack trace may or may not end up a gordian knot to debug. With nullable, the stack trace is clear.

    1 Reply Last reply
    0
    • Richard DeemingR Richard Deeming

      I'd have thought it was more annoying that .NET 5 is only supported until May: Microsoft .NET and .NET Core - Microsoft Lifecycle | Microsoft Docs[^] The current "long-term support" version is .NET 6, which is supported until ... November 2024[^]. Turns out not having to rewrite everything every three years is yet another bonus to sticking with .NET Framework 4.8.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      J Offline
      J Offline
      J Frank Reeves
      wrote on last edited by
      #29

      What is truly annoying about .NET 5 only supported until May is that projects targeting .NET 6 are not supported in VS2019, so not only do you have to upgrade projects to .NET 6 you have to upgrade environments to VS2022 to work with those projects.

      1 Reply Last reply
      0
      • realJSOPR realJSOP

        It's screaming about a bunch of warnings that didn't crop up in .Net Framework. CS8600, 8601, 8602, and 8618. I see no benefit when the objects it's screaming about can in fact be null without hurting anything. In fact, my code is written to handle it gracefully. Nanny state bullsh|t...

        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
        -----
        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
        -----
        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

        D Offline
        D Offline
        Davyd McColl
        wrote on last edited by
        #30

        You're looking to add

        disable

        To a PropertyGroup in your .csproj. You may also want to add the following, since you would already have the usings you want:

        disable

        Nullables _kinda_ make sense because people get silly around the value `null`, so you can use this feature to get the compiler to do null checks instead of doing them yourself - but I turn this off because otherwise it warns in a lot of places where I'm already considering that. Implicit usings, imo, may make the code seem to be a little more convenient, but then hide the dependencies of the code - and will add in dependencies that you're not using, which is really annoying if you use something like ReSharper to import an unknown type with alt-enter and there happens to be a same-named type in the implicit imports :confused: You _may_ also check out dotnet 6, since you're upgrading, and 6 is already RTM.

        ------------------------------------------------ If you say that getting the money is the most important thing You will spend your life completely wasting your time You will be doing things you don't like doing In order to go on living That is, to go on doing things you don't like doing Which is stupid. - Alan Watts https://www.youtube.com/watch?v=-gXTZM\_uPMY

        realJSOPR 1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          I'd have thought it was more annoying that .NET 5 is only supported until May: Microsoft .NET and .NET Core - Microsoft Lifecycle | Microsoft Docs[^] The current "long-term support" version is .NET 6, which is supported until ... November 2024[^]. Turns out not having to rewrite everything every three years is yet another bonus to sticking with .NET Framework 4.8.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          S Offline
          S Offline
          Steve Naidamast
          wrote on last edited by
          #31

          I have been sticking with .NET 4.6 since that is the framework I have been developing my current project in. When I started the project, WPF wasn't fully supported in the new .NET frameworks. No problems at all and I still have access to all that "legacy" technology that disappeared with the new .NET Core Frameworks...

          Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

          realJSOPR 1 Reply Last reply
          0
          • realJSOPR realJSOP

            It's screaming about a bunch of warnings that didn't crop up in .Net Framework. CS8600, 8601, 8602, and 8618. I see no benefit when the objects it's screaming about can in fact be null without hurting anything. In fact, my code is written to handle it gracefully. Nanny state bullsh|t...

            ".45 ACP - because shooting twice is just silly" - JSOP, 2010
            -----
            You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
            -----
            When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

            Z Offline
            Z Offline
            zezba9000
            wrote on last edited by
            #32

            Dude a quick Google search will show you that it can be easily disabled.

            realJSOPR 1 Reply Last reply
            0
            • Z zezba9000

              Dude a quick Google search will show you that it can be easily disabled.

              realJSOPR Offline
              realJSOPR Offline
              realJSOP
              wrote on last edited by
              #33

              Dude, go back and re-read my original message. I've already done that. It was freakin annoying to have to, which is the entire point of my rant.

              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
              -----
              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
              -----
              When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

              Z 1 Reply Last reply
              0
              • D Davyd McColl

                You're looking to add

                disable

                To a PropertyGroup in your .csproj. You may also want to add the following, since you would already have the usings you want:

                disable

                Nullables _kinda_ make sense because people get silly around the value `null`, so you can use this feature to get the compiler to do null checks instead of doing them yourself - but I turn this off because otherwise it warns in a lot of places where I'm already considering that. Implicit usings, imo, may make the code seem to be a little more convenient, but then hide the dependencies of the code - and will add in dependencies that you're not using, which is really annoying if you use something like ReSharper to import an unknown type with alt-enter and there happens to be a same-named type in the implicit imports :confused: You _may_ also check out dotnet 6, since you're upgrading, and 6 is already RTM.

                ------------------------------------------------ If you say that getting the money is the most important thing You will spend your life completely wasting your time You will be doing things you don't like doing In order to go on living That is, to go on doing things you don't like doing Which is stupid. - Alan Watts https://www.youtube.com/watch?v=-gXTZM\_uPMY

                realJSOPR Offline
                realJSOPR Offline
                realJSOP
                wrote on last edited by
                #34

                Davyd McColl wrote:

                Nullables kinda make sense because people get silly around the value null, so you can use this feature to get the compiler to do null checks instead of doing them yourself - but I turn this off because otherwise it warns in a lot of places where I'm already considering that.

                I do that too. I already handle the null checks, and just because something is nullable doesn't mean you can just willy-nilly use objects without null checking before hand.

                ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                -----
                You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                -----
                When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                1 Reply Last reply
                0
                • S Steve Naidamast

                  I have been sticking with .NET 4.6 since that is the framework I have been developing my current project in. When I started the project, WPF wasn't fully supported in the new .NET frameworks. No problems at all and I still have access to all that "legacy" technology that disappeared with the new .NET Core Frameworks...

                  Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

                  realJSOPR Offline
                  realJSOPR Offline
                  realJSOP
                  wrote on last edited by
                  #35

                  I typically use .Net 4.7, but in this instance, I was curious about Avalonia and writing a cross-platform app, so I am trying to convert a 10-year-old WPF app to it, and in the process, I chose to use .net 5.0. Avalonia is even more infuriating than .Net5. I went in thinking it was a "better wpf than wpf", but there are a seemingly infinite number of things that it does differently (for instance, instead of having the Visibility attribute, it's IsVisible, which broke a moderate amount of XAML and viewmodels). Many of the same WPF principles apply, but there are enough differences that an experienced WPF dev will be tearing their hair out trying to get it to work.

                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                  -----
                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                  -----
                  When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                  S 1 Reply Last reply
                  0
                  • realJSOPR realJSOP

                    I typically use .Net 4.7, but in this instance, I was curious about Avalonia and writing a cross-platform app, so I am trying to convert a 10-year-old WPF app to it, and in the process, I chose to use .net 5.0. Avalonia is even more infuriating than .Net5. I went in thinking it was a "better wpf than wpf", but there are a seemingly infinite number of things that it does differently (for instance, instead of having the Visibility attribute, it's IsVisible, which broke a moderate amount of XAML and viewmodels). Many of the same WPF principles apply, but there are enough differences that an experienced WPF dev will be tearing their hair out trying to get it to work.

                    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                    -----
                    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                    -----
                    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                    S Offline
                    S Offline
                    Steve Naidamast
                    wrote on last edited by
                    #36

                    I understand your pain... The only thing I am interested with the new .NET Core Frameworks is Blazor Server-Side. It appears to be a return to WebForms with a twist, which I have been predicting for years... :)

                    Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

                    1 Reply Last reply
                    0
                    • realJSOPR realJSOP

                      Dude, go back and re-read my original message. I've already done that. It was freakin annoying to have to, which is the entire point of my rant.

                      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                      -----
                      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                      -----
                      When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                      Z Offline
                      Z Offline
                      zezba9000
                      wrote on last edited by
                      #37

                      This forum kinda sucks as its hard to see context. Sorry if I missed something.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups