Monday, September 14, 2015

Design Patterns for Speakers: Review of Dan Roam's Show and Tell

If I had to describe Dan Roam's book Show and Tell: How Everybody Can Make Extraordinary Presentations (Amazon link), it would be:
Design Patterns for Speakers
I have to thank David Neal (@reverentgeek) for turning me on to this book. This is the result of one of the hallway conversations from That Conference.

Design Patterns
Here's the reason I compare this book to software design patterns. Design patterns are one of those things that programmers are already using, even if they don't realize it. But once we understand what those patterns are, we can start to use them more intentionally.

That was my experience reading this. I recognized some of the patterns in my own presentations, but I also saw a lot of places for refinement.

Four Storylines
Roam explores four different types of presentations: The Report, The Explanation, The Pitch, and The Drama.


And once he dives a bit deeper into each of these, I start to see the patterns in my own presentations. Primarily, I've been working with The Explanation and The Pitch.

For example, most of my talks that describe a technical topic, like Interfaces or Lambda Expressions, fall into pattern of The Explanation. These are designed to start out with what we already know and build step-by-step from there.

Some of my other talks are examples of The Pitch, including Clean Code and Unit Testing Makes Me Faster. Rather than explaining a technology, these are designed to encourage us to change our behavior.

The Details
Entire sections are spent on each of these storylines, as well as the PUMA model (I won't go into details of PUMA -- you need some reason to read the book).

And this is where I started to find places for improvement. Even though I was following the basic storylines in my talks, there are ways that I can handle the details a little differently to make them more effective.

And this is where I go back to the similarity to design patterns: now that I understand the patterns, I can start to use them more intentionally.

I'll stick in this gem from the final thoughts on The Explanation:
There is no such thing as a boring topic. There is only boring teaching.
And there's tons of great advice on how to make things engaging.

Looking for Improvement
Based on what I've read, I'm going to start reviewing my presentations. For example, I recognized a lot of the PUMA elements in my Clean Code presentation. My next step is to really review the talk (by watching this video) and picking out the elements one at a time. With that information, I will take a look at how I can re-order and enhance certain parts. The ultimate goal (just like with writing code) is constant improvement.

Challenge to Try Something New
One of the things that I've been thinking about a lot lately is Becoming a Social Developer (in case you missed it). In fact, one of the big things that I'm working on is a conference talk on the subject.

Originally, I was thinking that this would fall into The Pitch storyline. But after more consideration, I think The Drama is much better. This would change the way that I tell the story -- rather than starting with my eye-opening experience (like I often do when talking to other folks about this (because it seems the most exciting to me)), I should really start out with my low point -- how I was the loner at the conference for many years.

From the people I've talked to, I know that I'm not alone in this experience. Starting off with this helps build the idea of "you are not alone". Then moving to the discovery, the success, and (hopefully) the inspiration to see the world a bit differently and try things out for yourself.

Interestingly enough, this is roughly the pattern used in my original article, but I haven't been using it when talking to developers about it. It was really eye-opening to start examining these storylines to see how I can be more effective in my presentations.

And this has also convinced me that "Becoming a Social Developer" would make a great opening keynote for any developer event. If you'd like to help me with this, drop me a note on the website: Becoming a Social Developer.

[Update June 2016: I presented "Becoming a Social Developer" at NDC Oslo (read more or watch the video).]

Show
A major part of the book is about how to tell your story with visually -- more specifically, with drawings. And this is what David Neal was talking about when he introduced me to Roam's approach.

I've been thinking about how to incorporate this into my presentations as well. I'll probably start off small and work my way up. But David talked about how he's been really successful with the drawings that he uses in his presentations. (And I've seen one of his presentations, and it is very engaging.) I'm looking forward to exploring this a bit more.

Wrap Up
I highly recommend Show and Tell: How Everybody Can Make Extraordinary Presentations by Dan Roam for anyone doing presentations. I'm approaching this from someone who regularly does technical presentations, but this is useful for any type of presentation.

I really like these patterns. Now that I know about them, I can start to use them more intentionally.

Happy Speaking!

Wednesday, September 9, 2015

New Video: Cancellation Basics with Task and Await

Cancellation gets a bit tricky because we end up passing around a cancellation token. But there's a problem: if we create a cancellation token directly, we can't change it. Fortunately, there's a easy solution: use a cancellation token source to manage the token.

Part 4 of my video series on Task and Await is now available. This time we look at the basics of cancelling an asynchronous process. To get code, articles, and other videos, check here: Exploring Task, Await, and Asynchronous Programming.

Watch the video on YouTube: Task and Await in C# - Part 4: Basic Cancellation
Or read the article: Task and Await - Basic Cancellation

Or watch it here:



If you've missed the previous episodes, get them all together in the playlist:




If you've got suggestions for other topics, please leave a comment. I'm always looking for good stuff to talk about.

Happy Coding!

Tuesday, September 8, 2015

Update: Machine Learning Projects for .NET Developers

I've been working my way through Machine Learning Project for .NET Developers by Mathias Brandewinder (Amazon link). Apparently, I'm going pretty slowly since I got the book back in July (and was very excited about what I found). I've made it through Chapter 3 now.

Yes, I've been going slowly. But a lot of the information is really sinking in -- both about machine learning and about the F# language.

Very Approachable
One thing I really like about this book is that it is *very* approachable. When I looked at the first project on recognizing hand-written digits, I was expecting to get lost pretty quickly. And that's why I didn't undertake the challenge earlier (I made up my own challenge instead).

But Mathias made this task seem almost trivial. When he talks about the first step of doing the simplest thing possible (comparing light/dark pixel values from the data with the known values of the training set), it seemed blindingly obvious. Why didn't I think of that?

By seeing such an easy first step, I knew that the task was doable -- even by me.

And this was a hurdle that I needed to get over.

It doesn't stop there, though. That technique gets us positive results, but far from perfect. He then goes on to describe other machine learning algorithms that are a bit more complex (and a little bit outside of my competence with mathematics). And he also talks about the importance of comparing our "tweaked" algorithm to our baseline. We need to make sure we make things better and not worse.

Interesting Problems
Another thing that has kept my attention is the set of problems to be solved. I've already talked about how digit recognition had caught my eye, but it didn't stop there.

In Chapter 3, Mathias goes on to show how to build a simple DSL to query StackOverflow data. Does this sound familiar? If not, just go back to see how Barry Stahl (blog, twitter) blew my mind in a presentation on building a DSL to get StackOverflow data 2 years ago.

Getting into the F# Flow
The examples have also helped me "get into the flow" of F#. This has to do with really embracing the "pipe forward" operator |> and setting up parameters for functions so that they can easily be chained together.

Back to the StackOverflow DSL, I'm surprised at how easy this was to build. F# type providers are really awesome.

Here's a quick run through of the DSL code (which is available on GitHub). The first few lines set up the type provider:


Then there are a few functions to build the DSL:


The way that we interact with StackOverflow is by building a URL with a query string. So each of these small functions (tagged, page, pageSize) are designed to add to the query string. But these make things much easier to work with.

The last function (extractQuestions) executes the query.

And with this in place, we can start using it:


The first couple lines create aliases between "C#" and "F#" and their URL-encoded counterparts.

Then we see the awesomeness of having these small methods that we can pipe together. So what "fsSample" ultimately gets us are the StackOverflow questions that are tagged with "F#" and then gets the first 100 results. (The StackOverflow API is paged, and it returns the first page if no value is specified.)

What I've really grown to like is the syntax that we see in "analyzeTags". This summarizes the results. And it does it in very small pieces. First by getting the tags from the questions, then the number of times each tag appears, then limiting the results to tags that appear more than once, then sorting them in reverse order based on the count, and then printing out the results.

Here's the output of "analyzeTags fsSample":


Working with data this way really makes me like F# more and more.

Hey Look What I Can Do!
The best thing about Machine Learning Projects for .NET Developers is that it lets me do things that I never thought I could do. I had made these tasks out to be much more complicated in my mind.

But here's something I did today (by following the example in the book):


This is a map showing the population density per square km in each country. The data comes from the World Bank, with F# type providers providing easy access to the data, then using Deedle to create data frames that are easily consumable by R and the "rworldmap" package.

It sounds complicated, but there are only about 40 lines in the script file to do this. Really cool stuff.

More To Come
I'm less than halfway through Machine Learning Projects for .NET Developers, so there is much more to come. I think this is the catalyst that I need to travel much deeper into the functional world and the F# language.

Happy Coding!

Monday, September 7, 2015

New Video: Task.IsCompleted Doesn't Mean What You Think

In continuing my video series on Task and Await, Part 3 is now available. To get code downloads, articles, and links to other videos, take a look at Exploring Task, Await, and Asynchronous Methods.

In this episode, we take a look at an alternate way of dealing with continuations with Task. There are lots of useful properties, including IsFaulted, IsCanceled, and IsCompleted. Unfortunately, IsCompleted doesn't mean what we think it means. Fortunately, we can look at Status for the information we're looking for.

Watch it on YouTube: Task and Await in C# - Part 3: IsFaulted, IsCompleted, and Task.Status
Readable version: Task Continuations: Checking IsFaulted, IsCompleted, and TaskStatus

Or watch it here:



Check out the full series playlist to see everything together:


The next episode on Cancellation Basics is coming soon!

Happy Coding!

Thursday, September 3, 2015

New Video: Basic Exception Handling with Task and Await

Part 2 of my video series on Task and Await in C# is now available. Check out the code downloads and articles here: Exploring Task, Await, and Asynchronous Methods.

This time we take a look at what happens if our asynchronous method throws an exception. This is pretty easy to deal with when using the "await" operator (we just add a "catch" block). And if we need to take full control over the situation, we can use the various continuation options that are available with Task.

Direct link: Task and Await in C# - Part 2: Basic Exception Handling

Or watch it here:


Look forward to more episodes coming soon.

Happy Coding!

Wednesday, September 2, 2015

Jeremy on .NET Rocks! (for real this time)

A couple weeks ago, I had a great conversation with Carl Franklin and Richard Campbell. I'm really excited to see that it's now published as .NET Rocks! # 1187: Becoming a Social Developer with Jeremy Clark.

Back in 2010, I announced that I was on .NET Rocks! (sort of). This is when Richard read my email on the show. My email was about how an episode of the show had inspired me to speak at a developer community event for the first time. And then last year, I was on .NET Rocks! (at least for a little bit). This was for Show 1000, and I got to tell that same story in about 5 minutes.

This time, I'm on for the full show. Be sure to check it out:


Becoming a Social Developer
The topic is how to become a social developer -- someone who meets new people and talks to other folks at developers events, whether a local user group or a large conference. This is a challenge, particularly since developers are often introverts (the nature of the business attracts us). But we can get over our fear and make some great connections.

I first put down my thoughts about this last December: Becoming a Social Developer: A Guide for Introverts. Rather than repeating the same points, I'll just recommend that you read that article.

Five years in to my experiment, I made some observations at a conference that I attended recently: On Being a Social Developer: Observations from That Conference. I talk about some of these experiences on the show, but this article gives some more details (including pictures).

[Update 09/2015: Be sure to visit the official website: Becoming a Social Developer]

Thank You!
I really appreciate the chance to share this topic. It's one of those things that was hard for me to learn, but I've found it extremely valuable to my career. (This is my experience with the technical topics that I share as well.)

Based on Carl's question during the show, I decided to pitch this as a topic for Code Mash. This would be a great "day one" talk at any conference to encourage attendees to make the most of their opportunities to spend time with other developers. And I'm sure that I'll be talking about it at developer events in the future.

Some of My Friends
On the show, I mention several of my friends. I want to give a few more details about them:

Filip Ekberg (blog, twitter, Pluralsight)
I first met Filip at the Microsoft MVP summit. We were both first-time MVPs, and we spent quite a bit of the week together. He was living in Sweden at the time, and he's since moved to Australia. He was also nice enough to help me out on my Pluralsight course about localization and globalization.

John Strobel (twitter)
I met John at That Conference just a few weeks ago. We ended up talking quite a bit that week, and I'm sure that we'll have lots of great conversations in the future. Read a little more on my observations at That Conference.

Matt Johnson (blogtwitter, Pluralsight)
I met Matt at the Desert Code Camp when he was living in Phoenix, AZ. We've had some great conversations over the years. He's since moved to Washington to work for Microsoft. Matt is Mr. DateTime, and he's helped me out with some of my own code. Be sure to check out his Pluralsight course and also his talk with Scott Hanselman on Hanselminutes #485. He knows what he's talking about on the subject.

Deborah Kurata (blogtwitter, Pluralsight)
I met Deborah at the Silicon Valley Code Camp a few years back. She is an author and speaker, and she runs a user group in Berkeley, CA. We've talked quite a bit because we know each other through several channels, including the Microsoft MVP program and through Pluralsight.

Since several of us are Pluralsight authors, it's really easy to think that we met through Pluralsight. But that's not the case. Filip's first course published a couple weeks before mine. In fact, when we met at the Microsoft MVP summit, neither of us were Pluralsight authors. We talked to Dustin Davis (Pluralsight, video channel) about his experience with Pluralsight, and that encouraged us to give it a go.

I was one of the folks who encouraged Matt to go forward with his Pluralsight audition, and I was very happy to hear when his first course published. And Deborah's first course published about a month after my first one. So I knew these folks before we all became authors. (BTW, I think that means that John needs to become a Pluralsight author, too.)

Wrap Up
Enjoy the show. And I hope that it encourages you to break out of your comfort zone and talk to someone new. It's been an amazing journey for me. I've made some great friends. I've broadened my technical skill. And I've make my world a little bit bigger. You can do the same.

Happy Coding!

Tuesday, September 1, 2015

New Video: Consuming Asynchronous Methods

I just started a new video series on Task and Await in C#. This is based on my recent series of articles Exploring Task, Await, and Asynchronous Methods.

Part 1 is currently available. This is all about how to consume an asynchronous method. We look at both using Task manually and using await to let the compiler do the heavy lifting. This will give us a good start as we head into looking at exception handling, cancellation, and finding the gotchas along the way.

Direct link: Task and Await in C# - Part 1: Consuming Asynchronous Methods

Or watch it here:

You can get the code samples and view the printed articles here: Exploring Task, Await, and Asynchronous Methods.

Coming Soon:
Part 2: Basic Exception Handling now available!
Part 3: IsFaulted, IsCanceled, and Task.Status now available!
Part 4: Basic Cancellation now available!

Watch the entire series: Task and Await in C#

Happy Coding!