[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:16.91,0:00:18.18,Default,,0000,0000,0000,,SAM LIVINGSTON-GRAY: Hello. Welcome to the\Nvery Dialogue: 0,0:00:18.18,0:00:20.40,Default,,0000,0000,0000,,last session of RailsConf. Dialogue: 0,0:00:20.40,0:00:21.08,Default,,0000,0000,0000,,When I leave this stage, Dialogue: 0,0:00:21.08,0:00:22.41,Default,,0000,0000,0000,,they are gonna burn it down. Dialogue: 0,0:00:22.41,0:00:24.21,Default,,0000,0000,0000,,AUDIENCE: Yeah! Dialogue: 0,0:00:24.90,0:00:26.24,Default,,0000,0000,0000,,S.L.: I have a couple of items of business Dialogue: 0,0:00:26.25,0:00:29.89,Default,,0000,0000,0000,,before I launch into my presentation proper.\NThe first Dialogue: 0,0:00:29.89,0:00:32.93,Default,,0000,0000,0000,,of which is turning on my clicker. I work Dialogue: 0,0:00:32.93,0:00:36.45,Default,,0000,0000,0000,,for LivingSocial. We are hiring. If this fact\Nis Dialogue: 0,0:00:36.45,0:00:38.23,Default,,0000,0000,0000,,intriguing to you, please feel free to come\Nand Dialogue: 0,0:00:38.23,0:00:41.40,Default,,0000,0000,0000,,talk to me afterwards. Also, our recruiters\Nbrought a Dialogue: 0,0:00:41.40,0:00:43.79,Default,,0000,0000,0000,,ton of little squishy stress balls that are\Nshaped Dialogue: 0,0:00:43.79,0:00:46.65,Default,,0000,0000,0000,,like little brains. As far as I know, this Dialogue: 0,0:00:46.65,0:00:48.73,Default,,0000,0000,0000,,was a coincidence, but I love the tie-in so Dialogue: 0,0:00:48.73,0:00:50.11,Default,,0000,0000,0000,,I brought the whole bag. I had them leave Dialogue: 0,0:00:50.11,0:00:52.08,Default,,0000,0000,0000,,it for me. So if you would like an Dialogue: 0,0:00:52.08,0:00:54.96,Default,,0000,0000,0000,,extra brain, please come talk to me after\Nthe Dialogue: 0,0:00:54.96,0:00:55.90,Default,,0000,0000,0000,,show. Dialogue: 0,0:00:55.90,0:00:59.05,Default,,0000,0000,0000,,A quick note about accessibility. If you have\Nany Dialogue: 0,0:00:59.05,0:01:02.08,Default,,0000,0000,0000,,trouble seeing my slides, hearing my voice,\Nor following Dialogue: 0,0:01:02.08,0:01:04.52,Default,,0000,0000,0000,,my weird trains of thought, or maybe you just Dialogue: 0,0:01:04.52,0:01:06.58,Default,,0000,0000,0000,,like spoilers, you can get a PDF with both Dialogue: 0,0:01:06.58,0:01:09.42,Default,,0000,0000,0000,,my slides and my script at this url. It's Dialogue: 0,0:01:09.42,0:01:14.27,Default,,0000,0000,0000,,tinyurl dot com, cog dash shorts dash railsconf.\NI Dialogue: 0,0:01:14.27,0:01:15.75,Default,,0000,0000,0000,,also have it up here on a thumb drive, Dialogue: 0,0:01:15.75,0:01:18.22,Default,,0000,0000,0000,,so if the conference wi-fi does what it usually Dialogue: 0,0:01:18.22,0:01:19.97,Default,,0000,0000,0000,,does, please go see Evan Light up in the Dialogue: 0,0:01:19.97,0:01:21.02,Default,,0000,0000,0000,,second row. Dialogue: 0,0:01:21.02,0:01:23.83,Default,,0000,0000,0000,,I'm gonna leave this up for a couple more Dialogue: 0,0:01:23.83,0:01:25.78,Default,,0000,0000,0000,,minutes. And I also want to give a shoutout Dialogue: 0,0:01:25.78,0:01:30.11,Default,,0000,0000,0000,,to the opportunity scholarship program here.\NTo quote the Dialogue: 0,0:01:30.11,0:01:33.02,Default,,0000,0000,0000,,RailsConf site, this program is for people\Nwho wouldn't Dialogue: 0,0:01:33.02,0:01:35.36,Default,,0000,0000,0000,,usually take part in our community or who\Nmight Dialogue: 0,0:01:35.36,0:01:37.38,Default,,0000,0000,0000,,just want a friendly face during their first\Ntime Dialogue: 0,0:01:37.38,0:01:40.75,Default,,0000,0000,0000,,at RailsConf. I'm a huge fan of this program. Dialogue: 0,0:01:40.75,0:01:42.94,Default,,0000,0000,0000,,I think it's a great way to welcome new Dialogue: 0,0:01:42.94,0:01:45.89,Default,,0000,0000,0000,,people and new voices into our community.\NThis is Dialogue: 0,0:01:45.89,0:01:47.63,Default,,0000,0000,0000,,the second year that I've volunteered as a\Nguide Dialogue: 0,0:01:47.63,0:01:48.77,Default,,0000,0000,0000,,and this is the second year that I've met Dialogue: 0,0:01:48.77,0:01:51.75,Default,,0000,0000,0000,,somebody with a fascinating story to tell.\NIf you're Dialogue: 0,0:01:51.75,0:01:54.78,Default,,0000,0000,0000,,a seasoned conference veteran, I strongly\Nencourage you to Dialogue: 0,0:01:54.78,0:01:56.87,Default,,0000,0000,0000,,apply next year. Dialogue: 0,0:01:56.87,0:02:03.87,Default,,0000,0000,0000,,OK. Programming is hard. It's not quantum\Nphysics. But Dialogue: 0,0:02:04.41,0:02:06.70,Default,,0000,0000,0000,,neither is it falling off a log. And if Dialogue: 0,0:02:06.70,0:02:08.53,Default,,0000,0000,0000,,I had to pick just one word to explain Dialogue: 0,0:02:08.53,0:02:12.53,Default,,0000,0000,0000,,why programming is hard, that word would be\Nabstract. Dialogue: 0,0:02:12.53,0:02:15.71,Default,,0000,0000,0000,,I asked Google to define abstract, and here's\Nwhat Dialogue: 0,0:02:15.71,0:02:17.04,Default,,0000,0000,0000,,it said. Dialogue: 0,0:02:17.04,0:02:19.13,Default,,0000,0000,0000,,Existing in thought or as an idea, but not Dialogue: 0,0:02:19.13,0:02:21.63,Default,,0000,0000,0000,,having a physical or concrete existence. Dialogue: 0,0:02:21.63,0:02:24.46,Default,,0000,0000,0000,,I usually prefer defining things in terms\Nof what Dialogue: 0,0:02:24.46,0:02:26.50,Default,,0000,0000,0000,,they are, but in this case I find the Dialogue: 0,0:02:26.50,0:02:31.39,Default,,0000,0000,0000,,negative definition extremely telling. Abstract\Nthings are hard for Dialogue: 0,0:02:31.39,0:02:34.15,Default,,0000,0000,0000,,us to think about precisely because they don't\Nhave Dialogue: 0,0:02:34.15,0:02:35.95,Default,,0000,0000,0000,,a physical or a concrete existence, and that's\Nwhat Dialogue: 0,0:02:35.95,0:02:37.54,Default,,0000,0000,0000,,our brains are wired for. Dialogue: 0,0:02:37.54,0:02:40.67,Default,,0000,0000,0000,,Now, I normally prefer the kind of talk where Dialogue: 0,0:02:40.67,0:02:42.95,Default,,0000,0000,0000,,the speaker just launches right in and forces\Nme Dialogue: 0,0:02:42.95,0:02:45.59,Default,,0000,0000,0000,,to keep up, but this is a complex idea, Dialogue: 0,0:02:45.59,0:02:48.31,Default,,0000,0000,0000,,and it's the last talk of the last day, Dialogue: 0,0:02:48.31,0:02:49.48,Default,,0000,0000,0000,,and I'm sure you're all as fried as I Dialogue: 0,0:02:49.48,0:02:54.01,Default,,0000,0000,0000,,am. So, here's a little background. I got\Nthe Dialogue: 0,0:02:54.01,0:02:56.57,Default,,0000,0000,0000,,idea for this talk when I was listening to Dialogue: 0,0:02:56.57,0:03:00.51,Default,,0000,0000,0000,,the Ruby Rogues podcast episode with Glenn\NVanderburg. This Dialogue: 0,0:03:00.51,0:03:03.36,Default,,0000,0000,0000,,is lightly edited for length, but in that\Nepisode, Dialogue: 0,0:03:03.36,0:03:06.20,Default,,0000,0000,0000,,Glenn said, The best programmers I know all\Nhave Dialogue: 0,0:03:06.20,0:03:09.17,Default,,0000,0000,0000,,some good techniques for conceptualizing or\Nmodeling the programs Dialogue: 0,0:03:09.17,0:03:11.03,Default,,0000,0000,0000,,that they work with. And it tends to be Dialogue: 0,0:03:11.03,0:03:13.96,Default,,0000,0000,0000,,sort of a spatial/visual model, but not always.\NAnd Dialogue: 0,0:03:13.96,0:03:16.07,Default,,0000,0000,0000,,he says, What's going on is our brains are Dialogue: 0,0:03:16.07,0:03:18.40,Default,,0000,0000,0000,,geared towards the physical world and dealing\Nwith our Dialogue: 0,0:03:18.40,0:03:21.68,Default,,0000,0000,0000,,senses and integrating that sensory input. Dialogue: 0,0:03:21.68,0:03:23.10,Default,,0000,0000,0000,,But the work we do as programmers is all Dialogue: 0,0:03:23.10,0:03:25.21,Default,,0000,0000,0000,,abstract. And it makes perfect sense that\Nyou would Dialogue: 0,0:03:25.21,0:03:27.14,Default,,0000,0000,0000,,want to find techniques to rope the physical\Nsensory Dialogue: 0,0:03:27.14,0:03:29.54,Default,,0000,0000,0000,,parts of your brain into this task of dealing Dialogue: 0,0:03:29.54,0:03:32.15,Default,,0000,0000,0000,,with abstractions. And this is the part that\Nreally Dialogue: 0,0:03:32.15,0:03:34.17,Default,,0000,0000,0000,,got my attention. He says, But we don't ever Dialogue: 0,0:03:34.17,0:03:35.73,Default,,0000,0000,0000,,teach anybody how to do that or even that Dialogue: 0,0:03:35.73,0:03:37.95,Default,,0000,0000,0000,,they should do that. Dialogue: 0,0:03:37.95,0:03:40.38,Default,,0000,0000,0000,,When I heard this, I started thinking about\Nthe Dialogue: 0,0:03:40.38,0:03:44.07,Default,,0000,0000,0000,,times that I've stumbled across some technique\Nfor doing Dialogue: 0,0:03:44.07,0:03:46.20,Default,,0000,0000,0000,,something like this, and I've been really\Nexcited to Dialogue: 0,0:03:46.20,0:03:48.83,Default,,0000,0000,0000,,find a way of translating a programming problem\Ninto Dialogue: 0,0:03:48.83,0:03:50.63,Default,,0000,0000,0000,,some form that my brain could really get a Dialogue: 0,0:03:50.63,0:03:52.77,Default,,0000,0000,0000,,handle on. And I was like yeah, yeah, brains Dialogue: 0,0:03:52.77,0:03:54.97,Default,,0000,0000,0000,,are awesome. And we should be teaching people\Nthat Dialogue: 0,0:03:54.97,0:03:57.88,Default,,0000,0000,0000,,this is a thing they can do. Dialogue: 0,0:03:57.88,0:03:59.65,Default,,0000,0000,0000,,And I thought about it, and some time later, Dialogue: 0,0:03:59.65,0:04:02.60,Default,,0000,0000,0000,,I was like, wait a minute. No. Brains are Dialogue: 0,0:04:02.60,0:04:06.54,Default,,0000,0000,0000,,horrible. And teaching people these tricks\Nwould be totally Dialogue: 0,0:04:06.54,0:04:09.07,Default,,0000,0000,0000,,irresponsible, if we also didn't warn them\Nabout cognitive Dialogue: 0,0:04:09.07,0:04:13.04,Default,,0000,0000,0000,,bias. I get to that in a little bit. Dialogue: 0,0:04:13.04,0:04:16.64,Default,,0000,0000,0000,,This is a talk in three parts. Part one, Dialogue: 0,0:04:16.64,0:04:19.00,Default,,0000,0000,0000,,brains are awesome. And as Glenn said, you\Ncan Dialogue: 0,0:04:19.00,0:04:21.02,Default,,0000,0000,0000,,rope the physical and sensory parts of your\Nbrain Dialogue: 0,0:04:21.02,0:04:23.02,Default,,0000,0000,0000,,as well as a few others I'll talk about Dialogue: 0,0:04:23.02,0:04:26.22,Default,,0000,0000,0000,,into helping you deal with abstractions. Part\Ntwo, brains Dialogue: 0,0:04:26.22,0:04:28.32,Default,,0000,0000,0000,,are horrible and they lie to us all the Dialogue: 0,0:04:28.32,0:04:31.47,Default,,0000,0000,0000,,time. But if you're on the look out for Dialogue: 0,0:04:31.47,0:04:33.21,Default,,0000,0000,0000,,the kinds of lies that your brain will tell Dialogue: 0,0:04:33.21,0:04:35.79,Default,,0000,0000,0000,,you, in part three I have an example of Dialogue: 0,0:04:35.79,0:04:37.47,Default,,0000,0000,0000,,the kind of amazing hack that you just might Dialogue: 0,0:04:37.47,0:04:42.29,Default,,0000,0000,0000,,be able to come up with. Dialogue: 0,0:04:42.29,0:04:45.36,Default,,0000,0000,0000,,Our brains are extremely well-adapted for\Ndealing with the Dialogue: 0,0:04:45.36,0:04:50.25,Default,,0000,0000,0000,,physical world. Our hindbrains, which regular\Nrespiration, temperature, and Dialogue: 0,0:04:50.25,0:04:52.31,Default,,0000,0000,0000,,balance, have been around for half a billion\Nyears Dialogue: 0,0:04:52.31,0:04:57.14,Default,,0000,0000,0000,,or so. But when I write software, I am Dialogue: 0,0:04:57.14,0:04:58.75,Default,,0000,0000,0000,,leaning hard on parts of the brain that are Dialogue: 0,0:04:58.75,0:05:01.80,Default,,0000,0000,0000,,relatively new in evolutionary terms, and\NI'm using some Dialogue: 0,0:05:01.80,0:05:04.37,Default,,0000,0000,0000,,relatively expensive resources. Dialogue: 0,0:05:04.37,0:05:05.77,Default,,0000,0000,0000,,So over the years I have built up a Dialogue: 0,0:05:05.77,0:05:09.40,Default,,0000,0000,0000,,small collection of techniques and shortcuts\Nthat engage specialized Dialogue: 0,0:05:09.40,0:05:10.96,Default,,0000,0000,0000,,structures of my brain to help me reason about Dialogue: 0,0:05:10.96,0:05:13.87,Default,,0000,0000,0000,,programming problems. Here's the list. Dialogue: 0,0:05:13.87,0:05:17.88,Default,,0000,0000,0000,,I'm gonna start with a category of visual\Ntools Dialogue: 0,0:05:17.88,0:05:20.41,Default,,0000,0000,0000,,that let us leverage our spatial understanding\Nof the Dialogue: 0,0:05:20.41,0:05:23.50,Default,,0000,0000,0000,,world and our spatial reasoning skills to\Ndiscover relationships Dialogue: 0,0:05:23.50,0:05:25.85,Default,,0000,0000,0000,,between different parts of a model. Or just\Nto Dialogue: 0,0:05:25.85,0:05:27.76,Default,,0000,0000,0000,,stay oriented when we're trying to reason\Nthrough a Dialogue: 0,0:05:27.76,0:05:29.09,Default,,0000,0000,0000,,complex problem. Dialogue: 0,0:05:29.09,0:05:31.57,Default,,0000,0000,0000,,I'm just gonna list out a few examples of Dialogue: 0,0:05:31.57,0:05:34.35,Default,,0000,0000,0000,,this category quickly, because I think most\Ndevelopers are Dialogue: 0,0:05:34.35,0:05:37.32,Default,,0000,0000,0000,,likely to encounter these, either in school\Nor on Dialogue: 0,0:05:37.32,0:05:38.74,Default,,0000,0000,0000,,the job. And they all have the same basic Dialogue: 0,0:05:38.74,0:05:41.87,Default,,0000,0000,0000,,shape. They're boxes and arrows. Dialogue: 0,0:05:41.87,0:05:45.62,Default,,0000,0000,0000,,There's Entity-Relationship Diagrams, which\Nhelp us understand how our Dialogue: 0,0:05:45.62,0:05:48.79,Default,,0000,0000,0000,,data is modeled. We use diagrams to describe\Ndata Dialogue: 0,0:05:48.79,0:05:53.21,Default,,0000,0000,0000,,structures like binary trees, linked lists,\Nand so on. Dialogue: 0,0:05:53.21,0:05:56.09,Default,,0000,0000,0000,,And for state machines of any complexity,\Ndiagrams are Dialogue: 0,0:05:56.09,0:05:57.58,Default,,0000,0000,0000,,often the only way to make any sense of Dialogue: 0,0:05:57.58,0:06:00.33,Default,,0000,0000,0000,,them. I could go on, but like I said, Dialogue: 0,0:06:00.33,0:06:01.95,Default,,0000,0000,0000,,most of us are probably used to using these, Dialogue: 0,0:06:01.95,0:06:02.92,Default,,0000,0000,0000,,at least occasionally. Dialogue: 0,0:06:02.92,0:06:05.47,Default,,0000,0000,0000,,There are three things that I like about these Dialogue: 0,0:06:05.47,0:06:09.72,Default,,0000,0000,0000,,tools. First, they lend themselves really\Nwell to standing Dialogue: 0,0:06:09.72,0:06:12.12,Default,,0000,0000,0000,,up in front of a white board, possibly with Dialogue: 0,0:06:12.12,0:06:15.26,Default,,0000,0000,0000,,a co-worker, and just standing up and moving\Naround Dialogue: 0,0:06:15.26,0:06:17.03,Default,,0000,0000,0000,,a little bit will help get the blood flowing Dialogue: 0,0:06:17.03,0:06:19.51,Default,,0000,0000,0000,,and, and get your brain perked up. Dialogue: 0,0:06:19.51,0:06:22.57,Default,,0000,0000,0000,,Second, diagrams help us offload some of the\Nwork Dialogue: 0,0:06:22.57,0:06:26.17,Default,,0000,0000,0000,,of keeping track of things, of different concepts,\Nby Dialogue: 0,0:06:26.17,0:06:29.25,Default,,0000,0000,0000,,attaching those concepts to objects in a two-dimensional\Nspace. Dialogue: 0,0:06:29.25,0:06:30.92,Default,,0000,0000,0000,,And our brains have a lot of hardware support Dialogue: 0,0:06:30.92,0:06:34.42,Default,,0000,0000,0000,,for keeping track of where things are in space. Dialogue: 0,0:06:34.42,0:06:36.51,Default,,0000,0000,0000,,And third, our brains are really good at pattern Dialogue: 0,0:06:36.51,0:06:39.69,Default,,0000,0000,0000,,recognition, so visualizing our designs can\Ngive us a Dialogue: 0,0:06:39.69,0:06:42.56,Default,,0000,0000,0000,,chance to spot certain kinds of problems just\Nby Dialogue: 0,0:06:42.56,0:06:45.59,Default,,0000,0000,0000,,looking at their shapes before we ever start\Ntyping Dialogue: 0,0:06:45.59,0:06:49.45,Default,,0000,0000,0000,,code in an editor, and I think that's pretty Dialogue: 0,0:06:49.45,0:06:50.01,Default,,0000,0000,0000,,cool. Dialogue: 0,0:06:50.01,0:06:52.56,Default,,0000,0000,0000,,Here's another technique that makes use of\Nour spatial Dialogue: 0,0:06:52.56,0:06:54.89,Default,,0000,0000,0000,,perception skills, and if you saw Sandi's\Ntalk yesterday, Dialogue: 0,0:06:54.89,0:06:57.68,Default,,0000,0000,0000,,you'll know this one. It's the squint test.\NIt's Dialogue: 0,0:06:57.68,0:07:00.37,Default,,0000,0000,0000,,very straight forward. You open up some code\Nand Dialogue: 0,0:07:00.37,0:07:02.37,Default,,0000,0000,0000,,you either squint your eyes at it or you Dialogue: 0,0:07:02.37,0:07:04.73,Default,,0000,0000,0000,,decrease the font size. The point is to look Dialogue: 0,0:07:04.73,0:07:06.85,Default,,0000,0000,0000,,past the words and check out the shape of Dialogue: 0,0:07:06.85,0:07:08.28,Default,,0000,0000,0000,,the code. Dialogue: 0,0:07:08.28,0:07:10.94,Default,,0000,0000,0000,,This is a pathological example that I used\Nin Dialogue: 0,0:07:10.94,0:07:14.52,Default,,0000,0000,0000,,a refactoring talk last year. You can use\Nthis Dialogue: 0,0:07:14.52,0:07:17.61,Default,,0000,0000,0000,,technique as an aid to navigation, as a way Dialogue: 0,0:07:17.61,0:07:19.80,Default,,0000,0000,0000,,of zeroing in on high-risk areas of code,\Nor Dialogue: 0,0:07:19.80,0:07:22.21,Default,,0000,0000,0000,,just plain to get oriented in a new code Dialogue: 0,0:07:22.21,0:07:25.48,Default,,0000,0000,0000,,base. There are a few specific patterns that\Nyou Dialogue: 0,0:07:25.48,0:07:27.20,Default,,0000,0000,0000,,can look for, and you'll find others as you, Dialogue: 0,0:07:27.20,0:07:28.80,Default,,0000,0000,0000,,as you do more of it. Dialogue: 0,0:07:28.80,0:07:31.96,Default,,0000,0000,0000,,Is the left margin ragged, as it is here? Dialogue: 0,0:07:31.96,0:07:34.14,Default,,0000,0000,0000,,Are there any ridiculously long lines? There's\None towards Dialogue: 0,0:07:34.14,0:07:37.64,Default,,0000,0000,0000,,the bottom. What does your syntax highlighting\Ntell you? Dialogue: 0,0:07:37.64,0:07:39.33,Default,,0000,0000,0000,,Are there groups of colors or are colors sort Dialogue: 0,0:07:39.33,0:07:43.82,Default,,0000,0000,0000,,of spread out? And there's a lot of information Dialogue: 0,0:07:43.82,0:07:47.76,Default,,0000,0000,0000,,you can glean from this. Incidentally, I have\Nonly Dialogue: 0,0:07:47.76,0:07:50.07,Default,,0000,0000,0000,,ever met one blind programmer, and we didn't\Nreally Dialogue: 0,0:07:50.07,0:07:52.06,Default,,0000,0000,0000,,talk about this stuff. If any of you have Dialogue: 0,0:07:52.06,0:07:55.61,Default,,0000,0000,0000,,found that a physical or a cognitive disability\Ngives Dialogue: 0,0:07:55.61,0:07:58.96,Default,,0000,0000,0000,,you a, an interesting way of looking at code, Dialogue: 0,0:07:58.96,0:08:01.84,Default,,0000,0000,0000,,or understanding code I suppose, please come\Ntalk to Dialogue: 0,0:08:01.84,0:08:05.71,Default,,0000,0000,0000,,me, because I'd love to hear your story. Dialogue: 0,0:08:05.71,0:08:07.62,Default,,0000,0000,0000,,Next up, I have a couple of techniques that Dialogue: 0,0:08:07.62,0:08:10.56,Default,,0000,0000,0000,,involve a clever use of language. The first\None Dialogue: 0,0:08:10.56,0:08:13.99,Default,,0000,0000,0000,,is deceptively simple, but it does require\Na prop. Dialogue: 0,0:08:13.99,0:08:18.47,Default,,0000,0000,0000,,Doesn't have to be that big. You can totally Dialogue: 0,0:08:18.47,0:08:20.42,Default,,0000,0000,0000,,get away with using the souvenir edition.\NThis is Dialogue: 0,0:08:20.42,0:08:24.72,Default,,0000,0000,0000,,my daughter's duck cow bath toy. What you\Ndo Dialogue: 0,0:08:24.72,0:08:26.71,Default,,0000,0000,0000,,is you keep a rubber duck on your desk. Dialogue: 0,0:08:26.71,0:08:28.21,Default,,0000,0000,0000,,When you get stuck, you put the rubber deck Dialogue: 0,0:08:28.21,0:08:30.84,Default,,0000,0000,0000,,on top- rubber duck, excuse me, on top of Dialogue: 0,0:08:30.84,0:08:33.35,Default,,0000,0000,0000,,your keyboard, and you explain your problem\Nout loud Dialogue: 0,0:08:33.35,0:08:34.43,Default,,0000,0000,0000,,to the duck. Dialogue: 0,0:08:34.43,0:08:35.33,Default,,0000,0000,0000,,[laughter] Dialogue: 0,0:08:35.33,0:08:39.58,Default,,0000,0000,0000,,Really. I mean, it sounds absurd, right. But\Nthere's Dialogue: 0,0:08:39.58,0:08:41.36,Default,,0000,0000,0000,,a good chance that in the process of putting Dialogue: 0,0:08:41.36,0:08:44.27,Default,,0000,0000,0000,,your problem into words, you'll discover that\Nthere's an Dialogue: 0,0:08:44.27,0:08:46.58,Default,,0000,0000,0000,,incorrect assumption that you've been making\Nor you'll think Dialogue: 0,0:08:46.58,0:08:48.49,Default,,0000,0000,0000,,of some other possible solution. Dialogue: 0,0:08:48.49,0:08:50.71,Default,,0000,0000,0000,,I've also heard of people using teddy bears\Nor Dialogue: 0,0:08:50.71,0:08:53.69,Default,,0000,0000,0000,,other stuffed animals. And one of my co-workers\Ntold Dialogue: 0,0:08:53.69,0:08:56.65,Default,,0000,0000,0000,,me that she learned this as the pet-rock technique. Dialogue: 0,0:08:56.65,0:08:58.93,Default,,0000,0000,0000,,This was a thing in the seventies. And also Dialogue: 0,0:08:58.93,0:09:00.87,Default,,0000,0000,0000,,that she finds it useful to compose an email Dialogue: 0,0:09:00.87,0:09:03.74,Default,,0000,0000,0000,,describing the problem. So for those of you\Nwho, Dialogue: 0,0:09:03.74,0:09:07.04,Default,,0000,0000,0000,,like me, think better when you're typing or\Nwriting Dialogue: 0,0:09:07.04,0:09:08.43,Default,,0000,0000,0000,,than when you're speaking, that can be a nice, Dialogue: 0,0:09:08.43,0:09:13.26,Default,,0000,0000,0000,,a nice alternative. Dialogue: 0,0:09:13.26,0:09:15.07,Default,,0000,0000,0000,,The other linguistic hack that I got, I got Dialogue: 0,0:09:15.07,0:09:18.64,Default,,0000,0000,0000,,from Sandi Metz, and in this book, Practical\NOriented Dialogue: 0,0:09:18.64,0:09:22.05,Default,,0000,0000,0000,,Design in Ruby, PODR for short, she describes\Na Dialogue: 0,0:09:22.05,0:09:25.10,Default,,0000,0000,0000,,technique that she uses to figure out which\Nobject Dialogue: 0,0:09:25.10,0:09:28.73,Default,,0000,0000,0000,,a method should belong. I tried paraphrasing\Nthis, but Dialogue: 0,0:09:28.73,0:09:30.73,Default,,0000,0000,0000,,honestly Sandi did a much better job than\NI Dialogue: 0,0:09:30.73,0:09:32.78,Default,,0000,0000,0000,,would, describing it, so I'm just gonna read\Nit Dialogue: 0,0:09:32.78,0:09:33.46,Default,,0000,0000,0000,,verbatim. Dialogue: 0,0:09:33.46,0:09:35.82,Default,,0000,0000,0000,,She says, How can you determine if a Gear Dialogue: 0,0:09:35.82,0:09:39.04,Default,,0000,0000,0000,,class contains behavior that belongs somewhere\Nelse? One way Dialogue: 0,0:09:39.04,0:09:41.17,Default,,0000,0000,0000,,is to pretend that it's sentient and to interrogate Dialogue: 0,0:09:41.17,0:09:43.77,Default,,0000,0000,0000,,it. If you rephrase every one of its methods Dialogue: 0,0:09:43.77,0:09:45.60,Default,,0000,0000,0000,,as a question, asking the question ought to\Nmake Dialogue: 0,0:09:45.60,0:09:47.10,Default,,0000,0000,0000,,sense. Dialogue: 0,0:09:47.10,0:09:49.31,Default,,0000,0000,0000,,For example, "Please Mr. Gear, what is your\Nratio?" Dialogue: 0,0:09:49.31,0:09:52.08,Default,,0000,0000,0000,,seems perfectly reasonable, while "Please\NMr. Gear, what are Dialogue: 0,0:09:52.08,0:09:54.45,Default,,0000,0000,0000,,your gear_inches?" is on shaky ground, and\N"Please Mr. Dialogue: 0,0:09:54.45,0:09:59.89,Default,,0000,0000,0000,,Gear, what is your tire(size)?" is just downright\Nridiculous. Dialogue: 0,0:09:59.89,0:10:01.81,Default,,0000,0000,0000,,This is a great way to evaluate objects in Dialogue: 0,0:10:01.81,0:10:04.35,Default,,0000,0000,0000,,light of the single responsibility principle.\NNow I'll come Dialogue: 0,0:10:04.35,0:10:07.24,Default,,0000,0000,0000,,back to that thought in just a minute, but Dialogue: 0,0:10:07.24,0:10:10.24,Default,,0000,0000,0000,,first, I described the rubber duck and Please,\NMr. Dialogue: 0,0:10:10.24,0:10:13.58,Default,,0000,0000,0000,,Gear? as techniques to engage linguistic reasoning,\Nbut that Dialogue: 0,0:10:13.58,0:10:17.27,Default,,0000,0000,0000,,doesn't quite feel right. Both of these techniques\Nforce Dialogue: 0,0:10:17.27,0:10:20.44,Default,,0000,0000,0000,,us to put our questions into words, but words Dialogue: 0,0:10:20.44,0:10:23.19,Default,,0000,0000,0000,,themselves are tools. We use words to communicate\Nour Dialogue: 0,0:10:23.19,0:10:25.75,Default,,0000,0000,0000,,ideas to other people. Dialogue: 0,0:10:25.75,0:10:28.62,Default,,0000,0000,0000,,As primates, we've evolved a set of social\Nskills Dialogue: 0,0:10:28.62,0:10:30.97,Default,,0000,0000,0000,,and behaviors for getting our needs met as\Npart Dialogue: 0,0:10:30.97,0:10:34.62,Default,,0000,0000,0000,,of a community. So, while these techniques\Ndo involve Dialogue: 0,0:10:34.62,0:10:36.87,Default,,0000,0000,0000,,using language centers of your brain, I think\Nthey Dialogue: 0,0:10:36.87,0:10:39.99,Default,,0000,0000,0000,,reach beyond those centers to tap into our\Nsocial Dialogue: 0,0:10:39.99,0:10:41.71,Default,,0000,0000,0000,,reasoning. Dialogue: 0,0:10:41.71,0:10:44.50,Default,,0000,0000,0000,,The rubber duck technique works because, putting\Nyour problem Dialogue: 0,0:10:44.50,0:10:47.31,Default,,0000,0000,0000,,into words forces you to organize your understanding\Nof Dialogue: 0,0:10:47.31,0:10:49.23,Default,,0000,0000,0000,,a problem in such a way that you can Dialogue: 0,0:10:49.23,0:10:53.53,Default,,0000,0000,0000,,verbally lead another mind through it. And\NPlease, Mr. Dialogue: 0,0:10:53.53,0:10:56.42,Default,,0000,0000,0000,,Gear? let's us anthropomorphize an object\Nand talk to Dialogue: 0,0:10:56.42,0:10:58.72,Default,,0000,0000,0000,,it to discover whether it conforms to the\Nsingle Dialogue: 0,0:10:58.72,0:11:00.91,Default,,0000,0000,0000,,responsibility principle. Dialogue: 0,0:11:00.91,0:11:03.55,Default,,0000,0000,0000,,To me, the tell-tale phrase in Sandi's description\Nof Dialogue: 0,0:11:03.55,0:11:06.46,Default,,0000,0000,0000,,this technique is, asking the question ought\Nto make Dialogue: 0,0:11:06.46,0:11:13.46,Default,,0000,0000,0000,,sense. Most of us have an intuitive understanding\Nthat Dialogue: 0,0:11:13.81,0:11:16.41,Default,,0000,0000,0000,,it might not be appropriate to ask Alice about Dialogue: 0,0:11:16.41,0:11:20.35,Default,,0000,0000,0000,,something that is Bob's responsibility. Interrogating\Nan object as Dialogue: 0,0:11:20.35,0:11:22.42,Default,,0000,0000,0000,,though it were a person helps us use that Dialogue: 0,0:11:22.42,0:11:25.24,Default,,0000,0000,0000,,social knowledge, and it gives us an opportunity\Nto Dialogue: 0,0:11:25.24,0:11:28.12,Default,,0000,0000,0000,,notice that a particular question doesn't\Nmake sense to Dialogue: 0,0:11:28.12,0:11:31.01,Default,,0000,0000,0000,,ask any of our existing objects, which might\Nprompt Dialogue: 0,0:11:31.01,0:11:32.30,Default,,0000,0000,0000,,us to ask if we should create a new Dialogue: 0,0:11:32.30,0:11:35.02,Default,,0000,0000,0000,,object to fill that role instead. Dialogue: 0,0:11:35.02,0:11:39.61,Default,,0000,0000,0000,,Now, personally, I would have considered PODR\Nto have Dialogue: 0,0:11:39.61,0:11:41.68,Default,,0000,0000,0000,,been a worthwhile purchase if Please, Mr.\NGear was Dialogue: 0,0:11:41.68,0:11:44.09,Default,,0000,0000,0000,,the only thing I got from it. But, in Dialogue: 0,0:11:44.09,0:11:45.65,Default,,0000,0000,0000,,this book, Sandi also made what I thought\Nwas Dialogue: 0,0:11:45.65,0:11:49.21,Default,,0000,0000,0000,,a very compelling case for UML Sequence Diagrams. Dialogue: 0,0:11:49.21,0:11:53.11,Default,,0000,0000,0000,,Where Please, Mr. Gear is a good tool for Dialogue: 0,0:11:53.11,0:11:56.33,Default,,0000,0000,0000,,discovering which objects should be responsible\Nfor a particular Dialogue: 0,0:11:56.33,0:11:59.10,Default,,0000,0000,0000,,method, a Sequence Diagram can help you analyze\Nthe Dialogue: 0,0:11:59.10,0:12:04.02,Default,,0000,0000,0000,,runtime interaction between several different\Nobjects. At first glance, Dialogue: 0,0:12:04.02,0:12:05.93,Default,,0000,0000,0000,,this looks kind of like something in the boxes Dialogue: 0,0:12:05.93,0:12:08.50,Default,,0000,0000,0000,,and arrows category of visual and spatial\Ntools, but Dialogue: 0,0:12:08.50,0:12:10.43,Default,,0000,0000,0000,,again, this feels more like it's tapping into\Nthat Dialogue: 0,0:12:10.43,0:12:12.96,Default,,0000,0000,0000,,social understanding that we have. This can\Nbe a Dialogue: 0,0:12:12.96,0:12:14.34,Default,,0000,0000,0000,,good way to get a sense for when an Dialogue: 0,0:12:14.34,0:12:18.09,Default,,0000,0000,0000,,object is bossy or when performing a task\Ninvolves Dialogue: 0,0:12:18.09,0:12:22.31,Default,,0000,0000,0000,,a complex sequence of several, several interactions.\NOr if Dialogue: 0,0:12:22.31,0:12:25.01,Default,,0000,0000,0000,,there are just plain too many different things\Nto Dialogue: 0,0:12:25.01,0:12:27.32,Default,,0000,0000,0000,,keep track of. Dialogue: 0,0:12:27.32,0:12:29.10,Default,,0000,0000,0000,,Rather than turn this into a lecture on UML, Dialogue: 0,0:12:29.10,0:12:30.91,Default,,0000,0000,0000,,I'm just gonna tell you to go buy Sandi's Dialogue: 0,0:12:30.91,0:12:33.78,Default,,0000,0000,0000,,book, and if for whatever reason, you cannot\Nafford Dialogue: 0,0:12:33.78,0:12:35.22,Default,,0000,0000,0000,,it, come talk to me later and we'll work Dialogue: 0,0:12:35.22,0:12:36.33,Default,,0000,0000,0000,,something out. Dialogue: 0,0:12:36.33,0:12:41.39,Default,,0000,0000,0000,,Now for the really hand-wavy stuff. Metaphors\Ncan be Dialogue: 0,0:12:41.39,0:12:45.07,Default,,0000,0000,0000,,a really useful tool in software. The turtle\Ngraphic Dialogue: 0,0:12:45.07,0:12:47.40,Default,,0000,0000,0000,,system in Logo is a great metaphor. Has anybody Dialogue: 0,0:12:47.40,0:12:50.51,Default,,0000,0000,0000,,used Logo at any point in their life? About Dialogue: 0,0:12:50.51,0:12:52.85,Default,,0000,0000,0000,,half the people. That's really cool. Dialogue: 0,0:12:52.85,0:12:55.27,Default,,0000,0000,0000,,We've probably all played with drawing something\Non the Dialogue: 0,0:12:55.27,0:12:57.68,Default,,0000,0000,0000,,screen at some point, but most of the rendering Dialogue: 0,0:12:57.68,0:13:00.07,Default,,0000,0000,0000,,systems that I've used are based on a Cartesian Dialogue: 0,0:13:00.07,0:13:04.91,Default,,0000,0000,0000,,coordinate system, a grid. And this metaphor\Nencourages the Dialogue: 0,0:13:04.91,0:13:07.57,Default,,0000,0000,0000,,programmer to imagine themselves as the turtle,\Nand to Dialogue: 0,0:13:07.57,0:13:09.45,Default,,0000,0000,0000,,use that understanding to figure out, when\Nthey get Dialogue: 0,0:13:09.45,0:13:11.67,Default,,0000,0000,0000,,stuck, what they should be doing next. Dialogue: 0,0:13:11.67,0:13:14.37,Default,,0000,0000,0000,,One of the original creators of Logo called\Nthis Dialogue: 0,0:13:14.37,0:13:17.92,Default,,0000,0000,0000,,Body Syntonic Reasoning, and specifically\Ndeveloped it to help Dialogue: 0,0:13:17.92,0:13:21.53,Default,,0000,0000,0000,,children solve problems. But the turtle metaphor,\Nthe turtle Dialogue: 0,0:13:21.53,0:13:24.48,Default,,0000,0000,0000,,metaphor works for everybody, not just for\Nkids. Dialogue: 0,0:13:24.48,0:13:31.48,Default,,0000,0000,0000,,Cartesian grids are great for drawing boxes.\NMostly great. Dialogue: 0,0:13:31.77,0:13:33.49,Default,,0000,0000,0000,,But it can take some very careful thinking\Nto Dialogue: 0,0:13:33.49,0:13:36.53,Default,,0000,0000,0000,,figure out how to, how to use x, y Dialogue: 0,0:13:36.53,0:13:41.24,Default,,0000,0000,0000,,coordinate pairs to draw a spiral or a star Dialogue: 0,0:13:41.24,0:13:44.86,Default,,0000,0000,0000,,or a snowflake or a tree. Choosing a different Dialogue: 0,0:13:44.86,0:13:47.74,Default,,0000,0000,0000,,metaphor can make different kinds of solutions\Neasy, where Dialogue: 0,0:13:47.74,0:13:49.32,Default,,0000,0000,0000,,before they seemed like too much trouble to\Nbe Dialogue: 0,0:13:49.32,0:13:51.14,Default,,0000,0000,0000,,worth bothering with. Dialogue: 0,0:13:51.14,0:13:58.14,Default,,0000,0000,0000,,James Ladd, in 2008, wrote a couple of interesting Dialogue: 0,0:13:58.82,0:14:03.61,Default,,0000,0000,0000,,blog posts about what he called East-oriented\Ncode. Imagine Dialogue: 0,0:14:03.61,0:14:07.42,Default,,0000,0000,0000,,a compass overlaid on top of your screen.\NIn Dialogue: 0,0:14:07.42,0:14:10.07,Default,,0000,0000,0000,,this, in this model, messages that an object\Nsends Dialogue: 0,0:14:10.07,0:14:13.32,Default,,0000,0000,0000,,to itself go South, and any data returned\Nfrom Dialogue: 0,0:14:13.32,0:14:17.42,Default,,0000,0000,0000,,those calls goes North. Communications between\Nobjects is the Dialogue: 0,0:14:17.42,0:14:20.36,Default,,0000,0000,0000,,same thing, rotated ninety degrees. Messages\Nsent to other Dialogue: 0,0:14:20.36,0:14:22.88,Default,,0000,0000,0000,,objects go East, and the return values from\Nthose Dialogue: 0,0:14:22.88,0:14:26.92,Default,,0000,0000,0000,,messages flow West. Dialogue: 0,0:14:26.92,0:14:29.76,Default,,0000,0000,0000,,What James Ladd suggests is that, in general,\Ncode Dialogue: 0,0:14:29.76,0:14:32.97,Default,,0000,0000,0000,,that sends messages to other objects, code\Nwhere information Dialogue: 0,0:14:32.97,0:14:36.29,Default,,0000,0000,0000,,mostly flows East, is easier to extend and\Nmaintain Dialogue: 0,0:14:36.29,0:14:38.25,Default,,0000,0000,0000,,than code that looks at data and then decides Dialogue: 0,0:14:38.25,0:14:40.27,Default,,0000,0000,0000,,what to do with it, which is code where Dialogue: 0,0:14:40.27,0:14:42.10,Default,,0000,0000,0000,,information flows West. Dialogue: 0,0:14:42.10,0:14:45.42,Default,,0000,0000,0000,,Really, this is just the design principle,\Ntell, don't Dialogue: 0,0:14:45.42,0:14:49.30,Default,,0000,0000,0000,,ask. But, the metaphor of the compass, compass\Nrecasts Dialogue: 0,0:14:49.30,0:14:51.84,Default,,0000,0000,0000,,this in a way that helps us use our Dialogue: 0,0:14:51.84,0:14:55.17,Default,,0000,0000,0000,,background spatial awareness to keep this\Nprinciple in mind Dialogue: 0,0:14:55.17,0:14:58.91,Default,,0000,0000,0000,,at all times. In fact, there are plenty of Dialogue: 0,0:14:58.91,0:15:01.63,Default,,0000,0000,0000,,ways we can use our background level awareness\Nto Dialogue: 0,0:15:01.63,0:15:03.14,Default,,0000,0000,0000,,analyze our code. Dialogue: 0,0:15:03.14,0:15:08.64,Default,,0000,0000,0000,,Isn't this adorable? I love this picture. Dialogue: 0,0:15:08.64,0:15:11.22,Default,,0000,0000,0000,,Code smells are an entire category of metaphors\Nthat Dialogue: 0,0:15:11.22,0:15:13.78,Default,,0000,0000,0000,,we use to talk about our work. In fact, Dialogue: 0,0:15:13.78,0:15:16.96,Default,,0000,0000,0000,,the name code smell itself is a metaphor for Dialogue: 0,0:15:16.96,0:15:19.64,Default,,0000,0000,0000,,anything about your code that hints at a design Dialogue: 0,0:15:19.64,0:15:25.39,Default,,0000,0000,0000,,problem, which I suppose makes it a meta-metaphor. Dialogue: 0,0:15:25.39,0:15:29.23,Default,,0000,0000,0000,,Some code smells have names are extremely\Nliteral. Duplicated Dialogue: 0,0:15:29.23,0:15:30.56,Default,,0000,0000,0000,,code, long method and so on. But some of Dialogue: 0,0:15:30.56,0:15:36.05,Default,,0000,0000,0000,,these are delightfully suggestive. Feature\Nenvy. Refused bequest. Primitive Dialogue: 0,0:15:36.05,0:15:39.15,Default,,0000,0000,0000,,obsession. To me, the names on the right have Dialogue: 0,0:15:39.15,0:15:41.77,Default,,0000,0000,0000,,a lot in common with Please, Mr. Gear. They're Dialogue: 0,0:15:41.77,0:15:44.73,Default,,0000,0000,0000,,chosen to hook into something in our social\Nawareness Dialogue: 0,0:15:44.73,0:15:47.74,Default,,0000,0000,0000,,to give a name to a pattern of dysfunction, Dialogue: 0,0:15:47.74,0:15:50.32,Default,,0000,0000,0000,,and by naming the problems it suggests a possible Dialogue: 0,0:15:50.32,0:15:51.72,Default,,0000,0000,0000,,solution. Dialogue: 0,0:15:51.72,0:15:54.73,Default,,0000,0000,0000,,So, these are most of the shortcuts that I've Dialogue: 0,0:15:54.73,0:15:57.40,Default,,0000,0000,0000,,accumulated over the years, and I hope that\Nthis Dialogue: 0,0:15:57.40,0:15:59.20,Default,,0000,0000,0000,,can be the start of a similar collection for Dialogue: 0,0:15:59.20,0:16:04.48,Default,,0000,0000,0000,,some of you. Dialogue: 0,0:16:04.48,0:16:05.36,Default,,0000,0000,0000,,Now the part where I try to put the Dialogue: 0,0:16:05.36,0:16:09.63,Default,,0000,0000,0000,,fear into you. Evolution has designed our\Nbrains to Dialogue: 0,0:16:09.63,0:16:13.53,Default,,0000,0000,0000,,lie to us. Brains are expensive. The human\Nbrain Dialogue: 0,0:16:13.53,0:16:16.13,Default,,0000,0000,0000,,accounts for just two percent of body mass,\Nbut Dialogue: 0,0:16:16.13,0:16:19.33,Default,,0000,0000,0000,,twenty percent of our caloric intake. That's\Na huge Dialogue: 0,0:16:19.33,0:16:22.88,Default,,0000,0000,0000,,energy requirement that has to be justified. Dialogue: 0,0:16:22.88,0:16:25.95,Default,,0000,0000,0000,,Evolution, as a designer, does one thing and\None Dialogue: 0,0:16:25.95,0:16:29.56,Default,,0000,0000,0000,,thing only. It selects for traits that allow\Nan Dialogue: 0,0:16:29.56,0:16:32.45,Default,,0000,0000,0000,,organism to stay alive long enough to reproduce.\NIt Dialogue: 0,0:16:32.45,0:16:34.90,Default,,0000,0000,0000,,doesn't care about getting the best solution.\NOnly one Dialogue: 0,0:16:34.90,0:16:38.03,Default,,0000,0000,0000,,that's good enough to compete in the current\Nlandscape. Dialogue: 0,0:16:38.03,0:16:40.26,Default,,0000,0000,0000,,Evolution will tolerate any hack as long as\Nit Dialogue: 0,0:16:40.26,0:16:42.65,Default,,0000,0000,0000,,meets that one goal. Dialogue: 0,0:16:42.65,0:16:44.25,Default,,0000,0000,0000,,As an example, I want to take a minute Dialogue: 0,0:16:44.25,0:16:46.27,Default,,0000,0000,0000,,to talk about how we see the world around Dialogue: 0,0:16:46.27,0:16:50.06,Default,,0000,0000,0000,,us. The human eye has two different kinds\Nof Dialogue: 0,0:16:50.06,0:16:52.39,Default,,0000,0000,0000,,photo receptors. There are about a hundred\Nand twenty Dialogue: 0,0:16:52.39,0:16:55.28,Default,,0000,0000,0000,,million rod cells in each eye. These play\Nlittle Dialogue: 0,0:16:55.28,0:16:57.73,Default,,0000,0000,0000,,or no role in color vision, and they're mostly Dialogue: 0,0:16:57.73,0:16:59.81,Default,,0000,0000,0000,,used for night time and peripheral vision. Dialogue: 0,0:16:59.81,0:17:02.02,Default,,0000,0000,0000,,There are also about six or seven million\Ncone Dialogue: 0,0:17:02.02,0:17:04.50,Default,,0000,0000,0000,,cells in each eye, and these give us color Dialogue: 0,0:17:04.50,0:17:05.94,Default,,0000,0000,0000,,vision, but they require a lot more light\Nto Dialogue: 0,0:17:05.94,0:17:09.87,Default,,0000,0000,0000,,work. And the vast majority of cone cells\Nare Dialogue: 0,0:17:09.87,0:17:11.89,Default,,0000,0000,0000,,packed together in a tight little cluster\Nnear the Dialogue: 0,0:17:11.89,0:17:13.90,Default,,0000,0000,0000,,center of the retina. This area is what we Dialogue: 0,0:17:13.90,0:17:15.97,Default,,0000,0000,0000,,use to focus on individual details, and it's\Nsmaller Dialogue: 0,0:17:15.97,0:17:20.64,Default,,0000,0000,0000,,than you might think. It's only fifteen degrees\Nwide. Dialogue: 0,0:17:20.64,0:17:23.66,Default,,0000,0000,0000,,As a result, our vision is extremely directional.\NWe Dialogue: 0,0:17:23.66,0:17:25.52,Default,,0000,0000,0000,,have a very small area of high detail and Dialogue: 0,0:17:25.52,0:17:27.43,Default,,0000,0000,0000,,high color, and the rest of our field of Dialogue: 0,0:17:27.43,0:17:31.14,Default,,0000,0000,0000,,vision is more or less monochrome. So when\Nwe Dialogue: 0,0:17:31.14,0:17:38.14,Default,,0000,0000,0000,,look at this, our eyes see something like\Nthis. Dialogue: 0,0:17:40.39,0:17:42.58,Default,,0000,0000,0000,,In order to turn the image on the left Dialogue: 0,0:17:42.58,0:17:44.92,Default,,0000,0000,0000,,into the image on the right, our brains are Dialogue: 0,0:17:44.92,0:17:46.96,Default,,0000,0000,0000,,doing a lot of work that we're mostly unaware Dialogue: 0,0:17:46.96,0:17:49.28,Default,,0000,0000,0000,,of. Dialogue: 0,0:17:49.28,0:17:51.40,Default,,0000,0000,0000,,We compensate for having such highly directional\Nvision by Dialogue: 0,0:17:51.40,0:17:54.50,Default,,0000,0000,0000,,moving our eyes around a lot. Our brains combine Dialogue: 0,0:17:54.50,0:17:57.05,Default,,0000,0000,0000,,the details from these individual points of\Ninterest to Dialogue: 0,0:17:57.05,0:17:59.71,Default,,0000,0000,0000,,construct a persistent mental model of whatever\Nwe're looking Dialogue: 0,0:17:59.71,0:18:03.40,Default,,0000,0000,0000,,at. These fast point to point movements are\Ncalled Dialogue: 0,0:18:03.40,0:18:06.23,Default,,0000,0000,0000,,saccades. And they're actually the fastest\Nmovements that the Dialogue: 0,0:18:06.23,0:18:09.23,Default,,0000,0000,0000,,human body can make. The shorter saccades\Nthat you Dialogue: 0,0:18:09.23,0:18:11.02,Default,,0000,0000,0000,,make, might make when you're reading, last\Nfor twenty Dialogue: 0,0:18:11.02,0:18:13.96,Default,,0000,0000,0000,,to forty milliseconds. Longer ones that travel\Nthrough a Dialogue: 0,0:18:13.96,0:18:16.61,Default,,0000,0000,0000,,wider arc might take two hundred milliseconds,\Nor about Dialogue: 0,0:18:16.61,0:18:18.52,Default,,0000,0000,0000,,a fifth of a second. Dialogue: 0,0:18:18.52,0:18:20.99,Default,,0000,0000,0000,,What I find so fascinating about this is that Dialogue: 0,0:18:20.99,0:18:25.03,Default,,0000,0000,0000,,we don't perceive saccades. During a saccade,\Nthe eye Dialogue: 0,0:18:25.03,0:18:27.46,Default,,0000,0000,0000,,is still sending data to the brain, but what Dialogue: 0,0:18:27.46,0:18:29.01,Default,,0000,0000,0000,,it's sending is a smeary blur. So the brain Dialogue: 0,0:18:29.01,0:18:32.68,Default,,0000,0000,0000,,just edits that part out. This process is\Ncalled Dialogue: 0,0:18:32.68,0:18:35.97,Default,,0000,0000,0000,,saccadic masking. You can see this effect\Nfor yourself. Dialogue: 0,0:18:35.97,0:18:37.88,Default,,0000,0000,0000,,Next time you're in front of a mirror, lean Dialogue: 0,0:18:37.88,0:18:40.47,Default,,0000,0000,0000,,in close and look back and forth from the Dialogue: 0,0:18:40.47,0:18:43.07,Default,,0000,0000,0000,,reflection of one eye to the other. You won't Dialogue: 0,0:18:43.07,0:18:45.52,Default,,0000,0000,0000,,see your eyes move. As far as we can Dialogue: 0,0:18:45.52,0:18:48.11,Default,,0000,0000,0000,,tell, our gaze just jumps instantaneously\Nfrom one reference Dialogue: 0,0:18:48.11,0:18:50.22,Default,,0000,0000,0000,,point to the next. And here's where I have Dialogue: 0,0:18:50.22,0:18:51.99,Default,,0000,0000,0000,,to wait for a moment while everybody stops\Ndoing Dialogue: 0,0:18:51.99,0:18:56.90,Default,,0000,0000,0000,,this. Dialogue: 0,0:18:56.90,0:18:58.94,Default,,0000,0000,0000,,When I was preparing for this talk, I found Dialogue: 0,0:18:58.94,0:19:01.94,Default,,0000,0000,0000,,an absolutely wonderful sentence in the Wikipedia\Nentry on Dialogue: 0,0:19:01.94,0:19:06.10,Default,,0000,0000,0000,,saccades. It said, Due to saccadic masking,\Nthe eye/brain Dialogue: 0,0:19:06.10,0:19:07.81,Default,,0000,0000,0000,,system not only hides the eye movements from\Nthe Dialogue: 0,0:19:07.81,0:19:10.13,Default,,0000,0000,0000,,individual, but also hides the evidence that\Nanything has Dialogue: 0,0:19:10.13,0:19:12.16,Default,,0000,0000,0000,,been hidden. Dialogue: 0,0:19:12.16,0:19:17.89,Default,,0000,0000,0000,,Hides. The evidence. That anything has been\Nhidden. Our Dialogue: 0,0:19:17.89,0:19:20.10,Default,,0000,0000,0000,,brains lie to us. And they lie to us Dialogue: 0,0:19:20.10,0:19:22.61,Default,,0000,0000,0000,,about having lied to us. And this happens\Nto Dialogue: 0,0:19:22.61,0:19:26.39,Default,,0000,0000,0000,,you multiple times a second, every waking\Nhour, every Dialogue: 0,0:19:26.39,0:19:29.06,Default,,0000,0000,0000,,day of your life. Of course, there's a reason Dialogue: 0,0:19:29.06,0:19:30.39,Default,,0000,0000,0000,,for this. Dialogue: 0,0:19:30.39,0:19:32.24,Default,,0000,0000,0000,,Imagine if, every time you shifted your gaze\Naround, Dialogue: 0,0:19:32.24,0:19:34.20,Default,,0000,0000,0000,,you got distracted by all the pretty colors.\NYou Dialogue: 0,0:19:34.20,0:19:36.33,Default,,0000,0000,0000,,would be eaten by lions. Dialogue: 0,0:19:36.33,0:19:40.32,Default,,0000,0000,0000,,But, in selecting for this design, evolution\Nmade a Dialogue: 0,0:19:40.32,0:19:42.68,Default,,0000,0000,0000,,trade off. The trade off is that we are Dialogue: 0,0:19:42.68,0:19:45.57,Default,,0000,0000,0000,,effectively blind every time we move our eyes\Naround. Dialogue: 0,0:19:45.57,0:19:48.33,Default,,0000,0000,0000,,Sometimes for up to a fifth of a second. Dialogue: 0,0:19:48.33,0:19:51.05,Default,,0000,0000,0000,,And I wanted to talk about this, partly because Dialogue: 0,0:19:51.05,0:19:53.43,Default,,0000,0000,0000,,it's a really fun subject, but also to show Dialogue: 0,0:19:53.43,0:19:55.76,Default,,0000,0000,0000,,that just one of the ways that our brains Dialogue: 0,0:19:55.76,0:19:58.50,Default,,0000,0000,0000,,are doing a massive amount of work to process Dialogue: 0,0:19:58.50,0:20:01.25,Default,,0000,0000,0000,,information from our environment and present\Nus with an Dialogue: 0,0:20:01.25,0:20:03.43,Default,,0000,0000,0000,,abstraction. Dialogue: 0,0:20:03.43,0:20:05.98,Default,,0000,0000,0000,,And as programmers, if we know anything about\Nabstractions, Dialogue: 0,0:20:05.98,0:20:09.24,Default,,0000,0000,0000,,it's that they're hard to get right. Which\Nleads Dialogue: 0,0:20:09.24,0:20:11.86,Default,,0000,0000,0000,,me to an interesting question. Does it make\Nsense Dialogue: 0,0:20:11.86,0:20:13.44,Default,,0000,0000,0000,,to use any of the techniques that I talked Dialogue: 0,0:20:13.44,0:20:15.90,Default,,0000,0000,0000,,about in part one, to try to coral different Dialogue: 0,0:20:15.90,0:20:17.69,Default,,0000,0000,0000,,parts of our brains into doing our work for Dialogue: 0,0:20:17.69,0:20:19.69,Default,,0000,0000,0000,,us, if we don't know what kinds of shortcuts Dialogue: 0,0:20:19.69,0:20:26.65,Default,,0000,0000,0000,,they're gonna take? Dialogue: 0,0:20:26.65,0:20:30.51,Default,,0000,0000,0000,,According to the Oxford English Dictionary,\Nthe word bias Dialogue: 0,0:20:30.51,0:20:32.58,Default,,0000,0000,0000,,seems to have entered the English language\Naround the Dialogue: 0,0:20:32.58,0:20:35.77,Default,,0000,0000,0000,,1520s. It was used as a, a technical term Dialogue: 0,0:20:35.77,0:20:38.60,Default,,0000,0000,0000,,in the game of lawn bowling, and it referred Dialogue: 0,0:20:38.60,0:20:40.23,Default,,0000,0000,0000,,to a ball that was constructed in such a Dialogue: 0,0:20:40.23,0:20:42.65,Default,,0000,0000,0000,,way that it would curve, it would roll in Dialogue: 0,0:20:42.65,0:20:44.64,Default,,0000,0000,0000,,a curved path instead of in a straight line. Dialogue: 0,0:20:44.64,0:20:47.15,Default,,0000,0000,0000,,And since then, it's picked up a few additional Dialogue: 0,0:20:47.15,0:20:49.58,Default,,0000,0000,0000,,meanings, but they all have that same different\Nconnotation Dialogue: 0,0:20:49.58,0:20:54.44,Default,,0000,0000,0000,,of something that's skewed or off a little\Nbit. Dialogue: 0,0:20:54.44,0:20:57.26,Default,,0000,0000,0000,,Cognitive bias is a term for systematic errors\Nin Dialogue: 0,0:20:57.26,0:20:59.49,Default,,0000,0000,0000,,thinking. These are patterns of thought that\Ndiverge in Dialogue: 0,0:20:59.49,0:21:02.86,Default,,0000,0000,0000,,measurable and predictable ways from what\Nthe answers that Dialogue: 0,0:21:02.86,0:21:07.07,Default,,0000,0000,0000,,pure rationality might give are. We have some\Nfree Dialogue: 0,0:21:07.07,0:21:09.10,Default,,0000,0000,0000,,time. I suggest that you go have a look Dialogue: 0,0:21:09.10,0:21:11.81,Default,,0000,0000,0000,,at the Wikipedia page called List of cognitive\Nbiases. Dialogue: 0,0:21:11.81,0:21:13.89,Default,,0000,0000,0000,,There are over a hundred and fifty of them Dialogue: 0,0:21:13.89,0:21:16.61,Default,,0000,0000,0000,,and they are fascinating reading. Dialogue: 0,0:21:16.61,0:21:18.95,Default,,0000,0000,0000,,And this list of cognitive biases has a lot Dialogue: 0,0:21:18.95,0:21:20.67,Default,,0000,0000,0000,,in common with the list of code smells that Dialogue: 0,0:21:20.67,0:21:22.74,Default,,0000,0000,0000,,I showed earlier. A lot of these names are Dialogue: 0,0:21:22.74,0:21:25.16,Default,,0000,0000,0000,,very literal. But there are a few that stand Dialogue: 0,0:21:25.16,0:21:28.64,Default,,0000,0000,0000,,out, like cursive knowledge, or the Google\Neffect or, Dialogue: 0,0:21:28.64,0:21:32.68,Default,,0000,0000,0000,,and I kid you not, the Ikea effect. But Dialogue: 0,0:21:32.68,0:21:34.49,Default,,0000,0000,0000,,the parallel goes deeper than that. Dialogue: 0,0:21:34.49,0:21:37.85,Default,,0000,0000,0000,,This lif - excuse me - this list gives Dialogue: 0,0:21:37.85,0:21:40.64,Default,,0000,0000,0000,,names to patterns of dysfunction, and once\Nyou have Dialogue: 0,0:21:40.64,0:21:41.95,Default,,0000,0000,0000,,a name for a thing, it's a lot easier Dialogue: 0,0:21:41.95,0:21:43.51,Default,,0000,0000,0000,,to recognize it and figure out what to do Dialogue: 0,0:21:43.51,0:21:46.33,Default,,0000,0000,0000,,about it. I do want to call your attention Dialogue: 0,0:21:46.33,0:21:48.28,Default,,0000,0000,0000,,to one particular item on this list. It's\Ncalled Dialogue: 0,0:21:48.28,0:21:51.92,Default,,0000,0000,0000,,the bias blind spot. This is the tendency\Nto Dialogue: 0,0:21:51.92,0:21:54.99,Default,,0000,0000,0000,,see oneself as less biased than other people,\Nor Dialogue: 0,0:21:54.99,0:21:57.15,Default,,0000,0000,0000,,to be able to identify more cognitive biases\Nin Dialogue: 0,0:21:57.15,0:22:04.15,Default,,0000,0000,0000,,others than in oneself. Sound like anybody\Nyou know? Dialogue: 0,0:22:10.82,0:22:17.82,Default,,0000,0000,0000,,Just let that sink in for a minute. Seriously, Dialogue: 0,0:22:24.35,0:22:25.73,Default,,0000,0000,0000,,though. Dialogue: 0,0:22:25.73,0:22:27.63,Default,,0000,0000,0000,,In our field, we like to think of ourselves Dialogue: 0,0:22:27.63,0:22:30.24,Default,,0000,0000,0000,,as more rational than the average person,\Nand it Dialogue: 0,0:22:30.24,0:22:33.94,Default,,0000,0000,0000,,just isn't true. Yes, as programmers, we have\Na Dialogue: 0,0:22:33.94,0:22:37.25,Default,,0000,0000,0000,,valuable, marketable skill that depends on\Nour ability to Dialogue: 0,0:22:37.25,0:22:40.13,Default,,0000,0000,0000,,reason mathematically. But we do ourselves\Nand others a Dialogue: 0,0:22:40.13,0:22:42.28,Default,,0000,0000,0000,,disservice if we allow ourselves to believe\Nthat being Dialogue: 0,0:22:42.28,0:22:45.26,Default,,0000,0000,0000,,good at programming means anything other than,\Nwe're good Dialogue: 0,0:22:45.26,0:22:48.57,Default,,0000,0000,0000,,at programming. Because as humans we are all\Nbiased. Dialogue: 0,0:22:48.57,0:22:51.22,Default,,0000,0000,0000,,It's built into us, in our DNA. And pretending Dialogue: 0,0:22:51.22,0:22:53.63,Default,,0000,0000,0000,,that we aren't biased only allows our biases\Nto Dialogue: 0,0:22:53.63,0:22:54.78,Default,,0000,0000,0000,,run free. Dialogue: 0,0:22:54.78,0:22:57.50,Default,,0000,0000,0000,,I don't have a lot of general advice for Dialogue: 0,0:22:57.50,0:22:59.64,Default,,0000,0000,0000,,how to look for bias, but I think an Dialogue: 0,0:22:59.64,0:23:02.83,Default,,0000,0000,0000,,obvious and necessary first step is just to\Nask Dialogue: 0,0:23:02.83,0:23:07.51,Default,,0000,0000,0000,,the question, how is this biased? Beyond that,\NI Dialogue: 0,0:23:07.51,0:23:09.52,Default,,0000,0000,0000,,suggest that you learn about as many specific\Ncognitive Dialogue: 0,0:23:09.52,0:23:11.23,Default,,0000,0000,0000,,biases as you can so that your brain can Dialogue: 0,0:23:11.23,0:23:13.01,Default,,0000,0000,0000,,do what it does, which is to look for Dialogue: 0,0:23:13.01,0:23:17.09,Default,,0000,0000,0000,,patterns and make associations and classify\Nthings. Dialogue: 0,0:23:17.09,0:23:19.19,Default,,0000,0000,0000,,I think everybody should understand their\Nown biases, because Dialogue: 0,0:23:19.19,0:23:21.61,Default,,0000,0000,0000,,only by knowing how you're biased can you\Nthen Dialogue: 0,0:23:21.61,0:23:23.91,Default,,0000,0000,0000,,decide how to con- how to correct for that Dialogue: 0,0:23:23.91,0:23:26.61,Default,,0000,0000,0000,,bias in the decisions that you make. If you're Dialogue: 0,0:23:26.61,0:23:28.63,Default,,0000,0000,0000,,not checking your work for bias, you can look Dialogue: 0,0:23:28.63,0:23:30.63,Default,,0000,0000,0000,,right past a great solution and you'll never\Nknow Dialogue: 0,0:23:30.63,0:23:32.20,Default,,0000,0000,0000,,it was there. Dialogue: 0,0:23:32.20,0:23:35.34,Default,,0000,0000,0000,,So for part three of my talk, I have Dialogue: 0,0:23:35.34,0:23:37.86,Default,,0000,0000,0000,,an example of a solution that is simple, elegant, Dialogue: 0,0:23:37.86,0:23:41.46,Default,,0000,0000,0000,,just about the last thing I ever would have Dialogue: 0,0:23:41.46,0:23:44.69,Default,,0000,0000,0000,,thought of. Dialogue: 0,0:23:44.69,0:23:45.85,Default,,0000,0000,0000,,For the benefit of those of you who have Dialogue: 0,0:23:45.85,0:23:48.81,Default,,0000,0000,0000,,yet to find your first gray hair, Pac-Man\Nwas Dialogue: 0,0:23:48.81,0:23:52.42,Default,,0000,0000,0000,,a video game released in 1980 that let people Dialogue: 0,0:23:52.42,0:23:54.99,Default,,0000,0000,0000,,maneuver around a maze eating dots while trying\Nto Dialogue: 0,0:23:54.99,0:23:58.30,Default,,0000,0000,0000,,avoid four ghosts. Now, playing games in fun,\Nbut Dialogue: 0,0:23:58.30,0:23:59.96,Default,,0000,0000,0000,,we're programmers. We want to know how things\Nwork. Dialogue: 0,0:23:59.96,0:24:02.72,Default,,0000,0000,0000,,So let's talk about programming Pac-Man. Dialogue: 0,0:24:02.72,0:24:04.45,Default,,0000,0000,0000,,For the purposes of this discussion, we'll\Nfocus on Dialogue: 0,0:24:04.45,0:24:10.64,Default,,0000,0000,0000,,just three things. The Pac-Man, the ghosts,\Nand the Dialogue: 0,0:24:10.64,0:24:11.93,Default,,0000,0000,0000,,maze. The Pac-Man is controlled by the player.\NSo Dialogue: 0,0:24:11.93,0:24:14.72,Default,,0000,0000,0000,,that code is basically just responding to\Nhardware events. Dialogue: 0,0:24:14.72,0:24:17.55,Default,,0000,0000,0000,,Boring. The maze is there so that the player Dialogue: 0,0:24:17.55,0:24:19.78,Default,,0000,0000,0000,,has some chance at avoiding the ghosts. But\Nthe Dialogue: 0,0:24:19.78,0:24:22.65,Default,,0000,0000,0000,,ghost AI, that's what's gonna make the game\Ninteresting Dialogue: 0,0:24:22.65,0:24:25.88,Default,,0000,0000,0000,,enough that people keep dropping quarters\Ninto a slot, Dialogue: 0,0:24:25.88,0:24:27.22,Default,,0000,0000,0000,,and by the way, video games used to cost Dialogue: 0,0:24:27.22,0:24:28.40,Default,,0000,0000,0000,,a quarter. Dialogue: 0,0:24:28.40,0:24:31.80,Default,,0000,0000,0000,,When I was your age. Dialogue: 0,0:24:31.80,0:24:34.47,Default,,0000,0000,0000,,So to keep things simple, we'll start with\None Dialogue: 0,0:24:34.47,0:24:37.94,Default,,0000,0000,0000,,ghost. How do we program its movement? We\Ncould Dialogue: 0,0:24:37.94,0:24:40.41,Default,,0000,0000,0000,,choose a random direction and move that way\Nuntil Dialogue: 0,0:24:40.41,0:24:42.09,Default,,0000,0000,0000,,we hit a wall and then choose another random Dialogue: 0,0:24:42.09,0:24:44.55,Default,,0000,0000,0000,,direction. This is very easy to implement,\Nbut not Dialogue: 0,0:24:44.55,0:24:46.22,Default,,0000,0000,0000,,much of a challenge for the player. Dialogue: 0,0:24:46.22,0:24:49.58,Default,,0000,0000,0000,,OK, so, we could compute the distance to the Dialogue: 0,0:24:49.58,0:24:52.18,Default,,0000,0000,0000,,Pac-Man in x and y and pick a direction Dialogue: 0,0:24:52.18,0:24:54.92,Default,,0000,0000,0000,,that makes one of those smaller. But then\Nthe Dialogue: 0,0:24:54.92,0:24:56.89,Default,,0000,0000,0000,,ghost is gonna get stuck in corners or behind Dialogue: 0,0:24:56.89,0:24:58.63,Default,,0000,0000,0000,,walls cause it won't go around to catch the Dialogue: 0,0:24:58.63,0:25:00.50,Default,,0000,0000,0000,,Pac-Man. And, again, it's gonna be too easy\Nfor Dialogue: 0,0:25:00.50,0:25:01.21,Default,,0000,0000,0000,,the player. Dialogue: 0,0:25:01.21,0:25:04.37,Default,,0000,0000,0000,,So how about instead of minimizing linear\Ndistance, we Dialogue: 0,0:25:04.37,0:25:09.11,Default,,0000,0000,0000,,focus on topological distance? We can compute\Nall possible Dialogue: 0,0:25:09.11,0:25:12.76,Default,,0000,0000,0000,,paths through the maze, pick the shortest\None that Dialogue: 0,0:25:12.76,0:25:14.60,Default,,0000,0000,0000,,gets us to the Pac-Man and then step down Dialogue: 0,0:25:14.60,0:25:16.52,Default,,0000,0000,0000,,it. And when we get to the next place, Dialogue: 0,0:25:16.52,0:25:18.99,Default,,0000,0000,0000,,we'll do it all again. Dialogue: 0,0:25:18.99,0:25:21.17,Default,,0000,0000,0000,,This works find for one ghost. But if all Dialogue: 0,0:25:21.17,0:25:23.64,Default,,0000,0000,0000,,four ghosts use this algorithm, then they're\Ngonna wind Dialogue: 0,0:25:23.64,0:25:25.21,Default,,0000,0000,0000,,up chasing after the player in a tight little Dialogue: 0,0:25:25.21,0:25:29.61,Default,,0000,0000,0000,,bunch instead of fanning out. OK. So each\Nghost Dialogue: 0,0:25:29.61,0:25:31.99,Default,,0000,0000,0000,,computes all possible paths to the Pac-Man\Nand rejects Dialogue: 0,0:25:31.99,0:25:34.67,Default,,0000,0000,0000,,any path that goes through another ghost.\NThat shouldn't Dialogue: 0,0:25:34.67,0:25:37.76,Default,,0000,0000,0000,,be too hard, right? Dialogue: 0,0:25:37.76,0:25:41.53,Default,,0000,0000,0000,,I don't have a statistically valid sample,\Nbut my Dialogue: 0,0:25:41.53,0:25:43.82,Default,,0000,0000,0000,,guess is that when asked to design an AI Dialogue: 0,0:25:43.82,0:25:45.73,Default,,0000,0000,0000,,for the ghosts, most programmers would go\Nthrough a Dialogue: 0,0:25:45.73,0:25:47.31,Default,,0000,0000,0000,,thought process more or less like what I just Dialogue: 0,0:25:47.31,0:25:51.59,Default,,0000,0000,0000,,walked through. So, how is this solution biased? Dialogue: 0,0:25:51.59,0:25:54.42,Default,,0000,0000,0000,,I don't have a name, a good name for Dialogue: 0,0:25:54.42,0:25:56.39,Default,,0000,0000,0000,,how this is biased, so the best way I Dialogue: 0,0:25:56.39,0:25:58.67,Default,,0000,0000,0000,,have to communicate this idea is to walk you Dialogue: 0,0:25:58.67,0:26:00.84,Default,,0000,0000,0000,,through a very different solution. Dialogue: 0,0:26:00.84,0:26:04.56,Default,,0000,0000,0000,,In 2006, I attended Oopsla, this is a conference Dialogue: 0,0:26:04.56,0:26:07.84,Default,,0000,0000,0000,,put on by the ACM, as a student volunteer, Dialogue: 0,0:26:07.84,0:26:09.62,Default,,0000,0000,0000,,and I happened to sit in on a presentation Dialogue: 0,0:26:09.62,0:26:14.27,Default,,0000,0000,0000,,by Alexander Repenning from the University\Nof Colorado. And Dialogue: 0,0:26:14.27,0:26:18.06,Default,,0000,0000,0000,,in his presentation, he walked through the\NPac-Man problem, Dialogue: 0,0:26:18.06,0:26:19.98,Default,,0000,0000,0000,,more or less the way I just did, and Dialogue: 0,0:26:19.98,0:26:21.14,Default,,0000,0000,0000,,then he presented this idea. Dialogue: 0,0:26:21.14,0:26:23.87,Default,,0000,0000,0000,,What you do is you give the Pac-Man a Dialogue: 0,0:26:23.87,0:26:25.97,Default,,0000,0000,0000,,smell, and then you model the diffusion of\Nthat Dialogue: 0,0:26:25.97,0:26:31.34,Default,,0000,0000,0000,,smell throughout the environment. In the real\Nworld, smells Dialogue: 0,0:26:31.34,0:26:33.64,Default,,0000,0000,0000,,travel through the air. We certainly don't\Nneed to Dialogue: 0,0:26:33.64,0:26:36.44,Default,,0000,0000,0000,,model each individual air molecule. What we\Ncan do, Dialogue: 0,0:26:36.44,0:26:39.18,Default,,0000,0000,0000,,instead, is just divide the environment up\Ninto reasonably Dialogue: 0,0:26:39.18,0:26:42.26,Default,,0000,0000,0000,,sized logical chunks, and we model those. Dialogue: 0,0:26:42.26,0:26:44.76,Default,,0000,0000,0000,,Coincidentally, we already do have an object\Nthat does Dialogue: 0,0:26:44.76,0:26:47.12,Default,,0000,0000,0000,,exactly that for us. It's the tiles of the Dialogue: 0,0:26:47.12,0:26:49.47,Default,,0000,0000,0000,,maze itself. They're not really doing anything\Nelse, so Dialogue: 0,0:26:49.47,0:26:51.62,Default,,0000,0000,0000,,we can borrow those as a convenient container\Nfor Dialogue: 0,0:26:51.62,0:26:56.36,Default,,0000,0000,0000,,this computation. We program the game as follows. Dialogue: 0,0:26:56.36,0:26:58.77,Default,,0000,0000,0000,,We say that the Pac-Man gives whatever floor\Ntile Dialogue: 0,0:26:58.77,0:27:02.03,Default,,0000,0000,0000,,it's standing on a Pac-Man smell value, say\Na Dialogue: 0,0:27:02.03,0:27:05.62,Default,,0000,0000,0000,,thousand. The number doesn't really matter.\NAnd that, that Dialogue: 0,0:27:05.62,0:27:08.03,Default,,0000,0000,0000,,tile then passes a smaller value off to each Dialogue: 0,0:27:08.03,0:27:10.27,Default,,0000,0000,0000,,of its neighbors, and they pass a smaller\Nvalue Dialogue: 0,0:27:10.27,0:27:12.52,Default,,0000,0000,0000,,off to each of their neighbors and so on. Dialogue: 0,0:27:12.52,0:27:13.75,Default,,0000,0000,0000,,Iterate this a few times and you get a Dialogue: 0,0:27:13.75,0:27:16.83,Default,,0000,0000,0000,,diffusion contour that we can visualize as\Na hill Dialogue: 0,0:27:16.83,0:27:18.60,Default,,0000,0000,0000,,with its peak centered on the Pac-Man. Dialogue: 0,0:27:18.60,0:27:21.38,Default,,0000,0000,0000,,It's a little hard to see here. The Pac-Man Dialogue: 0,0:27:21.38,0:27:23.11,Default,,0000,0000,0000,,is at the bottom of that big yellow bar Dialogue: 0,0:27:23.11,0:27:30.11,Default,,0000,0000,0000,,on the left. So we've got the Pac-Man. We've Dialogue: 0,0:27:34.14,0:27:37.08,Default,,0000,0000,0000,,got the floor tiles. But in order to make Dialogue: 0,0:27:37.08,0:27:38.55,Default,,0000,0000,0000,,it a maze, we also have to have some Dialogue: 0,0:27:38.55,0:27:41.11,Default,,0000,0000,0000,,walls. What we do is we give the walls Dialogue: 0,0:27:41.11,0:27:43.77,Default,,0000,0000,0000,,a Pac-Man smell value of zero. That chops\Nthe Dialogue: 0,0:27:43.77,0:27:50.77,Default,,0000,0000,0000,,hill up a bit. Dialogue: 0,0:27:56.05,0:27:58.21,Default,,0000,0000,0000,,And now all our ghost has to do is Dialogue: 0,0:27:58.21,0:28:03.56,Default,,0000,0000,0000,,climb the hill. We program the first ghost\Nto Dialogue: 0,0:28:03.56,0:28:06.65,Default,,0000,0000,0000,,sample each of the floor tiles next to it, Dialogue: 0,0:28:06.65,0:28:08.80,Default,,0000,0000,0000,,pick the one with the biggest number, go that Dialogue: 0,0:28:08.80,0:28:12.58,Default,,0000,0000,0000,,way. It barely seems worthy of being called\Nan Dialogue: 0,0:28:12.58,0:28:16.59,Default,,0000,0000,0000,,AI, does it? But check this out. When we Dialogue: 0,0:28:16.59,0:28:18.28,Default,,0000,0000,0000,,add more ghosts to the maze, we only have Dialogue: 0,0:28:18.28,0:28:20.75,Default,,0000,0000,0000,,to make one change to get them to cooperate. Dialogue: 0,0:28:20.75,0:28:23.36,Default,,0000,0000,0000,,And interestingly, we don't change the ghosts'\Nmovement behaviors Dialogue: 0,0:28:23.36,0:28:26.38,Default,,0000,0000,0000,,at all. Instead, we have the ghosts tell the Dialogue: 0,0:28:26.38,0:28:29.39,Default,,0000,0000,0000,,floor tile that they're, I guess, floating\Nabove, that Dialogue: 0,0:28:29.39,0:28:33.13,Default,,0000,0000,0000,,its Pac-Men smell value is zero. This changes\Nthe Dialogue: 0,0:28:33.13,0:28:35.68,Default,,0000,0000,0000,,shape of that diffusion contour. Instead of\Na smooth Dialogue: 0,0:28:35.68,0:28:38.32,Default,,0000,0000,0000,,hill that always slopes down away from the\NPac-Man, Dialogue: 0,0:28:38.32,0:28:40.03,Default,,0000,0000,0000,,there are now cliffs where the hill drops\Nimmediately Dialogue: 0,0:28:40.03,0:28:40.78,Default,,0000,0000,0000,,to zero. Dialogue: 0,0:28:40.78,0:28:45.03,Default,,0000,0000,0000,,In effect, we turn the ghosts into movable\Nwalls, Dialogue: 0,0:28:45.03,0:28:46.65,Default,,0000,0000,0000,,so that when one ghost cuts off another one, Dialogue: 0,0:28:46.65,0:28:49.56,Default,,0000,0000,0000,,the second one will automatically choose a\Ndifferent route. Dialogue: 0,0:28:49.56,0:28:52.99,Default,,0000,0000,0000,,This lets the ghosts cooperate without needing\Nto be Dialogue: 0,0:28:52.99,0:28:56.75,Default,,0000,0000,0000,,aware of each other. And halfway through this\Nconference Dialogue: 0,0:28:56.75,0:28:58.27,Default,,0000,0000,0000,,session that I was sitting in where I saw Dialogue: 0,0:28:58.27,0:29:00.82,Default,,0000,0000,0000,,this, I was like. Dialogue: 0,0:29:00.82,0:29:04.65,Default,,0000,0000,0000,,What just happened? Dialogue: 0,0:29:04.65,0:29:07.22,Default,,0000,0000,0000,,At first, like, my first level of surprise\Nwas Dialogue: 0,0:29:07.22,0:29:09.97,Default,,0000,0000,0000,,just, what an interesting approach. But then\NI got Dialogue: 0,0:29:09.97,0:29:13.33,Default,,0000,0000,0000,,really, completely stunned when I thought\Nabout how surprising Dialogue: 0,0:29:13.33,0:29:16.76,Default,,0000,0000,0000,,that solution was. And I hope that looking\Nat Dialogue: 0,0:29:16.76,0:29:19.52,Default,,0000,0000,0000,,the second solution helps you understand the\Nbias in Dialogue: 0,0:29:19.52,0:29:21.81,Default,,0000,0000,0000,,the first solution. Dialogue: 0,0:29:21.81,0:29:24.94,Default,,0000,0000,0000,,In his paper, Professor Repenning wrote, The\Nchallenge to Dialogue: 0,0:29:24.94,0:29:27.52,Default,,0000,0000,0000,,find this solution is a psychological, not\Na technical Dialogue: 0,0:29:27.52,0:29:30.93,Default,,0000,0000,0000,,one. Our first instinct, when we're presented\Nwith this Dialogue: 0,0:29:30.93,0:29:33.86,Default,,0000,0000,0000,,problem, is to imagine ourselves as the ghost.\NThis Dialogue: 0,0:29:33.86,0:29:36.92,Default,,0000,0000,0000,,is the body syntonic reasoning that's built\Ninto Logo, Dialogue: 0,0:29:36.92,0:29:39.08,Default,,0000,0000,0000,,and in this case it's a trap. Dialogue: 0,0:29:39.08,0:29:40.78,Default,,0000,0000,0000,,Because it leads us to solve the pursuit problem Dialogue: 0,0:29:40.78,0:29:44.73,Default,,0000,0000,0000,,by making the pursuer smarter. Once we started\Ndown Dialogue: 0,0:29:44.73,0:29:48.21,Default,,0000,0000,0000,,that road, it's very unlikely that we're going\Nto Dialogue: 0,0:29:48.21,0:29:51.60,Default,,0000,0000,0000,,consider a radically different approach, even,\Nor, perhaps, especially Dialogue: 0,0:29:51.60,0:29:55.74,Default,,0000,0000,0000,,if it's a very much simpler one. In other Dialogue: 0,0:29:55.74,0:29:59.02,Default,,0000,0000,0000,,words, body syntonicity biases us towards\Nmodeling objects in Dialogue: 0,0:29:59.02,0:30:03.83,Default,,0000,0000,0000,,the foreground, rather than objects in the\Nbackground. Dialogue: 0,0:30:03.83,0:30:06.97,Default,,0000,0000,0000,,Oops, sorry. Dialogue: 0,0:30:06.97,0:30:10.60,Default,,0000,0000,0000,,OK. Does this mean that you shouldn't use\Nbody Dialogue: 0,0:30:10.60,0:30:12.78,Default,,0000,0000,0000,,syntonic reasoning? Of course not. It's a\Ntool. It's Dialogue: 0,0:30:12.78,0:30:15.43,Default,,0000,0000,0000,,right for some jobs. It's not right for others. Dialogue: 0,0:30:15.43,0:30:16.91,Default,,0000,0000,0000,,I want to take a look at one more Dialogue: 0,0:30:16.91,0:30:21.11,Default,,0000,0000,0000,,technique from part one. What's the bias in\NPlease Dialogue: 0,0:30:21.11,0:30:23.59,Default,,0000,0000,0000,,Mr. Gear, what is your ratio? Aside from the Dialogue: 0,0:30:23.59,0:30:27.77,Default,,0000,0000,0000,,gendered language, which is trivially easy\Nto address. This Dialogue: 0,0:30:27.77,0:30:31.11,Default,,0000,0000,0000,,technique is explicitly designed to give you\Nan opportunity Dialogue: 0,0:30:31.11,0:30:34.12,Default,,0000,0000,0000,,to discover new objects in your model. But\Nit Dialogue: 0,0:30:34.12,0:30:35.65,Default,,0000,0000,0000,,only works after you've given at least one\Nof Dialogue: 0,0:30:35.65,0:30:38.05,Default,,0000,0000,0000,,those objects a name. Dialogue: 0,0:30:38.05,0:30:42.18,Default,,0000,0000,0000,,Names have gravity. Metaphors can be tar pits.\NIt's Dialogue: 0,0:30:42.18,0:30:44.62,Default,,0000,0000,0000,,very likely that the new objects that you\Ndiscover Dialogue: 0,0:30:44.62,0:30:46.86,Default,,0000,0000,0000,,are going to be fairly closely related to\Nthe Dialogue: 0,0:30:46.86,0:30:51.39,Default,,0000,0000,0000,,ones that you already have. Another way to\Nhelp Dialogue: 0,0:30:51.39,0:30:53.42,Default,,0000,0000,0000,,see this is to think about how many steps Dialogue: 0,0:30:53.42,0:30:56.61,Default,,0000,0000,0000,,it takes to get from Please, Ms. Pac-Man,\Nwhat Dialogue: 0,0:30:56.61,0:30:59.73,Default,,0000,0000,0000,,is your current position in the maze? To,\Nplease Dialogue: 0,0:30:59.73,0:31:01.61,Default,,0000,0000,0000,,Ms. Floor Tile, how much do you smell like Dialogue: 0,0:31:01.61,0:31:04.54,Default,,0000,0000,0000,,Pac-Man? Dialogue: 0,0:31:04.54,0:31:05.88,Default,,0000,0000,0000,,For a lot of people, the answer to that Dialogue: 0,0:31:05.88,0:31:09.66,Default,,0000,0000,0000,,question is probably infinity. It certainly\Nwas for me. Dialogue: 0,0:31:09.66,0:31:11.39,Default,,0000,0000,0000,,My guess is that you don't come up with Dialogue: 0,0:31:11.39,0:31:14.40,Default,,0000,0000,0000,,this technique unless you've already done\Nsome work modeling Dialogue: 0,0:31:14.40,0:31:18.95,Default,,0000,0000,0000,,diffusion in another context. Which, incidentally,\Nis why I Dialogue: 0,0:31:18.95,0:31:21.84,Default,,0000,0000,0000,,like to work on diverse teams. The more different Dialogue: 0,0:31:21.84,0:31:24.73,Default,,0000,0000,0000,,backgrounds and perspectives we have access\Nto, the more Dialogue: 0,0:31:24.73,0:31:27.52,Default,,0000,0000,0000,,chances we have to find a novel application\Nof Dialogue: 0,0:31:27.52,0:31:31.72,Default,,0000,0000,0000,,some seemingly unrelated technique, because\Nsomebody's worked with it Dialogue: 0,0:31:31.72,0:31:33.37,Default,,0000,0000,0000,,before. Dialogue: 0,0:31:33.37,0:31:37.60,Default,,0000,0000,0000,,It can be exhilarating and very empowering\Nto find Dialogue: 0,0:31:37.60,0:31:39.90,Default,,0000,0000,0000,,these techniques that let us take shortcuts\Nin our Dialogue: 0,0:31:39.90,0:31:43.93,Default,,0000,0000,0000,,work by leveraging these specialized structures\Nin our brains. Dialogue: 0,0:31:43.93,0:31:46.89,Default,,0000,0000,0000,,But those structures themselves take shortcuts,\Nand if you're Dialogue: 0,0:31:46.89,0:31:48.89,Default,,0000,0000,0000,,not careful, they can lead you down a primrose Dialogue: 0,0:31:48.89,0:31:49.29,Default,,0000,0000,0000,,path. Dialogue: 0,0:31:49.29,0:31:51.55,Default,,0000,0000,0000,,I want to go back to that quote that Dialogue: 0,0:31:51.55,0:31:53.31,Default,,0000,0000,0000,,got me thinking about all this in the first Dialogue: 0,0:31:53.31,0:31:56.08,Default,,0000,0000,0000,,place. About how we don't ever teach anybody\Nhow Dialogue: 0,0:31:56.08,0:31:58.51,Default,,0000,0000,0000,,to do that or even that they should. Dialogue: 0,0:31:58.51,0:32:00.92,Default,,0000,0000,0000,,Ultimately, I think we should use techniques\Nlike this, Dialogue: 0,0:32:00.92,0:32:03.09,Default,,0000,0000,0000,,despite the, the biases in them. I think we Dialogue: 0,0:32:03.09,0:32:06.65,Default,,0000,0000,0000,,should share them. And I think, to paraphrase\NGlenn, Dialogue: 0,0:32:06.65,0:32:08.06,Default,,0000,0000,0000,,we should teach people that this is a thing Dialogue: 0,0:32:08.06,0:32:11.98,Default,,0000,0000,0000,,that you can and should do. And, I think Dialogue: 0,0:32:11.98,0:32:14.24,Default,,0000,0000,0000,,that we should teach people that looking critically\Nat Dialogue: 0,0:32:14.24,0:32:16.96,Default,,0000,0000,0000,,the answers that these techniques give you\Nis also Dialogue: 0,0:32:16.96,0:32:19.49,Default,,0000,0000,0000,,a thing that you can and should do. Dialogue: 0,0:32:19.49,0:32:20.64,Default,,0000,0000,0000,,We might not always be able to come up Dialogue: 0,0:32:20.64,0:32:23.96,Default,,0000,0000,0000,,with a radically simpler or different approach,\Nbut the Dialogue: 0,0:32:23.96,0:32:27.06,Default,,0000,0000,0000,,least we can do is give ourselves the opportunity Dialogue: 0,0:32:27.06,0:32:33.05,Default,,0000,0000,0000,,to do so, by asking how is this biased? Dialogue: 0,0:32:33.05,0:32:34.69,Default,,0000,0000,0000,,I want to say thank you, real quickly, to Dialogue: 0,0:32:34.69,0:32:36.49,Default,,0000,0000,0000,,everybody who helped me with this talk, or\Nthe Dialogue: 0,0:32:36.49,0:32:39.12,Default,,0000,0000,0000,,ideas in it. And also thank you to LivingSocial Dialogue: 0,0:32:39.12,0:32:41.82,Default,,0000,0000,0000,,for paying for my trip. And also for bringing Dialogue: 0,0:32:41.82,0:32:45.79,Default,,0000,0000,0000,,these wonderful brains. So, they're gonna\Nstart tearing this Dialogue: 0,0:32:45.79,0:32:48.63,Default,,0000,0000,0000,,stage down in a few minutes. Rather than take Dialogue: 0,0:32:48.63,0:32:50.05,Default,,0000,0000,0000,,Q and A up here, I'm gonna pack up Dialogue: 0,0:32:50.05,0:32:52.38,Default,,0000,0000,0000,,all my stuff and then I'm gonna migrate over Dialogue: 0,0:32:52.38,0:32:54.57,Default,,0000,0000,0000,,there, and you can come and bug me. pick Dialogue: 0,0:32:54.57,0:32:55.93,Default,,0000,0000,0000,,up a brain. Whatever. Dialogue: 0,0:32:55.93,0:32:56.79,Default,,0000,0000,0000,,Thank you.