Monday 

Room 5 

17:40 - 18:40 

(UTC±00

Talk (60 min)

Roslyn Source Generators - Never send a human to do a machine's job

.NET Source Generators are the latest metaprogramming technique to add C# code to your compilation. They help us automate tedious boilerplate implementations of common patterns, and enable replacing Reflection-based logic with high-performance strongly typed solutions. Introduced in .NET 5, their capabilities are expanded in .NET 6, which also starts utilizing their power in order to level up well-established scenarios, such as logging. Additionally, C# 9.0 adds module initializers and extends partial methods to furthermore support code generation. Not only would I like to show you these language features plus the basic mechanics of adding new sources and reporting diagnostics via Generators, but also cover a selection of advanced topics, including unit testing (both the Generator itself and the code it generates), code coverage, mutation testing, benchmarking, and how to use nullable reference types within .NET Standard 2.0 Generator-Projects. As a bonus, I shall deliver a suite of (web) tools to kick-start your journey. TL;DR - C# Source Generators: Would you like to know more?

.NET
Languages
Testing

Stefan Pölz

Stefan's passion is to practice Clean Code and test-driven development in order to build maintainable software in an ever-evolving team, supported by tools from the .NET Ecosystem. He loves to attend and speak at public developer events, co-organize local community gatherings, stream live programming sessions, and author open source projects, complementing his expertise in professional software development. As Microsoft MVP (Developer Technologies), JetBrains Community Contributor (.NET) and co-organizer of DotNetDevs.at, it's his ambition to share knowledge about everything C#.