Domain Modeling Made Functional, Part 2 with Scott Wlaschin

00:00 69:03

We continue our conversation with Scott Wlaschin, author of “Domain Modeling Made Functional” and creator of the popular F# for Fun and Profit blog, as we dive into functional programming concepts and how they naturally complement domain-driven design.

In this episode, we explore the practical aspects of functional programming - from understanding what makes a language functional to implementing robust error handling patterns and modeling domain concepts functionally.

Topics include:

  • What functional programming really means
  • The difference between the FP paradigm and FP languages
  • Why functional languages make certain patterns natural (immutability, currying, partial application)
  • Railway-oriented programming and functional error handling patterns
  • How functional programming approaches dependency injection differently
  • Three types of errors: panics, domain exceptions, and infrastructure errors
  • How functional programming helps with domain modeling through composable data types
  • Pipeline-oriented programming and workflow modeling
  • Modeling DDD concepts functionally: entities, value objects, and aggregates
  • Why functional programming language usage is still less common than OO languages
  • AI’s impact on programming and the importance of domain expertise
  • Learning strategies and the value of multi-paradigm programming

Scott also shares insights on why he prefers using languages “with the grain” rather than forcing paradigms where they don’t fit naturally. He demonstrates practical examples of how functional programming makes domain modeling more explicit and testable, while discussing the trade-offs between different programming paradigms and when each is most appropriate.

We conclude with Scott’s thoughts on AI in software development - why it’s a tool for augmentation rather than replacement, the importance of understanding fundamentals, and how the subscription model might impact the industry.

This is Part 2 of a 2-part series. In Part 1 , we explored the fundamentals of domain-driven design - including strategic vs. tactical DDD, (sub)domains, bounded contexts, ubiquitous language, and the critical importance of communication in software design.

Show Links