Learn about pattern matching in C#

💡𝗖# 𝗧𝗶𝗽 ✔𝗥𝗲𝗹𝗮𝘁𝗶𝗼𝗻𝗮𝗹 𝗣𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝗠𝗮𝘁𝗰𝗵𝗶𝗻𝗴 ✅ 𝗥𝗲𝗹𝗮𝘁𝗶𝗼𝗻𝗮𝗹 𝗣𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝗠𝗮𝘁𝗰𝗵𝗶𝗻𝗴 is a feature introduced in 𝗖# 𝟵 that enhances the pattern matching capabilities of the language. Pattern matching is a way to compare values against patterns. ✅ It is a 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝗮𝗹 programming technique, which means that it focuses on the evaluation of expressions rather than the control flow of your code. 🔥  𝗔𝗱𝘃𝗮𝗻𝘁𝗮𝗴𝗲𝘀 𝗼𝗳 𝗿𝗲𝗹𝗮𝘁𝗶𝗼𝗻𝗮𝗹 𝗽𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝗺𝗮𝘁𝗰𝗵𝗶𝗻𝗴: ◾ 𝗖𝗼𝗻𝗰𝗶𝘀𝗲𝗻𝗲𝘀𝘀: Relational patterns matching can be used to create more concise and readable code. ◾ 𝗘𝘅𝗽𝗿𝗲𝘀𝘀𝗶𝘃𝗲𝗻𝗲𝘀𝘀: Relational patterns matching can be used to express more complex conditions. 🤔 Which one do you prefer? 𝗧𝗵𝗮𝗻𝗸 𝘆𝗼𝘂 𝗳𝗼𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 📖 #csharp #dotnet #programming #aspnetcore #programmingtips

  • 𝗥𝗲𝗹𝗮𝘁𝗶𝗼𝗻𝗮𝗹 𝗣𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝗠𝗮𝘁𝗰𝗵𝗶𝗻𝗴

𝗔𝗻 𝗲𝘅𝗮𝗺𝗽𝗹𝗲 𝘂𝘀𝗶𝗻𝗴 "𝗮𝗻𝗱"

  • No alternative text description for this image

𝗔𝗻𝗼𝘁𝗵𝗲𝗿 𝗲𝘅𝗮𝗺𝗽𝗹𝗲 𝘂𝘀𝗶𝗻𝗴 "𝗼𝗿"

  • No alternative text description for this image
Amirmahdi Fathi

Experienced Software Developer Specializing in .NET, Swift and Angular | Passionate about Scalable Solutions

10mo

Thanks for sharing

MATTHEW O. LORENTZ

SENIOR SOFTWARE ENGINEER

10mo

Love this

Mostafa Ghasabany

Unity 3D / Construct3 / Lionliing.Gamedev

10mo

I'd prefer to see Score on both conditions. It might confuse me.

Amir Eslamzadeh

.Net BackEnd Programmer | API | Microservicess

10mo

Insightful! I mostly use Relational pattern, it's most readable

Sandip Mistry

Software Engineer|Asp.net Core |Angular |Azure

10mo

Nice

Matheus Brito

Software Engineer | .NET, Java, Angular, React | SaaS & Cloud Solutions (Azure/AWS)

10mo

Good information, I'll save that forever!

Raul Junco

Simplifying System Design

10mo

I think it was a good move to gain more readability.

See more comments

To view or add a comment, sign in

Explore topics