正在加载视频...
视频加载失败
Does this make our #chsarp code cleaner? #dotnet
10 条评论

Absolutely.

today.DayOfWeek.ToString(“G”)

that, unfortunately, doesn't answer the question. Do switch expressions make our code cleaner compared to switch statements?

I like it more, it's more concise, and doesn't resemble goto so much.

C# is going towards being more of a functional programming language. It lacks a couple of things that other fp languages offer, but I still like using C#. I personally like the features for switch expressions and records as well

Yes, and it removes the possibility of forgetting to assign the variable, or assigning to the wrong one in the middle of the switch statement.

This makes it way more cleaner.

Of course it's cleaner

So pattern matching like #fsharp

aren't these kind of additions just make the code non readible? I don't like these kind of changes in c#
