Nullable Reference Types - The Good, The Bad, The Ugly

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2024

ความคิดเห็น • 31

  • @Torsan1977
    @Torsan1977 11 หลายเดือนก่อน

    Excellent video that I will probably come back to. When I find something confusing it's always good to know that others feel the same way.

  • @RockRockAndDogs
    @RockRockAndDogs ปีที่แล้ว

    Great video. Im oficially your first suscriber from Honduras!

    • @Codewrinkles
      @Codewrinkles  ปีที่แล้ว

      Welcome aboard! Thanks for joining.

  • @pywacketturtle-swain7353
    @pywacketturtle-swain7353 ปีที่แล้ว

    Appreciate the in-depth analysis.

  • @OlehYevseienko
    @OlehYevseienko 6 หลายเดือนก่อน

    Great job!

    • @Codewrinkles
      @Codewrinkles  6 หลายเดือนก่อน +1

      I'm glad you enjoyed it. This video is already one year old. a few thing have changed, but generally I think the weird things working with nullable reference types still exist.

  • @darkogele
    @darkogele ปีที่แล้ว

    You don't need model is valid if you have required set on the dto model.
    The request will be stop before it enters the body of the contolrer 😊.
    BTW very good video sir I like it

    • @Codewrinkles
      @Codewrinkles  ปีที่แล้ว

      Good remark. I'd say that this is still a problem as usuall when you do model validation you would like to do it in a filter and override the default behavior, as you may want to return your own error contract. I have a dedicated video on this and how it's optimal to do this. In this one, I kept it in the controller for simplicity of the story line.
      Thank you very much for watching and taking your time to drop a few lines. I appreciate it.

    • @muczos
      @muczos ปีที่แล้ว

      @@Codewrinkles can you share a link to the video you mention above?

  • @wertyoomusic
    @wertyoomusic ปีที่แล้ว

    Subbed. Great work

    • @Codewrinkles
      @Codewrinkles  ปีที่แล้ว

      Thank you for taking your time to watch it.

  • @EricKing
    @EricKing ปีที่แล้ว +2

    I see nullable reference types as a sort of "nanny" feature, in that it doesn't actually provide any new functionality to the language, but instead exists solely to nag you into the right programming practices. You can write all of the same null-safe code without the nullable reference types feature turned on, and without having to jump through all of the silly hoops it requires. I still haven't decided how I feel about it, but I find myself turning it off quite frequently.

    • @Codewrinkles
      @Codewrinkles  ปีที่แล้ว +1

      Don't get me wrong, I totally agree with you. But I think that nullable reference types are bot more useful and more harmful at the same time. Useful because it makes it easier to write safe code. Harmful because by doing so it introduces a whole bunch of other challenges like those mentioned in the videos. I'm also one of those that doesn't really understand what's all the hype about. But I have seen developers at work following the hype and then getting desperate with all the added complexity. That's why I though that a honest video would actually be very helpful to the community. Because other then that, you just get the "you SHOULD use nullable reference types NOW" stuff. And then, good luck with that.

    • @EricKing
      @EricKing ปีที่แล้ว

      @@Codewrinkles Agreed. Sorry I forgot to mention it in my comment, but I liked your video. :)

    • @shafiqurrehman8476
      @shafiqurrehman8476 ปีที่แล้ว

      @@Codewrinkles your video and explanation is great and nicely explained. Although m new in C# and along with others still wondering to clear my concepts about nullable references but one thing I m very clear about is that the most intellectuals from the world at the Microsoft introduced this feature and we should learn its goods and bads also to polish our skills.

  • @mehdi-vl5nn
    @mehdi-vl5nn ปีที่แล้ว +1

    Any plan to do a video on attributes and reflection?

    • @Codewrinkles
      @Codewrinkles  ปีที่แล้ว

      I scratched the surface of reflection in some older videos. That would be a nice topic, but I'm not sure exactly if people would be interested in such content. As it is so broad, can you maybe mention a few aspects on reflection that you are struggling with or that you would like to see in such a video?

    • @mehdi-vl5nn
      @mehdi-vl5nn ปีที่แล้ว +1

      @@Codewrinkles I have just started learning c#(have a background in Django/react ) so I guess an introduction to the concept could do the trick

  • @allenbythesea
    @allenbythesea 10 หลายเดือนก่อน

    I really hate the nullable types thing. IMO it creates more confusion than it fixes. There is nothing wrong with checking for nulls so that you know when something actually went wrong.

  • @natepepin09
    @natepepin09 ปีที่แล้ว +1

    I really don't like how C# did it. I understand the reasons, like backward compatibility, but Kotlin does it the right way.

    • @Codewrinkles
      @Codewrinkles  ปีที่แล้ว

      Some would argue that also Dart does it better. C# is an old language with a lot of legacy concepts, paradigms and API surface. I think MS is making a great job to modernize it, but it probably takes a lot of time and effort.

    • @krccmsitp2884
      @krccmsitp2884 ปีที่แล้ว

      Can you tell us how Kotlin does it differently?

  • @airman122469
    @airman122469 ปีที่แล้ว

    I hate null. I hate it with a passion. If you errored at some stage, throw, or return a bad status. Null is literally the worst thing to return. I hate when my product owner insists I use null because it’s “easier to check against.”
    Yeah, it is, but it’s also really easy to jump off the Golden Gate Bridge. And I wouldn’t recommend that either.

    • @Codewrinkles
      @Codewrinkles  ปีที่แล้ว

      The "inventor" of null has said in several occasions that this was a billion dollar mistake.

  •  ปีที่แล้ว

    well. in my opinion "nullable reference" feature adds another rule and burden to C# language.

  • @Kyrtap192
    @Kyrtap192 ปีที่แล้ว

    Install vs extenstion and i will be consistent