C# 9.0: Pattern Matching

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

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

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

    You explained all of these new patterns so well; I went from no knowledge of them to feeling like I could put them into my code in under 20 mins. Love the format of the videos :)

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

      Thank you so much for the kind words! That makes me extremely happy to hear :)

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

    This is the best video I've seen about pattern matching! And I think it is the most complete video about it! Very good explanations!

  • @NOCLAF-gw7nn
    @NOCLAF-gw7nn 3 ปีที่แล้ว

    Thank you, it is the best tutorial i found for Pattern Matching with C#.

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

    Thank you for this- great insight into Pattern matching, a foundation for my AI!

    • @FilipEkberg
      @FilipEkberg  4 ปีที่แล้ว

      Thanks for watching!

  • @DarshanaHashendra
    @DarshanaHashendra 2 ปีที่แล้ว

    Great explanation , great content. Love to listen to your teachings.

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

    I really like the format of these videos! Great explanation :)

    • @FilipEkberg
      @FilipEkberg  4 ปีที่แล้ว

      That makes me very happy to hear. Thank you very much!

  • @Sonny0276
    @Sonny0276 3 ปีที่แล้ว

    Great Video. Thank you for posting.

  • @Luca-rw8jx
    @Luca-rw8jx 4 ปีที่แล้ว +2

    this work is underrated. thanks for doing this and looking forward to more csharp related content

    • @FilipEkberg
      @FilipEkberg  4 ปีที่แล้ว

      Thanks so much for the nice comment!

  • @zankomag8322
    @zankomag8322 3 ปีที่แล้ว

    I really like the way you present information. It's so simple to get it!

  • @aquadury7354
    @aquadury7354 3 ปีที่แล้ว

    Hey man! Thank you for your lectures, they are awesome, clear and concise. Came to your channel from your Pluralsight "Command Pattern" xD

    • @FilipEkberg
      @FilipEkberg  3 ปีที่แล้ว

      Thank you so much for those kind words! I am happy you like it :)

  • @SolidJuho
    @SolidJuho 4 ปีที่แล้ว

    All of these videos of new features of C# 9.0 are extremely well executed.
    They are short, informative and simple with great examples.
    It would be great to also have these from C# 8.0 which is also "relatively" new.

  • @Expertali66
    @Expertali66 3 ปีที่แล้ว

    I just found this channel, and I am very glad that I did! Your description is very clear and the examples you use make it even easier to understand. Keep up the good work!

    • @FilipEkberg
      @FilipEkberg  3 ปีที่แล้ว

      Thank you so much 🙏

  • @vhbil
    @vhbil 4 ปีที่แล้ว

    I get excited about new language features too!

    • @FilipEkberg
      @FilipEkberg  4 ปีที่แล้ว

      Glad I'm not the only one!

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

    Great video. I'm happy about the patterns and the functional direction of C#. I would love to see discriminated unions come to C# 10...oh and keep the patterns coming too :-)

    • @FilipEkberg
      @FilipEkberg  4 ปีที่แล้ว

      Thank you very much!
      You and me both. It's really exciting times for C#. What more patterns would you like to see?

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

    Thanks for the video, a really useful overview of the types of pattern matching now available in C# 9.0. I really dislike the way the Positional pattern matching has been implemented because it requires me to go and examine the deconstructor for the object type, I'm not sure how this makes the code more readable.

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

    Pattern matching in C# is now better supported than in F#.

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

    The pattern syntax in this example if anything is less readable. It appears way more messy and for people unfamiliar with patterns would just be confusing.

  • @chammu6936
    @chammu6936 3 ปีที่แล้ว

    Clear explanation. I have one small question. Can we define the .NET5 like this? .NET5 is the combination of .NET core and .NET Framework

  • @piotrw3366
    @piotrw3366 2 ปีที่แล้ว

    Thank you for making this video! Can I ask you a question?
    In this code *if(n is 1 or 2 || true)* I was fully expecting to be able to use *or* instead of || but it throws an error. Does that mean that to add a 2nd condition we still need to use the logical operators || && ?
    Thanks!

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

    don't like to add new keywords if you can wo them. instead of init you can write readonly set, instead of record you can write imho const class

    • @FilipCordas
      @FilipCordas 4 ปีที่แล้ว

      I don't think they are keywords in sense like foreach or while are. They are more positional so you can still use the name as variable names.

  • @SalimNemoMakouche
    @SalimNemoMakouche 2 ปีที่แล้ว

    Good explanation :) still it's not possible to write something like with rust or F# :
    match x {
    1 => println!("one"),
    2 => println!("two"),
    3 => println!("three"),
    _ => println!("anything"),
    }

  • @PbPomper
    @PbPomper 2 ปีที่แล้ว

    The only problem I have with this is that you can not test against variables, which you have to do 95% of the time. Using hard coded values is usually a big no-no in practice.

  • @RoyZASTEROiD
    @RoyZASTEROiD 3 ปีที่แล้ว

    Big thanks for easy explanation. What this code name? i know this is not method decloration, but what is the name of this code? anonym variable? or what?
    var (Name2, Rank2) = GetOfficer(); // what is this part name? : var (Name2, Rank2)
    and this. I understand this is method, but without name..? can u explain what is this?:
    (int Something, string Another) Whatever((int Neat, bool Cool) data)
    {
    return (data.Neat, data.Cool.ToString());
    }

    • @FilipEkberg
      @FilipEkberg  3 ปีที่แล้ว

      Thanks!
      The first one, that is known as a tuple.
      In your second example, you return a tuple with two fields (values): one integer named Something and one string named Another. The method accepts a named tuple which you call data, this tuple has two fields (values). The method then returns a new tuple which is constructed using the values from what you passed to the method.
      I hope this helps!

    • @RoyZASTEROiD
      @RoyZASTEROiD 3 ปีที่แล้ว

      @@FilipEkberg big thanks, and sorry for my bad english

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

    I sometimes feel sorry for the language team. They worked really hard on such great features and we consumers out there on the internet are only debating about stuff like: var x = new T() vs T x = new()....

    • @FilipEkberg
      @FilipEkberg  3 ปีที่แล้ว

      They do an amazing job!

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

    My pattern matching has detected you changed your profession. At the beginning you are a public speaker but at the end you are an author. Very suspicious.

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

      I guess a lot can happen in 16 minutes and 40 seconds :)

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

    "Improvements"

  • @yasser2768
    @yasser2768 4 ปีที่แล้ว

    I think all of this is not really that important actually it's complicating the code and making it unreadable

  • @BristlyBright
    @BristlyBright 4 ปีที่แล้ว

    Varför uttalar du som svensk ditt namn på det sättet? Ekberg. Eckbörg? Ett namn är ett namn och uttalas bara på ett sätt.
    Nu skall jag kolla resten av videon, som jag faktiskt tror är av bra kvalitet, ämnet är av stort intresse.

    • @FilipEkberg
      @FilipEkberg  4 ปีที่แล้ว

      Alltid gjort och kommer alltid göra.
      Jag anser att ett namn kan uttalas hur som helst, spelar ingen roll.

    • @BristlyBright
      @BristlyBright 4 ปีที่แล้ว

      @@FilipEkberg Tack för svar. Jag tycker det känns konstigt bara. Men respekt för bra kontent skall du ha i alla fall!! 👍

    • @FilipEkberg
      @FilipEkberg  4 ปีที่แล้ว

      @@BristlyBright Tack så mycket! Kul att du gillar de :)