dotnext DotNext 2020 SPb (15.06.2020 — 18.06.2020)

Typeclasses in C#


Kirill will tell how to achieve effectiveness, beauty, and flexibility of your code using type classes in C#.

Usually, during design and implementation, you should choose one of two seats: beauty, flexibility, maintainability, or efficiency at runtime.

Kirill will show that in some cases you can comfortably occupy both places using type classes that are not available in C #.

Following the example of Wlaschin, the speaker will present a code that:

  1. It looks like the most ordinary.

  2. Works with any type of item and collection.

  3. Not much inferior to the old school version.

  4. At times faster and more economical than solutions on interfaces.

Additionally, consider:

  1. Universal item-by-item comparison of collections.

  2. LINQ without allocation.

  3. LINQ without calling delegates in a loop.