0:00:16.910,0:00:18.180 SAM LIVINGSTON-GRAY: Hello. Welcome to the[br]very 0:00:18.180,0:00:20.400 last session of RailsConf. 0:00:20.400,0:00:21.080 When I leave this stage, 0:00:21.080,0:00:22.410 they are gonna burn it down. 0:00:22.410,0:00:24.210 AUDIENCE: Yeah! 0:00:24.900,0:00:26.240 S.L.: I have a couple of items of business 0:00:26.250,0:00:29.890 before I launch into my presentation proper.[br]The first 0:00:29.890,0:00:32.930 of which is turning on my clicker. I work 0:00:32.930,0:00:36.449 for LivingSocial. We are hiring. If this fact[br]is 0:00:36.449,0:00:38.230 intriguing to you, please feel free to come[br]and 0:00:38.230,0:00:41.400 talk to me afterwards. Also, our recruiters[br]brought a 0:00:41.400,0:00:43.790 ton of little squishy stress balls that are[br]shaped 0:00:43.790,0:00:46.650 like little brains. As far as I know, this 0:00:46.650,0:00:48.730 was a coincidence, but I love the tie-in so 0:00:48.730,0:00:50.110 I brought the whole bag. I had them leave 0:00:50.110,0:00:52.079 it for me. So if you would like an 0:00:52.079,0:00:54.960 extra brain, please come talk to me after[br]the 0:00:54.960,0:00:55.899 show. 0:00:55.899,0:00:59.050 A quick note about accessibility. If you have[br]any 0:00:59.050,0:01:02.079 trouble seeing my slides, hearing my voice,[br]or following 0:01:02.079,0:01:04.519 my weird trains of thought, or maybe you just 0:01:04.519,0:01:06.580 like spoilers, you can get a PDF with both 0:01:06.580,0:01:09.420 my slides and my script at this url. It's 0:01:09.420,0:01:14.270 tinyurl dot com, cog dash shorts dash railsconf.[br]I 0:01:14.270,0:01:15.750 also have it up here on a thumb drive, 0:01:15.750,0:01:18.220 so if the conference wi-fi does what it usually 0:01:18.220,0:01:19.970 does, please go see Evan Light up in the 0:01:19.970,0:01:21.020 second row. 0:01:21.020,0:01:23.830 I'm gonna leave this up for a couple more 0:01:23.830,0:01:25.780 minutes. And I also want to give a shoutout 0:01:25.780,0:01:30.110 to the opportunity scholarship program here.[br]To quote the 0:01:30.110,0:01:33.020 RailsConf site, this program is for people[br]who wouldn't 0:01:33.020,0:01:35.360 usually take part in our community or who[br]might 0:01:35.360,0:01:37.380 just want a friendly face during their first[br]time 0:01:37.380,0:01:40.750 at RailsConf. I'm a huge fan of this program. 0:01:40.750,0:01:42.940 I think it's a great way to welcome new 0:01:42.940,0:01:45.890 people and new voices into our community.[br]This is 0:01:45.890,0:01:47.630 the second year that I've volunteered as a[br]guide 0:01:47.630,0:01:48.770 and this is the second year that I've met 0:01:48.770,0:01:51.750 somebody with a fascinating story to tell.[br]If you're 0:01:51.750,0:01:54.780 a seasoned conference veteran, I strongly[br]encourage you to 0:01:54.780,0:01:56.869 apply next year. 0:01:56.869,0:02:03.869 OK. Programming is hard. It's not quantum[br]physics. But 0:02:04.410,0:02:06.700 neither is it falling off a log. And if 0:02:06.700,0:02:08.530 I had to pick just one word to explain 0:02:08.530,0:02:12.530 why programming is hard, that word would be[br]abstract. 0:02:12.530,0:02:15.709 I asked Google to define abstract, and here's[br]what 0:02:15.709,0:02:17.040 it said. 0:02:17.040,0:02:19.129 Existing in thought or as an idea, but not 0:02:19.129,0:02:21.629 having a physical or concrete existence. 0:02:21.629,0:02:24.459 I usually prefer defining things in terms[br]of what 0:02:24.459,0:02:26.500 they are, but in this case I find the 0:02:26.500,0:02:31.390 negative definition extremely telling. Abstract[br]things are hard for 0:02:31.390,0:02:34.150 us to think about precisely because they don't[br]have 0:02:34.150,0:02:35.950 a physical or a concrete existence, and that's[br]what 0:02:35.950,0:02:37.540 our brains are wired for. 0:02:37.540,0:02:40.670 Now, I normally prefer the kind of talk where 0:02:40.670,0:02:42.950 the speaker just launches right in and forces[br]me 0:02:42.950,0:02:45.590 to keep up, but this is a complex idea, 0:02:45.590,0:02:48.310 and it's the last talk of the last day, 0:02:48.310,0:02:49.480 and I'm sure you're all as fried as I 0:02:49.480,0:02:54.010 am. So, here's a little background. I got[br]the 0:02:54.010,0:02:56.570 idea for this talk when I was listening to 0:02:56.570,0:03:00.510 the Ruby Rogues podcast episode with Glenn[br]Vanderburg. This 0:03:00.510,0:03:03.360 is lightly edited for length, but in that[br]episode, 0:03:03.360,0:03:06.200 Glenn said, The best programmers I know all[br]have 0:03:06.200,0:03:09.170 some good techniques for conceptualizing or[br]modeling the programs 0:03:09.170,0:03:11.030 that they work with. And it tends to be 0:03:11.030,0:03:13.960 sort of a spatial/visual model, but not always.[br]And 0:03:13.960,0:03:16.069 he says, What's going on is our brains are 0:03:16.069,0:03:18.400 geared towards the physical world and dealing[br]with our 0:03:18.400,0:03:21.680 senses and integrating that sensory input. 0:03:21.680,0:03:23.100 But the work we do as programmers is all 0:03:23.100,0:03:25.210 abstract. And it makes perfect sense that[br]you would 0:03:25.210,0:03:27.140 want to find techniques to rope the physical[br]sensory 0:03:27.140,0:03:29.540 parts of your brain into this task of dealing 0:03:29.540,0:03:32.150 with abstractions. And this is the part that[br]really 0:03:32.150,0:03:34.170 got my attention. He says, But we don't ever 0:03:34.170,0:03:35.730 teach anybody how to do that or even that 0:03:35.730,0:03:37.950 they should do that. 0:03:37.950,0:03:40.380 When I heard this, I started thinking about[br]the 0:03:40.380,0:03:44.069 times that I've stumbled across some technique[br]for doing 0:03:44.069,0:03:46.200 something like this, and I've been really[br]excited to 0:03:46.200,0:03:48.830 find a way of translating a programming problem[br]into 0:03:48.830,0:03:50.630 some form that my brain could really get a 0:03:50.630,0:03:52.770 handle on. And I was like yeah, yeah, brains 0:03:52.770,0:03:54.970 are awesome. And we should be teaching people[br]that 0:03:54.970,0:03:57.880 this is a thing they can do. 0:03:57.880,0:03:59.650 And I thought about it, and some time later, 0:03:59.650,0:04:02.600 I was like, wait a minute. No. Brains are 0:04:02.600,0:04:06.540 horrible. And teaching people these tricks[br]would be totally 0:04:06.540,0:04:09.069 irresponsible, if we also didn't warn them[br]about cognitive 0:04:09.069,0:04:13.040 bias. I get to that in a little bit. 0:04:13.040,0:04:16.639 This is a talk in three parts. Part one, 0:04:16.639,0:04:19.000 brains are awesome. And as Glenn said, you[br]can 0:04:19.000,0:04:21.019 rope the physical and sensory parts of your[br]brain 0:04:21.019,0:04:23.020 as well as a few others I'll talk about 0:04:23.020,0:04:26.220 into helping you deal with abstractions. Part[br]two, brains 0:04:26.220,0:04:28.319 are horrible and they lie to us all the 0:04:28.319,0:04:31.470 time. But if you're on the look out for 0:04:31.470,0:04:33.210 the kinds of lies that your brain will tell 0:04:33.210,0:04:35.790 you, in part three I have an example of 0:04:35.790,0:04:37.470 the kind of amazing hack that you just might 0:04:37.470,0:04:42.290 be able to come up with. 0:04:42.290,0:04:45.360 Our brains are extremely well-adapted for[br]dealing with the 0:04:45.360,0:04:50.250 physical world. Our hindbrains, which regular[br]respiration, temperature, and 0:04:50.250,0:04:52.310 balance, have been around for half a billion[br]years 0:04:52.310,0:04:57.139 or so. But when I write software, I am 0:04:57.139,0:04:58.750 leaning hard on parts of the brain that are 0:04:58.750,0:05:01.800 relatively new in evolutionary terms, and[br]I'm using some 0:05:01.800,0:05:04.370 relatively expensive resources. 0:05:04.370,0:05:05.770 So over the years I have built up a 0:05:05.770,0:05:09.400 small collection of techniques and shortcuts[br]that engage specialized 0:05:09.400,0:05:10.960 structures of my brain to help me reason about 0:05:10.960,0:05:13.870 programming problems. Here's the list. 0:05:13.870,0:05:17.880 I'm gonna start with a category of visual[br]tools 0:05:17.880,0:05:20.410 that let us leverage our spatial understanding[br]of the 0:05:20.410,0:05:23.500 world and our spatial reasoning skills to[br]discover relationships 0:05:23.500,0:05:25.850 between different parts of a model. Or just[br]to 0:05:25.850,0:05:27.760 stay oriented when we're trying to reason[br]through a 0:05:27.760,0:05:29.090 complex problem. 0:05:29.090,0:05:31.570 I'm just gonna list out a few examples of 0:05:31.570,0:05:34.350 this category quickly, because I think most[br]developers are 0:05:34.350,0:05:37.320 likely to encounter these, either in school[br]or on 0:05:37.320,0:05:38.740 the job. And they all have the same basic 0:05:38.740,0:05:41.870 shape. They're boxes and arrows. 0:05:41.870,0:05:45.620 There's Entity-Relationship Diagrams, which[br]help us understand how our 0:05:45.620,0:05:48.790 data is modeled. We use diagrams to describe[br]data 0:05:48.790,0:05:53.210 structures like binary trees, linked lists,[br]and so on. 0:05:53.210,0:05:56.090 And for state machines of any complexity,[br]diagrams are 0:05:56.090,0:05:57.580 often the only way to make any sense of 0:05:57.580,0:06:00.330 them. I could go on, but like I said, 0:06:00.330,0:06:01.949 most of us are probably used to using these, 0:06:01.949,0:06:02.919 at least occasionally. 0:06:02.919,0:06:05.470 There are three things that I like about these 0:06:05.470,0:06:09.720 tools. First, they lend themselves really[br]well to standing 0:06:09.720,0:06:12.120 up in front of a white board, possibly with 0:06:12.120,0:06:15.260 a co-worker, and just standing up and moving[br]around 0:06:15.260,0:06:17.030 a little bit will help get the blood flowing 0:06:17.030,0:06:19.510 and, and get your brain perked up. 0:06:19.510,0:06:22.570 Second, diagrams help us offload some of the[br]work 0:06:22.570,0:06:26.169 of keeping track of things, of different concepts,[br]by 0:06:26.169,0:06:29.250 attaching those concepts to objects in a two-dimensional[br]space. 0:06:29.250,0:06:30.919 And our brains have a lot of hardware support 0:06:30.919,0:06:34.419 for keeping track of where things are in space. 0:06:34.419,0:06:36.510 And third, our brains are really good at pattern 0:06:36.510,0:06:39.690 recognition, so visualizing our designs can[br]give us a 0:06:39.690,0:06:42.560 chance to spot certain kinds of problems just[br]by 0:06:42.560,0:06:45.590 looking at their shapes before we ever start[br]typing 0:06:45.590,0:06:49.449 code in an editor, and I think that's pretty 0:06:49.449,0:06:50.010 cool. 0:06:50.010,0:06:52.560 Here's another technique that makes use of[br]our spatial 0:06:52.560,0:06:54.889 perception skills, and if you saw Sandi's[br]talk yesterday, 0:06:54.889,0:06:57.680 you'll know this one. It's the squint test.[br]It's 0:06:57.680,0:07:00.370 very straight forward. You open up some code[br]and 0:07:00.370,0:07:02.370 you either squint your eyes at it or you 0:07:02.370,0:07:04.729 decrease the font size. The point is to look 0:07:04.729,0:07:06.850 past the words and check out the shape of 0:07:06.850,0:07:08.280 the code. 0:07:08.280,0:07:10.940 This is a pathological example that I used[br]in 0:07:10.940,0:07:14.520 a refactoring talk last year. You can use[br]this 0:07:14.520,0:07:17.610 technique as an aid to navigation, as a way 0:07:17.610,0:07:19.800 of zeroing in on high-risk areas of code,[br]or 0:07:19.800,0:07:22.210 just plain to get oriented in a new code 0:07:22.210,0:07:25.479 base. There are a few specific patterns that[br]you 0:07:25.479,0:07:27.199 can look for, and you'll find others as you, 0:07:27.199,0:07:28.800 as you do more of it. 0:07:28.800,0:07:31.960 Is the left margin ragged, as it is here? 0:07:31.960,0:07:34.139 Are there any ridiculously long lines? There's[br]one towards 0:07:34.139,0:07:37.639 the bottom. What does your syntax highlighting[br]tell you? 0:07:37.639,0:07:39.330 Are there groups of colors or are colors sort 0:07:39.330,0:07:43.820 of spread out? And there's a lot of information 0:07:43.820,0:07:47.759 you can glean from this. Incidentally, I have[br]only 0:07:47.759,0:07:50.070 ever met one blind programmer, and we didn't[br]really 0:07:50.070,0:07:52.060 talk about this stuff. If any of you have 0:07:52.060,0:07:55.610 found that a physical or a cognitive disability[br]gives 0:07:55.610,0:07:58.960 you a, an interesting way of looking at code, 0:07:58.960,0:08:01.840 or understanding code I suppose, please come[br]talk to 0:08:01.840,0:08:05.710 me, because I'd love to hear your story. 0:08:05.710,0:08:07.620 Next up, I have a couple of techniques that 0:08:07.620,0:08:10.560 involve a clever use of language. The first[br]one 0:08:10.560,0:08:13.990 is deceptively simple, but it does require[br]a prop. 0:08:13.990,0:08:18.470 Doesn't have to be that big. You can totally 0:08:18.470,0:08:20.419 get away with using the souvenir edition.[br]This is 0:08:20.419,0:08:24.720 my daughter's duck cow bath toy. What you[br]do 0:08:24.720,0:08:26.710 is you keep a rubber duck on your desk. 0:08:26.710,0:08:28.210 When you get stuck, you put the rubber deck 0:08:28.210,0:08:30.840 on top- rubber duck, excuse me, on top of 0:08:30.840,0:08:33.349 your keyboard, and you explain your problem[br]out loud 0:08:33.349,0:08:34.429 to the duck. 0:08:34.429,0:08:35.328 [laughter] 0:08:35.328,0:08:39.578 Really. I mean, it sounds absurd, right. But[br]there's 0:08:39.578,0:08:41.360 a good chance that in the process of putting 0:08:41.360,0:08:44.269 your problem into words, you'll discover that[br]there's an 0:08:44.269,0:08:46.579 incorrect assumption that you've been making[br]or you'll think 0:08:46.579,0:08:48.490 of some other possible solution. 0:08:48.490,0:08:50.709 I've also heard of people using teddy bears[br]or 0:08:50.709,0:08:53.689 other stuffed animals. And one of my co-workers[br]told 0:08:53.689,0:08:56.649 me that she learned this as the pet-rock technique. 0:08:56.649,0:08:58.929 This was a thing in the seventies. And also 0:08:58.929,0:09:00.869 that she finds it useful to compose an email 0:09:00.869,0:09:03.740 describing the problem. So for those of you[br]who, 0:09:03.740,0:09:07.040 like me, think better when you're typing or[br]writing 0:09:07.040,0:09:08.429 than when you're speaking, that can be a nice, 0:09:08.429,0:09:13.259 a nice alternative. 0:09:13.259,0:09:15.069 The other linguistic hack that I got, I got 0:09:15.069,0:09:18.639 from Sandi Metz, and in this book, Practical[br]Oriented 0:09:18.639,0:09:22.050 Design in Ruby, PODR for short, she describes[br]a 0:09:22.050,0:09:25.100 technique that she uses to figure out which[br]object 0:09:25.100,0:09:28.730 a method should belong. I tried paraphrasing[br]this, but 0:09:28.730,0:09:30.730 honestly Sandi did a much better job than[br]I 0:09:30.730,0:09:32.779 would, describing it, so I'm just gonna read[br]it 0:09:32.779,0:09:33.459 verbatim. 0:09:33.459,0:09:35.819 She says, How can you determine if a Gear 0:09:35.819,0:09:39.040 class contains behavior that belongs somewhere[br]else? One way 0:09:39.040,0:09:41.170 is to pretend that it's sentient and to interrogate 0:09:41.170,0:09:43.769 it. If you rephrase every one of its methods 0:09:43.769,0:09:45.600 as a question, asking the question ought to[br]make 0:09:45.600,0:09:47.100 sense. 0:09:47.100,0:09:49.309 For example, "Please Mr. Gear, what is your[br]ratio?" 0:09:49.309,0:09:52.079 seems perfectly reasonable, while "Please[br]Mr. Gear, what are 0:09:52.079,0:09:54.449 your gear_inches?" is on shaky ground, and[br]"Please Mr. 0:09:54.449,0:09:59.889 Gear, what is your tire(size)?" is just downright[br]ridiculous. 0:09:59.889,0:10:01.809 This is a great way to evaluate objects in 0:10:01.809,0:10:04.350 light of the single responsibility principle.[br]Now I'll come 0:10:04.350,0:10:07.240 back to that thought in just a minute, but 0:10:07.240,0:10:10.240 first, I described the rubber duck and Please,[br]Mr. 0:10:10.240,0:10:13.579 Gear? as techniques to engage linguistic reasoning,[br]but that 0:10:13.579,0:10:17.269 doesn't quite feel right. Both of these techniques[br]force 0:10:17.269,0:10:20.439 us to put our questions into words, but words 0:10:20.439,0:10:23.189 themselves are tools. We use words to communicate[br]our 0:10:23.189,0:10:25.749 ideas to other people. 0:10:25.749,0:10:28.619 As primates, we've evolved a set of social[br]skills 0:10:28.619,0:10:30.970 and behaviors for getting our needs met as[br]part 0:10:30.970,0:10:34.619 of a community. So, while these techniques[br]do involve 0:10:34.619,0:10:36.869 using language centers of your brain, I think[br]they 0:10:36.869,0:10:39.989 reach beyond those centers to tap into our[br]social 0:10:39.989,0:10:41.709 reasoning. 0:10:41.709,0:10:44.499 The rubber duck technique works because, putting[br]your problem 0:10:44.499,0:10:47.309 into words forces you to organize your understanding[br]of 0:10:47.309,0:10:49.230 a problem in such a way that you can 0:10:49.230,0:10:53.529 verbally lead another mind through it. And[br]Please, Mr. 0:10:53.529,0:10:56.420 Gear? let's us anthropomorphize an object[br]and talk to 0:10:56.420,0:10:58.720 it to discover whether it conforms to the[br]single 0:10:58.720,0:11:00.910 responsibility principle. 0:11:00.910,0:11:03.550 To me, the tell-tale phrase in Sandi's description[br]of 0:11:03.550,0:11:06.459 this technique is, asking the question ought[br]to make 0:11:06.459,0:11:13.459 sense. Most of us have an intuitive understanding[br]that 0:11:13.809,0:11:16.410 it might not be appropriate to ask Alice about 0:11:16.410,0:11:20.350 something that is Bob's responsibility. Interrogating[br]an object as 0:11:20.350,0:11:22.420 though it were a person helps us use that 0:11:22.420,0:11:25.239 social knowledge, and it gives us an opportunity[br]to 0:11:25.239,0:11:28.119 notice that a particular question doesn't[br]make sense to 0:11:28.119,0:11:31.009 ask any of our existing objects, which might[br]prompt 0:11:31.009,0:11:32.300 us to ask if we should create a new 0:11:32.300,0:11:35.019 object to fill that role instead. 0:11:35.019,0:11:39.610 Now, personally, I would have considered PODR[br]to have 0:11:39.610,0:11:41.679 been a worthwhile purchase if Please, Mr.[br]Gear was 0:11:41.679,0:11:44.089 the only thing I got from it. But, in 0:11:44.089,0:11:45.649 this book, Sandi also made what I thought[br]was 0:11:45.649,0:11:49.209 a very compelling case for UML Sequence Diagrams. 0:11:49.209,0:11:53.110 Where Please, Mr. Gear is a good tool for 0:11:53.110,0:11:56.329 discovering which objects should be responsible[br]for a particular 0:11:56.329,0:11:59.100 method, a Sequence Diagram can help you analyze[br]the 0:11:59.100,0:12:04.019 runtime interaction between several different[br]objects. At first glance, 0:12:04.019,0:12:05.929 this looks kind of like something in the boxes 0:12:05.929,0:12:08.499 and arrows category of visual and spatial[br]tools, but 0:12:08.499,0:12:10.429 again, this feels more like it's tapping into[br]that 0:12:10.429,0:12:12.959 social understanding that we have. This can[br]be a 0:12:12.959,0:12:14.339 good way to get a sense for when an 0:12:14.339,0:12:18.089 object is bossy or when performing a task[br]involves 0:12:18.089,0:12:22.309 a complex sequence of several, several interactions.[br]Or if 0:12:22.309,0:12:25.009 there are just plain too many different things[br]to 0:12:25.009,0:12:27.319 keep track of. 0:12:27.319,0:12:29.100 Rather than turn this into a lecture on UML, 0:12:29.100,0:12:30.910 I'm just gonna tell you to go buy Sandi's 0:12:30.910,0:12:33.779 book, and if for whatever reason, you cannot[br]afford 0:12:33.779,0:12:35.220 it, come talk to me later and we'll work 0:12:35.220,0:12:36.329 something out. 0:12:36.329,0:12:41.389 Now for the really hand-wavy stuff. Metaphors[br]can be 0:12:41.389,0:12:45.069 a really useful tool in software. The turtle[br]graphic 0:12:45.069,0:12:47.399 system in Logo is a great metaphor. Has anybody 0:12:47.399,0:12:50.509 used Logo at any point in their life? About 0:12:50.509,0:12:52.850 half the people. That's really cool. 0:12:52.850,0:12:55.269 We've probably all played with drawing something[br]on the 0:12:55.269,0:12:57.679 screen at some point, but most of the rendering 0:12:57.679,0:13:00.069 systems that I've used are based on a Cartesian 0:13:00.069,0:13:04.910 coordinate system, a grid. And this metaphor[br]encourages the 0:13:04.910,0:13:07.569 programmer to imagine themselves as the turtle,[br]and to 0:13:07.569,0:13:09.449 use that understanding to figure out, when[br]they get 0:13:09.449,0:13:11.670 stuck, what they should be doing next. 0:13:11.670,0:13:14.369 One of the original creators of Logo called[br]this 0:13:14.369,0:13:17.920 Body Syntonic Reasoning, and specifically[br]developed it to help 0:13:17.920,0:13:21.529 children solve problems. But the turtle metaphor,[br]the turtle 0:13:21.529,0:13:24.480 metaphor works for everybody, not just for[br]kids. 0:13:24.480,0:13:31.480 Cartesian grids are great for drawing boxes.[br]Mostly great. 0:13:31.769,0:13:33.489 But it can take some very careful thinking[br]to 0:13:33.489,0:13:36.529 figure out how to, how to use x, y 0:13:36.529,0:13:41.239 coordinate pairs to draw a spiral or a star 0:13:41.239,0:13:44.860 or a snowflake or a tree. Choosing a different 0:13:44.860,0:13:47.739 metaphor can make different kinds of solutions[br]easy, where 0:13:47.739,0:13:49.319 before they seemed like too much trouble to[br]be 0:13:49.319,0:13:51.139 worth bothering with. 0:13:51.139,0:13:58.139 James Ladd, in 2008, wrote a couple of interesting 0:13:58.819,0:14:03.609 blog posts about what he called East-oriented[br]code. Imagine 0:14:03.609,0:14:07.420 a compass overlaid on top of your screen.[br]In 0:14:07.420,0:14:10.069 this, in this model, messages that an object[br]sends 0:14:10.069,0:14:13.319 to itself go South, and any data returned[br]from 0:14:13.319,0:14:17.420 those calls goes North. Communications between[br]objects is the 0:14:17.420,0:14:20.359 same thing, rotated ninety degrees. Messages[br]sent to other 0:14:20.359,0:14:22.879 objects go East, and the return values from[br]those 0:14:22.879,0:14:26.920 messages flow West. 0:14:26.920,0:14:29.759 What James Ladd suggests is that, in general,[br]code 0:14:29.759,0:14:32.970 that sends messages to other objects, code[br]where information 0:14:32.970,0:14:36.290 mostly flows East, is easier to extend and[br]maintain 0:14:36.290,0:14:38.249 than code that looks at data and then decides 0:14:38.249,0:14:40.269 what to do with it, which is code where 0:14:40.269,0:14:42.100 information flows West. 0:14:42.100,0:14:45.420 Really, this is just the design principle,[br]tell, don't 0:14:45.420,0:14:49.299 ask. But, the metaphor of the compass, compass[br]recasts 0:14:49.299,0:14:51.839 this in a way that helps us use our 0:14:51.839,0:14:55.170 background spatial awareness to keep this[br]principle in mind 0:14:55.170,0:14:58.910 at all times. In fact, there are plenty of 0:14:58.910,0:15:01.629 ways we can use our background level awareness[br]to 0:15:01.629,0:15:03.139 analyze our code. 0:15:03.139,0:15:08.639 Isn't this adorable? I love this picture. 0:15:08.639,0:15:11.220 Code smells are an entire category of metaphors[br]that 0:15:11.220,0:15:13.779 we use to talk about our work. In fact, 0:15:13.779,0:15:16.959 the name code smell itself is a metaphor for 0:15:16.959,0:15:19.639 anything about your code that hints at a design 0:15:19.639,0:15:25.389 problem, which I suppose makes it a meta-metaphor. 0:15:25.389,0:15:29.230 Some code smells have names are extremely[br]literal. Duplicated 0:15:29.230,0:15:30.559 code, long method and so on. But some of 0:15:30.559,0:15:36.049 these are delightfully suggestive. Feature[br]envy. Refused bequest. Primitive 0:15:36.049,0:15:39.149 obsession. To me, the names on the right have 0:15:39.149,0:15:41.769 a lot in common with Please, Mr. Gear. They're 0:15:41.769,0:15:44.730 chosen to hook into something in our social[br]awareness 0:15:44.730,0:15:47.739 to give a name to a pattern of dysfunction, 0:15:47.739,0:15:50.319 and by naming the problems it suggests a possible 0:15:50.319,0:15:51.720 solution. 0:15:51.720,0:15:54.730 So, these are most of the shortcuts that I've 0:15:54.730,0:15:57.399 accumulated over the years, and I hope that[br]this 0:15:57.399,0:15:59.199 can be the start of a similar collection for 0:15:59.199,0:16:04.480 some of you. 0:16:04.480,0:16:05.359 Now the part where I try to put the 0:16:05.359,0:16:09.629 fear into you. Evolution has designed our[br]brains to 0:16:09.629,0:16:13.529 lie to us. Brains are expensive. The human[br]brain 0:16:13.529,0:16:16.129 accounts for just two percent of body mass,[br]but 0:16:16.129,0:16:19.329 twenty percent of our caloric intake. That's[br]a huge 0:16:19.329,0:16:22.879 energy requirement that has to be justified. 0:16:22.879,0:16:25.949 Evolution, as a designer, does one thing and[br]one 0:16:25.949,0:16:29.559 thing only. It selects for traits that allow[br]an 0:16:29.559,0:16:32.449 organism to stay alive long enough to reproduce.[br]It 0:16:32.449,0:16:34.899 doesn't care about getting the best solution.[br]Only one 0:16:34.899,0:16:38.029 that's good enough to compete in the current[br]landscape. 0:16:38.029,0:16:40.259 Evolution will tolerate any hack as long as[br]it 0:16:40.259,0:16:42.649 meets that one goal. 0:16:42.649,0:16:44.249 As an example, I want to take a minute 0:16:44.249,0:16:46.269 to talk about how we see the world around 0:16:46.269,0:16:50.059 us. The human eye has two different kinds[br]of 0:16:50.059,0:16:52.389 photo receptors. There are about a hundred[br]and twenty 0:16:52.389,0:16:55.279 million rod cells in each eye. These play[br]little 0:16:55.279,0:16:57.730 or no role in color vision, and they're mostly 0:16:57.730,0:16:59.809 used for night time and peripheral vision. 0:16:59.809,0:17:02.019 There are also about six or seven million[br]cone 0:17:02.019,0:17:04.500 cells in each eye, and these give us color 0:17:04.500,0:17:05.939 vision, but they require a lot more light[br]to 0:17:05.939,0:17:09.869 work. And the vast majority of cone cells[br]are 0:17:09.869,0:17:11.890 packed together in a tight little cluster[br]near the 0:17:11.890,0:17:13.900 center of the retina. This area is what we 0:17:13.900,0:17:15.970 use to focus on individual details, and it's[br]smaller 0:17:15.970,0:17:20.640 than you might think. It's only fifteen degrees[br]wide. 0:17:20.640,0:17:23.660 As a result, our vision is extremely directional.[br]We 0:17:23.660,0:17:25.520 have a very small area of high detail and 0:17:25.520,0:17:27.430 high color, and the rest of our field of 0:17:27.430,0:17:31.140 vision is more or less monochrome. So when[br]we 0:17:31.140,0:17:38.140 look at this, our eyes see something like[br]this. 0:17:40.390,0:17:42.580 In order to turn the image on the left 0:17:42.580,0:17:44.920 into the image on the right, our brains are 0:17:44.920,0:17:46.960 doing a lot of work that we're mostly unaware 0:17:46.960,0:17:49.280 of. 0:17:49.280,0:17:51.400 We compensate for having such highly directional[br]vision by 0:17:51.400,0:17:54.500 moving our eyes around a lot. Our brains combine 0:17:54.500,0:17:57.050 the details from these individual points of[br]interest to 0:17:57.050,0:17:59.710 construct a persistent mental model of whatever[br]we're looking 0:17:59.710,0:18:03.400 at. These fast point to point movements are[br]called 0:18:03.400,0:18:06.230 saccades. And they're actually the fastest[br]movements that the 0:18:06.230,0:18:09.230 human body can make. The shorter saccades[br]that you 0:18:09.230,0:18:11.020 make, might make when you're reading, last[br]for twenty 0:18:11.020,0:18:13.960 to forty milliseconds. Longer ones that travel[br]through a 0:18:13.960,0:18:16.610 wider arc might take two hundred milliseconds,[br]or about 0:18:16.610,0:18:18.520 a fifth of a second. 0:18:18.520,0:18:20.990 What I find so fascinating about this is that 0:18:20.990,0:18:25.030 we don't perceive saccades. During a saccade,[br]the eye 0:18:25.030,0:18:27.460 is still sending data to the brain, but what 0:18:27.460,0:18:29.010 it's sending is a smeary blur. So the brain 0:18:29.010,0:18:32.680 just edits that part out. This process is[br]called 0:18:32.680,0:18:35.970 saccadic masking. You can see this effect[br]for yourself. 0:18:35.970,0:18:37.880 Next time you're in front of a mirror, lean 0:18:37.880,0:18:40.470 in close and look back and forth from the 0:18:40.470,0:18:43.070 reflection of one eye to the other. You won't 0:18:43.070,0:18:45.520 see your eyes move. As far as we can 0:18:45.520,0:18:48.110 tell, our gaze just jumps instantaneously[br]from one reference 0:18:48.110,0:18:50.220 point to the next. And here's where I have 0:18:50.220,0:18:51.990 to wait for a moment while everybody stops[br]doing 0:18:51.990,0:18:56.900 this. 0:18:56.900,0:18:58.940 When I was preparing for this talk, I found 0:18:58.940,0:19:01.940 an absolutely wonderful sentence in the Wikipedia[br]entry on 0:19:01.940,0:19:06.100 saccades. It said, Due to saccadic masking,[br]the eye/brain 0:19:06.100,0:19:07.810 system not only hides the eye movements from[br]the 0:19:07.810,0:19:10.130 individual, but also hides the evidence that[br]anything has 0:19:10.130,0:19:12.160 been hidden. 0:19:12.160,0:19:17.890 Hides. The evidence. That anything has been[br]hidden. Our 0:19:17.890,0:19:20.100 brains lie to us. And they lie to us 0:19:20.100,0:19:22.610 about having lied to us. And this happens[br]to 0:19:22.610,0:19:26.390 you multiple times a second, every waking[br]hour, every 0:19:26.390,0:19:29.060 day of your life. Of course, there's a reason 0:19:29.060,0:19:30.390 for this. 0:19:30.390,0:19:32.240 Imagine if, every time you shifted your gaze[br]around, 0:19:32.240,0:19:34.200 you got distracted by all the pretty colors.[br]You 0:19:34.200,0:19:36.330 would be eaten by lions. 0:19:36.330,0:19:40.320 But, in selecting for this design, evolution[br]made a 0:19:40.320,0:19:42.680 trade off. The trade off is that we are 0:19:42.680,0:19:45.570 effectively blind every time we move our eyes[br]around. 0:19:45.570,0:19:48.330 Sometimes for up to a fifth of a second. 0:19:48.330,0:19:51.050 And I wanted to talk about this, partly because 0:19:51.050,0:19:53.430 it's a really fun subject, but also to show 0:19:53.430,0:19:55.760 that just one of the ways that our brains 0:19:55.760,0:19:58.500 are doing a massive amount of work to process 0:19:58.500,0:20:01.250 information from our environment and present[br]us with an 0:20:01.250,0:20:03.430 abstraction. 0:20:03.430,0:20:05.980 And as programmers, if we know anything about[br]abstractions, 0:20:05.980,0:20:09.240 it's that they're hard to get right. Which[br]leads 0:20:09.240,0:20:11.860 me to an interesting question. Does it make[br]sense 0:20:11.860,0:20:13.440 to use any of the techniques that I talked 0:20:13.440,0:20:15.900 about in part one, to try to coral different 0:20:15.900,0:20:17.690 parts of our brains into doing our work for 0:20:17.690,0:20:19.690 us, if we don't know what kinds of shortcuts 0:20:19.690,0:20:26.650 they're gonna take? 0:20:26.650,0:20:30.510 According to the Oxford English Dictionary,[br]the word bias 0:20:30.510,0:20:32.580 seems to have entered the English language[br]around the 0:20:32.580,0:20:35.770 1520s. It was used as a, a technical term 0:20:35.770,0:20:38.600 in the game of lawn bowling, and it referred 0:20:38.600,0:20:40.230 to a ball that was constructed in such a 0:20:40.230,0:20:42.650 way that it would curve, it would roll in 0:20:42.650,0:20:44.640 a curved path instead of in a straight line. 0:20:44.640,0:20:47.150 And since then, it's picked up a few additional 0:20:47.150,0:20:49.580 meanings, but they all have that same different[br]connotation 0:20:49.580,0:20:54.440 of something that's skewed or off a little[br]bit. 0:20:54.440,0:20:57.260 Cognitive bias is a term for systematic errors[br]in 0:20:57.260,0:20:59.490 thinking. These are patterns of thought that[br]diverge in 0:20:59.490,0:21:02.860 measurable and predictable ways from what[br]the answers that 0:21:02.860,0:21:07.070 pure rationality might give are. We have some[br]free 0:21:07.070,0:21:09.100 time. I suggest that you go have a look 0:21:09.100,0:21:11.810 at the Wikipedia page called List of cognitive[br]biases. 0:21:11.810,0:21:13.890 There are over a hundred and fifty of them 0:21:13.890,0:21:16.610 and they are fascinating reading. 0:21:16.610,0:21:18.950 And this list of cognitive biases has a lot 0:21:18.950,0:21:20.670 in common with the list of code smells that 0:21:20.670,0:21:22.740 I showed earlier. A lot of these names are 0:21:22.740,0:21:25.160 very literal. But there are a few that stand 0:21:25.160,0:21:28.640 out, like cursive knowledge, or the Google[br]effect or, 0:21:28.640,0:21:32.680 and I kid you not, the Ikea effect. But 0:21:32.680,0:21:34.490 the parallel goes deeper than that. 0:21:34.490,0:21:37.850 This lif - excuse me - this list gives 0:21:37.850,0:21:40.640 names to patterns of dysfunction, and once[br]you have 0:21:40.640,0:21:41.950 a name for a thing, it's a lot easier 0:21:41.950,0:21:43.510 to recognize it and figure out what to do 0:21:43.510,0:21:46.330 about it. I do want to call your attention 0:21:46.330,0:21:48.280 to one particular item on this list. It's[br]called 0:21:48.280,0:21:51.920 the bias blind spot. This is the tendency[br]to 0:21:51.920,0:21:54.990 see oneself as less biased than other people,[br]or 0:21:54.990,0:21:57.150 to be able to identify more cognitive biases[br]in 0:21:57.150,0:22:04.150 others than in oneself. Sound like anybody[br]you know? 0:22:10.820,0:22:17.820 Just let that sink in for a minute. Seriously, 0:22:24.350,0:22:25.730 though. 0:22:25.730,0:22:27.630 In our field, we like to think of ourselves 0:22:27.630,0:22:30.240 as more rational than the average person,[br]and it 0:22:30.240,0:22:33.940 just isn't true. Yes, as programmers, we have[br]a 0:22:33.940,0:22:37.250 valuable, marketable skill that depends on[br]our ability to 0:22:37.250,0:22:40.130 reason mathematically. But we do ourselves[br]and others a 0:22:40.130,0:22:42.280 disservice if we allow ourselves to believe[br]that being 0:22:42.280,0:22:45.260 good at programming means anything other than,[br]we're good 0:22:45.260,0:22:48.570 at programming. Because as humans we are all[br]biased. 0:22:48.570,0:22:51.220 It's built into us, in our DNA. And pretending 0:22:51.220,0:22:53.630 that we aren't biased only allows our biases[br]to 0:22:53.630,0:22:54.780 run free. 0:22:54.780,0:22:57.500 I don't have a lot of general advice for 0:22:57.500,0:22:59.640 how to look for bias, but I think an 0:22:59.640,0:23:02.830 obvious and necessary first step is just to[br]ask 0:23:02.830,0:23:07.510 the question, how is this biased? Beyond that,[br]I 0:23:07.510,0:23:09.520 suggest that you learn about as many specific[br]cognitive 0:23:09.520,0:23:11.230 biases as you can so that your brain can 0:23:11.230,0:23:13.010 do what it does, which is to look for 0:23:13.010,0:23:17.090 patterns and make associations and classify[br]things. 0:23:17.090,0:23:19.190 I think everybody should understand their[br]own biases, because 0:23:19.190,0:23:21.610 only by knowing how you're biased can you[br]then 0:23:21.610,0:23:23.910 decide how to con- how to correct for that 0:23:23.910,0:23:26.610 bias in the decisions that you make. If you're 0:23:26.610,0:23:28.630 not checking your work for bias, you can look 0:23:28.630,0:23:30.630 right past a great solution and you'll never[br]know 0:23:30.630,0:23:32.200 it was there. 0:23:32.200,0:23:35.340 So for part three of my talk, I have 0:23:35.340,0:23:37.860 an example of a solution that is simple, elegant, 0:23:37.860,0:23:41.460 just about the last thing I ever would have 0:23:41.460,0:23:44.690 thought of. 0:23:44.690,0:23:45.850 For the benefit of those of you who have 0:23:45.850,0:23:48.810 yet to find your first gray hair, Pac-Man[br]was 0:23:48.810,0:23:52.420 a video game released in 1980 that let people 0:23:52.420,0:23:54.990 maneuver around a maze eating dots while trying[br]to 0:23:54.990,0:23:58.300 avoid four ghosts. Now, playing games in fun,[br]but 0:23:58.300,0:23:59.960 we're programmers. We want to know how things[br]work. 0:23:59.960,0:24:02.720 So let's talk about programming Pac-Man. 0:24:02.720,0:24:04.450 For the purposes of this discussion, we'll[br]focus on 0:24:04.450,0:24:10.640 just three things. The Pac-Man, the ghosts,[br]and the 0:24:10.640,0:24:11.930 maze. The Pac-Man is controlled by the player.[br]So 0:24:11.930,0:24:14.720 that code is basically just responding to[br]hardware events. 0:24:14.720,0:24:17.550 Boring. The maze is there so that the player 0:24:17.550,0:24:19.780 has some chance at avoiding the ghosts. But[br]the 0:24:19.780,0:24:22.650 ghost AI, that's what's gonna make the game[br]interesting 0:24:22.650,0:24:25.880 enough that people keep dropping quarters[br]into a slot, 0:24:25.880,0:24:27.220 and by the way, video games used to cost 0:24:27.220,0:24:28.400 a quarter. 0:24:28.400,0:24:31.800 When I was your age. 0:24:31.800,0:24:34.470 So to keep things simple, we'll start with[br]one 0:24:34.470,0:24:37.940 ghost. How do we program its movement? We[br]could 0:24:37.940,0:24:40.410 choose a random direction and move that way[br]until 0:24:40.410,0:24:42.090 we hit a wall and then choose another random 0:24:42.090,0:24:44.550 direction. This is very easy to implement,[br]but not 0:24:44.550,0:24:46.220 much of a challenge for the player. 0:24:46.220,0:24:49.580 OK, so, we could compute the distance to the 0:24:49.580,0:24:52.180 Pac-Man in x and y and pick a direction 0:24:52.180,0:24:54.920 that makes one of those smaller. But then[br]the 0:24:54.920,0:24:56.890 ghost is gonna get stuck in corners or behind 0:24:56.890,0:24:58.630 walls cause it won't go around to catch the 0:24:58.630,0:25:00.500 Pac-Man. And, again, it's gonna be too easy[br]for 0:25:00.500,0:25:01.210 the player. 0:25:01.210,0:25:04.370 So how about instead of minimizing linear[br]distance, we 0:25:04.370,0:25:09.110 focus on topological distance? We can compute[br]all possible 0:25:09.110,0:25:12.760 paths through the maze, pick the shortest[br]one that 0:25:12.760,0:25:14.600 gets us to the Pac-Man and then step down 0:25:14.600,0:25:16.520 it. And when we get to the next place, 0:25:16.520,0:25:18.990 we'll do it all again. 0:25:18.990,0:25:21.170 This works find for one ghost. But if all 0:25:21.170,0:25:23.640 four ghosts use this algorithm, then they're[br]gonna wind 0:25:23.640,0:25:25.210 up chasing after the player in a tight little 0:25:25.210,0:25:29.610 bunch instead of fanning out. OK. So each[br]ghost 0:25:29.610,0:25:31.990 computes all possible paths to the Pac-Man[br]and rejects 0:25:31.990,0:25:34.670 any path that goes through another ghost.[br]That shouldn't 0:25:34.670,0:25:37.760 be too hard, right? 0:25:37.760,0:25:41.530 I don't have a statistically valid sample,[br]but my 0:25:41.530,0:25:43.820 guess is that when asked to design an AI 0:25:43.820,0:25:45.730 for the ghosts, most programmers would go[br]through a 0:25:45.730,0:25:47.310 thought process more or less like what I just 0:25:47.310,0:25:51.590 walked through. So, how is this solution biased? 0:25:51.590,0:25:54.420 I don't have a name, a good name for 0:25:54.420,0:25:56.390 how this is biased, so the best way I 0:25:56.390,0:25:58.670 have to communicate this idea is to walk you 0:25:58.670,0:26:00.840 through a very different solution. 0:26:00.840,0:26:04.560 In 2006, I attended Oopsla, this is a conference 0:26:04.560,0:26:07.840 put on by the ACM, as a student volunteer, 0:26:07.840,0:26:09.620 and I happened to sit in on a presentation 0:26:09.620,0:26:14.270 by Alexander Repenning from the University[br]of Colorado. And 0:26:14.270,0:26:18.060 in his presentation, he walked through the[br]Pac-Man problem, 0:26:18.060,0:26:19.980 more or less the way I just did, and 0:26:19.980,0:26:21.140 then he presented this idea. 0:26:21.140,0:26:23.870 What you do is you give the Pac-Man a 0:26:23.870,0:26:25.970 smell, and then you model the diffusion of[br]that 0:26:25.970,0:26:31.340 smell throughout the environment. In the real[br]world, smells 0:26:31.340,0:26:33.640 travel through the air. We certainly don't[br]need to 0:26:33.640,0:26:36.440 model each individual air molecule. What we[br]can do, 0:26:36.440,0:26:39.180 instead, is just divide the environment up[br]into reasonably 0:26:39.180,0:26:42.260 sized logical chunks, and we model those. 0:26:42.260,0:26:44.760 Coincidentally, we already do have an object[br]that does 0:26:44.760,0:26:47.120 exactly that for us. It's the tiles of the 0:26:47.120,0:26:49.470 maze itself. They're not really doing anything[br]else, so 0:26:49.470,0:26:51.620 we can borrow those as a convenient container[br]for 0:26:51.620,0:26:56.360 this computation. We program the game as follows. 0:26:56.360,0:26:58.770 We say that the Pac-Man gives whatever floor[br]tile 0:26:58.770,0:27:02.030 it's standing on a Pac-Man smell value, say[br]a 0:27:02.030,0:27:05.620 thousand. The number doesn't really matter.[br]And that, that 0:27:05.620,0:27:08.030 tile then passes a smaller value off to each 0:27:08.030,0:27:10.270 of its neighbors, and they pass a smaller[br]value 0:27:10.270,0:27:12.520 off to each of their neighbors and so on. 0:27:12.520,0:27:13.750 Iterate this a few times and you get a 0:27:13.750,0:27:16.830 diffusion contour that we can visualize as[br]a hill 0:27:16.830,0:27:18.600 with its peak centered on the Pac-Man. 0:27:18.600,0:27:21.380 It's a little hard to see here. The Pac-Man 0:27:21.380,0:27:23.110 is at the bottom of that big yellow bar 0:27:23.110,0:27:30.110 on the left. So we've got the Pac-Man. We've 0:27:34.140,0:27:37.080 got the floor tiles. But in order to make 0:27:37.080,0:27:38.550 it a maze, we also have to have some 0:27:38.550,0:27:41.110 walls. What we do is we give the walls 0:27:41.110,0:27:43.770 a Pac-Man smell value of zero. That chops[br]the 0:27:43.770,0:27:50.770 hill up a bit. 0:27:56.050,0:27:58.210 And now all our ghost has to do is 0:27:58.210,0:28:03.559 climb the hill. We program the first ghost[br]to 0:28:03.559,0:28:06.650 sample each of the floor tiles next to it, 0:28:06.650,0:28:08.800 pick the one with the biggest number, go that 0:28:08.800,0:28:12.580 way. It barely seems worthy of being called[br]an 0:28:12.580,0:28:16.590 AI, does it? But check this out. When we 0:28:16.590,0:28:18.280 add more ghosts to the maze, we only have 0:28:18.280,0:28:20.750 to make one change to get them to cooperate. 0:28:20.750,0:28:23.360 And interestingly, we don't change the ghosts'[br]movement behaviors 0:28:23.360,0:28:26.380 at all. Instead, we have the ghosts tell the 0:28:26.380,0:28:29.390 floor tile that they're, I guess, floating[br]above, that 0:28:29.390,0:28:33.130 its Pac-Men smell value is zero. This changes[br]the 0:28:33.130,0:28:35.680 shape of that diffusion contour. Instead of[br]a smooth 0:28:35.680,0:28:38.320 hill that always slopes down away from the[br]Pac-Man, 0:28:38.320,0:28:40.030 there are now cliffs where the hill drops[br]immediately 0:28:40.030,0:28:40.780 to zero. 0:28:40.780,0:28:45.030 In effect, we turn the ghosts into movable[br]walls, 0:28:45.030,0:28:46.650 so that when one ghost cuts off another one, 0:28:46.650,0:28:49.559 the second one will automatically choose a[br]different route. 0:28:49.559,0:28:52.990 This lets the ghosts cooperate without needing[br]to be 0:28:52.990,0:28:56.750 aware of each other. And halfway through this[br]conference 0:28:56.750,0:28:58.270 session that I was sitting in where I saw 0:28:58.270,0:29:00.820 this, I was like. 0:29:00.820,0:29:04.650 What just happened? 0:29:04.650,0:29:07.220 At first, like, my first level of surprise[br]was 0:29:07.220,0:29:09.970 just, what an interesting approach. But then[br]I got 0:29:09.970,0:29:13.330 really, completely stunned when I thought[br]about how surprising 0:29:13.330,0:29:16.760 that solution was. And I hope that looking[br]at 0:29:16.760,0:29:19.520 the second solution helps you understand the[br]bias in 0:29:19.520,0:29:21.809 the first solution. 0:29:21.809,0:29:24.940 In his paper, Professor Repenning wrote, The[br]challenge to 0:29:24.940,0:29:27.520 find this solution is a psychological, not[br]a technical 0:29:27.520,0:29:30.930 one. Our first instinct, when we're presented[br]with this 0:29:30.930,0:29:33.860 problem, is to imagine ourselves as the ghost.[br]This 0:29:33.860,0:29:36.920 is the body syntonic reasoning that's built[br]into Logo, 0:29:36.920,0:29:39.080 and in this case it's a trap. 0:29:39.080,0:29:40.780 Because it leads us to solve the pursuit problem 0:29:40.780,0:29:44.730 by making the pursuer smarter. Once we started[br]down 0:29:44.730,0:29:48.210 that road, it's very unlikely that we're going[br]to 0:29:48.210,0:29:51.600 consider a radically different approach, even,[br]or, perhaps, especially 0:29:51.600,0:29:55.740 if it's a very much simpler one. In other 0:29:55.740,0:29:59.020 words, body syntonicity biases us towards[br]modeling objects in 0:29:59.020,0:30:03.830 the foreground, rather than objects in the[br]background. 0:30:03.830,0:30:06.970 Oops, sorry. 0:30:06.970,0:30:10.600 OK. Does this mean that you shouldn't use[br]body 0:30:10.600,0:30:12.780 syntonic reasoning? Of course not. It's a[br]tool. It's 0:30:12.780,0:30:15.430 right for some jobs. It's not right for others. 0:30:15.430,0:30:16.910 I want to take a look at one more 0:30:16.910,0:30:21.110 technique from part one. What's the bias in[br]Please 0:30:21.110,0:30:23.590 Mr. Gear, what is your ratio? Aside from the 0:30:23.590,0:30:27.770 gendered language, which is trivially easy[br]to address. This 0:30:27.770,0:30:31.110 technique is explicitly designed to give you[br]an opportunity 0:30:31.110,0:30:34.120 to discover new objects in your model. But[br]it 0:30:34.120,0:30:35.650 only works after you've given at least one[br]of 0:30:35.650,0:30:38.050 those objects a name. 0:30:38.050,0:30:42.180 Names have gravity. Metaphors can be tar pits.[br]It's 0:30:42.180,0:30:44.620 very likely that the new objects that you[br]discover 0:30:44.620,0:30:46.860 are going to be fairly closely related to[br]the 0:30:46.860,0:30:51.390 ones that you already have. Another way to[br]help 0:30:51.390,0:30:53.420 see this is to think about how many steps 0:30:53.420,0:30:56.610 it takes to get from Please, Ms. Pac-Man,[br]what 0:30:56.610,0:30:59.730 is your current position in the maze? To,[br]please 0:30:59.730,0:31:01.610 Ms. Floor Tile, how much do you smell like 0:31:01.610,0:31:04.540 Pac-Man? 0:31:04.540,0:31:05.880 For a lot of people, the answer to that 0:31:05.880,0:31:09.660 question is probably infinity. It certainly[br]was for me. 0:31:09.660,0:31:11.390 My guess is that you don't come up with 0:31:11.390,0:31:14.400 this technique unless you've already done[br]some work modeling 0:31:14.400,0:31:18.950 diffusion in another context. Which, incidentally,[br]is why I 0:31:18.950,0:31:21.840 like to work on diverse teams. The more different 0:31:21.840,0:31:24.730 backgrounds and perspectives we have access[br]to, the more 0:31:24.730,0:31:27.520 chances we have to find a novel application[br]of 0:31:27.520,0:31:31.720 some seemingly unrelated technique, because[br]somebody's worked with it 0:31:31.720,0:31:33.370 before. 0:31:33.370,0:31:37.600 It can be exhilarating and very empowering[br]to find 0:31:37.600,0:31:39.900 these techniques that let us take shortcuts[br]in our 0:31:39.900,0:31:43.929 work by leveraging these specialized structures[br]in our brains. 0:31:43.929,0:31:46.890 But those structures themselves take shortcuts,[br]and if you're 0:31:46.890,0:31:48.890 not careful, they can lead you down a primrose 0:31:48.890,0:31:49.290 path. 0:31:49.290,0:31:51.550 I want to go back to that quote that 0:31:51.550,0:31:53.309 got me thinking about all this in the first 0:31:53.309,0:31:56.080 place. About how we don't ever teach anybody[br]how 0:31:56.080,0:31:58.510 to do that or even that they should. 0:31:58.510,0:32:00.920 Ultimately, I think we should use techniques[br]like this, 0:32:00.920,0:32:03.090 despite the, the biases in them. I think we 0:32:03.090,0:32:06.650 should share them. And I think, to paraphrase[br]Glenn, 0:32:06.650,0:32:08.059 we should teach people that this is a thing 0:32:08.059,0:32:11.980 that you can and should do. And, I think 0:32:11.980,0:32:14.240 that we should teach people that looking critically[br]at 0:32:14.240,0:32:16.960 the answers that these techniques give you[br]is also 0:32:16.960,0:32:19.490 a thing that you can and should do. 0:32:19.490,0:32:20.640 We might not always be able to come up 0:32:20.640,0:32:23.960 with a radically simpler or different approach,[br]but the 0:32:23.960,0:32:27.059 least we can do is give ourselves the opportunity 0:32:27.059,0:32:33.050 to do so, by asking how is this biased? 0:32:33.050,0:32:34.690 I want to say thank you, real quickly, to 0:32:34.690,0:32:36.490 everybody who helped me with this talk, or[br]the 0:32:36.490,0:32:39.120 ideas in it. And also thank you to LivingSocial 0:32:39.120,0:32:41.820 for paying for my trip. And also for bringing 0:32:41.820,0:32:45.790 these wonderful brains. So, they're gonna[br]start tearing this 0:32:45.790,0:32:48.630 stage down in a few minutes. Rather than take 0:32:48.630,0:32:50.050 Q and A up here, I'm gonna pack up 0:32:50.050,0:32:52.380 all my stuff and then I'm gonna migrate over 0:32:52.380,0:32:54.570 there, and you can come and bug me. pick 0:32:54.570,0:32:55.929 up a brain. Whatever. 0:32:55.929,0:32:56.790 Thank you.