What's New in C# 11 | .NET Conf 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024
  • Take it to 11 with Dustin and Mads as they share the latest goodies of C#. Once again, the next version of C# brings new convenience, elegance and expressiveness to a codebase near you!
    www.dotnetconf...
    #DotNet #dotnetconf #dotnet7
    🙋‍♀️🙋‍♂️ Get your questions answered on the Microsoft Q&A for .NET: aka.ms/dotnet-qa
    🏫 Learn C#, F#, and .NET with free self-guided learning from Microsoft Learn: aka.ms/learndo...

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

  • @SKRUBL0RD
    @SKRUBL0RD ปีที่แล้ว +12

    this language just keeps getting better and better and all of the quirky syntactical sugar is so juicy and inspiring and makes me want c# to take over as the primary language in all uses everywhere

  • @ramelandingdong
    @ramelandingdong ปีที่แล้ว +14

    Finally, static virtual interface members. Been waiting for this for years 🙏❤

  • @Robert-G
    @Robert-G ปีที่แล้ว +4

    Considering the vague Delphi kinship of C#: it is really great seeing an equivalent of Delphi’s virtual/abstract class methods getting a comeback to the netcoreapp clr. :-)
    with a few nice twists no less… they can still be called fully static with 0 overhead!

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

      Is anyone still using Delphi? It is sad that this great programming language is no longer popular.

  • @ChristianHowell
    @ChristianHowell ปีที่แล้ว +4

    Every time I think I need to create some new package, C# adds it as a feature... The latest is talked about here, the Generic math.. A godsend especially in the switch format...

  • @obinnaokafor6252
    @obinnaokafor6252 ปีที่แล้ว +6

    Great work team. When is Discriminated Union (DU) coming.

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

    I have a question around the "T.Zero" - I am used to using default(T) for types, can this still be done here? The default is presumably still zero as they are non-nullable value types?!

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

    That switch looks like the one you can find in rust language 😛, glad to see that now in C#.

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

    The thing with the multi-quotes: this is an engineer solving a problem that nobody, EVER, will have. And if they DO have that problem, they deserve what they get. :D
    The other stuff, though, is very exciting.

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

      This feature is the reason I've been using C#11 in preview. Using it can make test input for unit tests more human readable and therefore maintainable and a better source of documentation.

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

      by multi-quotes, do you mean raw string literals? They are incredibly useful and a problem that people have had for years

  • @andreasmewald2439
    @andreasmewald2439 ปีที่แล้ว +4

    IParsable where T : IParsable? can someone explain this ?!?!

    • @krajekdev
      @krajekdev ปีที่แล้ว +6

      Read about "curiously recurring template pattern"

  • @csm-csm
    @csm-csm ปีที่แล้ว

    Well? How far is C# team from reimplementing all features Haskell in dotnet?

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

    "...just add one more (quote)" 24:00
    NOOOOO, It's ridiculous.

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

      Do you prefer \"\"\"? Is that more readable?

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

      @@modernkennnern No, I just didn’t like the solution presented… but It’s my opinion

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

      @@jonasaraldi personally I think it's very clever and intuitive. It's a niche scenario - most often you just have 3 - but if you for some reason need 3 consecutive inside the string itself then you need another.
      For reference, if you want to string interpolate, you do the same "dance" - if there is a "{}" inside the string, then you need two "$$" before the string ($$"""......""")

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

    F# style syntax for discriminated unions please, and tail call optimisation.

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

      It must be idiomatic C#, yet very expressive.

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

    trying to figure out how to multiply by a constant not zero or one, hmmm.

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

      Maybe you could multiply the static generic one by a scaler of a non-generic type?

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

      @@ZakKohler I found T.CreateChecked(42) which will create a T type from a 42 constant. Looks funny but performs well.

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

    3:46 Did my man over here use a "" instead of string.Empty; :D

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

      They are absolutely the same.

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

      There's no reason to use string.Empty.

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

      @@Neme112 Functionally they're equivalent, but it makes the intent more clear.

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

      ​@@modernkennnern I don't think it does. There's nothing clearer than just making an empty string with empty quotes. It says exactly what it does.

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

      @@Neme112 "​" and "" are not equivalent though, which could be a problem.
      (Hint, if you can't see the difference, it's because there's a zero-width space in there)

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

    Very ugly code at 21:00, looking more like angular and not readable at all, bleuuugh.

  • @luizpar
    @luizpar ปีที่แล้ว +5

    I hate that you guys are dumbing down the language. It’s losing all it’s sense of structure. It’s really frustrating.
    Making the language more intellectually accessible doesn’t do any good in the long term, and you should know this. It only creates a false sense of understanding at the beginning, postponing the necessity to understand the basics, such as “using” directives, or namespaces, or classes, or even… the Main method!

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

      take cs50 then use c#. problem solved.

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

    6:45 Still wrapping my head around required optional attribute parameters 😁

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

    So still no semi-auto properties?