Forum Discussion

Eduard Keilholz's avatar
Eduard Keilholz
Copper Contributor
Nov 03, 2021

C# 10

What's your favorite addition to C# in version 10?

27 Replies

  • AnthCool's avatar
    AnthCool
    Copper Contributor
    Extended property patterns are neat. Always great to have more ways to write something.
  • I am a fan of global usings! Paired with implicit usings and scopped namespaces my files are so minimal and clean!
  • pkanavos's avatar
    pkanavos
    Copper Contributor
    New pattern matching and lambda magic. I often create pipelines with DataFlow or Channels. To make such code read more like a script, eg `FromSource.Map(MappingFunction).Lookup(....).WriteToSql(...);` I created some extension methods too hide the boilerplate code for generating blocks/channels, connecting them to the pipeline and handling errors. I tried to use a railway-oriented programming style as much as possible. Unfortunately, I had to do quite a lot of explicit casting to `Func<...>` which made the extension methods a lot harder to write and use than I liked. The one feature I still miss is discriminated unions and the corresponding pattern matching. That would make railway-oriented Result handling a lot cleaner and easier

Resources