Workshop: From Design Patterns to universal abstractions

Would you like to write readable code? Code that you can understand a year later? Code that your co-workers can understand?

If so, you need to use good abstractions in your source code. What makes an abstraction good? How do you arrive at good abstractions?

Most programmers try to ‘invent’ abstractions from scratch. This is an elusive goal. It requires a level of foresight rarely available. What if, instead, you could use existing, universal abstractions?

For decades, programmers have dreamt of being able to assemble software from building blocks, like Lego bricks. In order to do this, such building blocks must be composable, like Lego bricks. What makes an abstraction composable? It turns out that lambda calculus, abstract algebra, and category theory can teach us about composability and other fundamental abstractions of programming. Furthermore, it turns out that some of the most important design patterns in the Gang of Four book are special cases of such universal abstractions.

Framing programming abstractions in mathematical terms has some advantages, one of which is that we get objective laws that we can use to test our assumptions. You can, for example, use such laws to determine whether an abstraction is composable – even in object-oriented programming!

In this workshop, you’ll learn some objective criteria to determine whether a design is composable, and when various design patterns apply. No special background in mathematics is required.

The workshop will include a combination of lecture and exercises, including hands-on programming exercises.

Successful participation in the workshop should enable you to use universal abstractions in your source code. As always, no silver bullet is implied. You will learn about universal abstractions, but it will not magically make all your code instantly perfect.

Intended Audience This workshop is for object-oriented programmers curious about functional programming and the mathematical foundations of programming. You’ll see F# and Haskell code examples during the workshop, but you don’t have to know these language; you’ll learn what you need along the way.

PrerequisitesThe fanciest C# features you’ll use is generics, so programmers with only passing familiarity with C# may be able to participate as well.

Computer SetupYou’ll need to bring your own programming environment capable of compiling and running C# code on the .NET framework (not .NET Core), as well as xUnit.net-based unit tests. You’ll also need a Git client.