Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

DEV

DEV artwork

C# Source Generators: Writing Less Code by Letting the Compiler Do More

Sep 25, 20265 minAudio

Boilerplate code is one of the most persistent drains on a development team's time and focus - and C# source generators are one of the most underused tools for eliminating it. This episode of DEV.co explores how Roslyn-powered source generators intercept the compilation process, inspect your code's structure, and emit strongly typed C# files that slot seamlessly into your project - with no reflection, no runtime overhead, and no manual steps required. The discussion is based on the DEV.co deep-dive article on eliminating boilerplate with C# source generators. Here's what the episode covers: How source generators fit into the compiler pipeline - they run during compilation, add new files alongside your existing source, and are fully visible to IntelliSense, the debugger, and the build server. The readability dividend - when repetitive patterns are generated rather than hand-written, code reviews sharpen, onboarding accelerates, and rule changes propagate from a single place instead of dozens of files. The performance case - shifting expensive reflection-based patterns to compile-time concrete implementations can reduce per-operation allocations by more than 90%, a key reason System.Text.Json's source generator pairs so naturally with Native AOT builds. Syntax vs. semantics - effective generators use Roslyn's syntax layer to locate candidate nodes quickly, then consult the semantic model to confirm resolved types, nullability, and generic bindings before generating anything. Why incremental generators are the right default - by expressing transformations as cache-friendly pipelines, IIncrementalGenerator can cut a twenty-second full-reprocessing build down to under two seconds, keeping the development loop tight on large solutions. The highest-value use cases - DTO mappers, INotifyPropertyChanged implementations, and dependency injection registration are the structured, deterministic patterns where generators replace dozens or hundreds of lines with a single attribute declaration. The episode also offers a useful mental model for knowing when a generator is well-designed: it should be boring. Generators are compile-time authors, not runtime reasoners - they receive syntax trees and symbols and respond with source text. Any generator that feels like it's making creative decisions about your business logic is a warning sign. For teams building enterprise software where maintainability and performance at scale both matter, source generators represent exactly the kind of structural investment that pays compounding returns. For more on data-layer architecture in C# applications, the episode Multi-Tenant Postgres: Choosing the Right Isolation Model for Your SaaS is a natural companion listen. DEV.co RFP.co

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. The U.S. Has More Data Centers Than the Next 14 Countries Combined

    Nov 20, 20265 minAudio

    The global data center map looks lopsided by any measure - but the full picture is more striking than a simple site count suggests. This episode of DEV.co digs into a newly published graphic analysis showing just how...

    Credit the people on this episode

  2. From $30 Million to $5 Billion: The AI App Explosion by the Numbers

    Nov 18, 20265 minAudio

    The generative AI app market has posted one of the most dramatic growth curves in consumer software history - and the numbers behind that curve reveal a story far more nuanced than the headline figure suggests. This...

    Credit the people on this episode

  3. AI Adoption: Why the Numbers Are So Far Apart

    Nov 15, 20265 minAudio

    A single statistic can make AI feel like a done deal - nearly every organization already on board, the window to act almost closed. But a competing figure from the U.S. Census Bureau tells a starkly different story....

    Credit the people on this episode

  4. 83% of Developers Use AI Tools — But Only 6.6% Actually Trust Them

    Nov 13, 20265 minAudio

    Widespread AI adoption among software developers is no longer a trend to watch - it's the current reality. But a sweeping Stack Overflow survey of nearly 31,000 developers reveals a striking contradiction at the heart...

    Credit the people on this episode

  5. Private RAG Over Microsoft 365: Permissions, Delta Queries, and What Actually Ships

    Nov 11, 20265 minAudio

    Enterprise teams keep hitting the same wall when grounding LLMs on SharePoint and OneDrive: a working prototype that fails the moment security asks who actually owns access to the returned content. This episode of...

    Credit the people on this episode