In my career, I’ve spoken at a lot of events. 111 speaking posts since I started blogging. Crazy. Whenever you’re presenting on a technical topic, giving clear direct examples are critical. You really want your topics to transition from theoretical topics in PowerPoint, to practical examples in actual code.
I remember having a conversation with a friend of mine once, Cory said something to the effect of "well, that's what we do, we write code". I worked for Microsoft at the time, lowered my head and said, "No.. I don't write code, I write demos." The truth is though, good demo code is hard to write.
I usually see demo code go one of two directions.
- The demo code is so simplified that it loses all context with reality. I totally get how people end up here. You want to show a concept, and to focus on the specific example that’s being discussed. The challenge with this type of code is that when attendees get back to the “real” world, the examples you gave don’t really connect. How often have you been to a TDD talk where the example was a Math class with a method called “add”. Have you ever written that code in your day-to-day life? Me either. I have, however, written that demo code. Guilty ✋
- The other scenario is almost just as bad. Real world code.
The problem with actual production-real-world-code is, not surprisingly, the opposite problem. Real world production code will always have extra stuff in it no one else cares about. Oh this if statement, don’t worry about it – that’s just an edge case we ran in to because of some internal configuration. This area over here, yeah, that doesn’t matter either. You can end up spending most of your time explaining why your code is the way it is, and not explaining the point of what you are trying to show.
It’s a struggle. I don’t have any good answers.
Some of the best presenters in the world find a way to balance the two. Provide actual working code, but not so-production ready that you get lost in the minutia and edge cases. I have two go-to repos that I use. Code to DI For (Dependency Injection) and Coding Naked (TDD Scenarios). Both are full of contrived examples that serve no real world purposes but demonstrate the examples I’m trying to communicate in my talks.
Introducing Snippy
Snippy is a domain most people are already familiar with. URL Shortening. I’m hoping it will be complex enough for several concepts, and simple enough to focus on some key concepts I like to talk about. I will also probably have a few branches not-for-production, but to extend some contrived ideas. We’ll see.
Snippy is not even close to being done yet (PRs are welcome), I’m working on it from time to time – weekend and evening fun time. In the process, I realized I wanted to leverage OAuth authentication and to be able to fake out the auth for local development and easy distribution (more on that later).
I guess what I’m saying is, demo apps are hard, but sometimes – if you scratch an itch – you learn some new areas and might end up with a few things you can be really proud of.