Coding Shorts: Don't Be Afraid of Pattern Matching in C#

  Рет қаралды 3,639

Shawn Wildermuth

Shawn Wildermuth

Күн бұрын

Пікірлер: 28
@rogerpence
@rogerpence Жыл бұрын
This is very helpful, Shawn. Your concise format is great. And I can't tell you how much I appreciate you saying, "let's get started..." and then not making me watch a 90 splash screen. Thank you!
@swildermuth
@swildermuth Жыл бұрын
I appreciate that!
@antondoit
@antondoit 3 ай бұрын
Great
@vssang4035
@vssang4035 7 ай бұрын
Great video Shawn... Im a big fan of your teaching style. Easy to follow and understand. Thanks
@AbouLojyn
@AbouLojyn Жыл бұрын
Awesome
@shenmajid
@shenmajid Жыл бұрын
Best explanation ever..
@swildermuth
@swildermuth Жыл бұрын
Glad it was helpful!
@rumbust7793
@rumbust7793 Жыл бұрын
Took me about 15 minutes in to the video to see the Falcon, have my build of that same same model on a shelf behind me in view when doing conference calls. Mind blown by the pattern matching, I'm guessing this is a "Core" feature? My current project dreams of going to Core but there's currently no real reason to move but we have considered doing some reasonably free standing part in Core just to get started.
@seriyezh
@seriyezh Жыл бұрын
Thank you Shawn. Pattern matching is a really powerful tool. The only problem for me personally is that now I use it by default whenever I can, but I need to remember which features are supported by each C# version 😁.
@clearz3600
@clearz3600 Жыл бұрын
Hi, Wouldn't using 'when msg is string' be redundant since it will already be matched as a string using 'string s'
@swildermuth
@swildermuth Жыл бұрын
Yes, not my best example.
@godfathermikal
@godfathermikal Жыл бұрын
I glossed over pattern matching as I didn't really see a need for it. Thought it was more gimmicky than useful. Now, I must retract my original opinion. I really am glad that you take the time to make these coding shorts. The usefulness I have found in them is almost better than a Pluralsight/Udemy subscription. These are actually applicable to the work I do every day. Thank you!
@swildermuth
@swildermuth Жыл бұрын
Glad it was helpful!
@DominicCronin
@DominicCronin 2 ай бұрын
I've just subscribed on the basis of this video. I'm still trying to figure out when the pattern-matching switch counts as an improvement to the code. I'm clear that the answer is "Not always". Conciseness isn't always a virtue, especially if you end up with write-only code that the reader has to unpick.
@swildermuth
@swildermuth 2 ай бұрын
This difference here is being able to make more concise code that is easier to read and uses fewer allocations. But it's not a big enough difference to try and refactor all your existing code, but it's a nice arrow in the quiver.
@DominicCronin
@DominicCronin 2 ай бұрын
@@swildermuth Oh - I agree, it's a nice arrow in the quiver, but I've already seen enough examples of people using switch expressions to write unbelievably dense code, and often to put far more logic in a function than makes sense. Conciseness can be beneficial, but use with care!!
@RiversJ
@RiversJ Жыл бұрын
Afraid? I get annoyed when i can't use it as fully as i want to!
@swildermuth
@swildermuth Жыл бұрын
Exactly
@arjanvandenberg5313
@arjanvandenberg5313 Жыл бұрын
Fully agree with the concise format. Very good and thanks again!
@Adminian357
@Adminian357 Жыл бұрын
Loving these Shawn!
@swildermuth
@swildermuth Жыл бұрын
Thanks, fun doing them.
@mazingguitar
@mazingguitar Жыл бұрын
I've managed to miss pattern matching feature somehow but it's ultra powerful. It gives you so much power of method logic customization (e.g. where your logic should be different for enumerable regarding their sizes). Great explanation - hope I'll make use of this sooner than later :)
@swildermuth
@swildermuth Жыл бұрын
Awesome!
@mattbristo6933
@mattbristo6933 Жыл бұрын
Brilliant video
@swildermuth
@swildermuth Жыл бұрын
Thanks!
@a-s733
@a-s733 Жыл бұрын
Very clear. Thanks Shawn
@swildermuth
@swildermuth Жыл бұрын
You got it!
Coding Shorts: Stop Leaking Secrets in ASP.NET Core
14:19
Shawn Wildermuth
Рет қаралды 6 М.
Coding Shorts: C# Dialects and Idioms
19:13
Shawn Wildermuth
Рет қаралды 3,3 М.
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,6 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 46 МЛН
LIFEHACK😳 Rate our backpacks 1-10 😜🔥🎒
00:13
Diana Belitskay
Рет қаралды 3,9 МЛН
C# 11 - List Patterns
17:29
Coding Tutorials
Рет қаралды 2,6 М.
Why is C# Evolving This Way?
15:02
Zoran Horvat
Рет қаралды 22 М.
Every single feature added in C# 11
27:07
Nick Chapsas
Рет қаралды 111 М.
The evolution of Pattern Matching in C# (from version 6 to 10)
16:08
C# 9.0: Pattern Matching
16:41
Filip Ekberg
Рет қаралды 17 М.
Every feature added in C# 10 with examples
15:59
Nick Chapsas
Рет қаралды 125 М.
Coding Shorts #101: Getting More Out of Your ASP.NET Core HealthChecks
10:49
Functional programming in C#
8:24
Train To Code
Рет қаралды 4,9 М.