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 :)
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.
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!
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 :-)
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.
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.
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!
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"), }
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.
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.
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()); }
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!
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()....
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.