0:00:13.832,0:00:17.885 First of all, I just want to start off [br]by thanking the organizer. 0:00:17.885,0:00:20.074 They really put in a lot of effort 0:00:20.083,0:00:22.036 to make me feel really special as a speaker. 0:00:22.046,0:00:24.833 Also as an attendee,[br]watching these other talks 0:00:25.421,0:00:27.611 so I just want to give them a huge thanks 0:00:27.751,0:00:30.821 Can I get an extra round of [br]applaud for the organizers 0:00:36.175,0:00:38.879 And also, thanks everyone for being here. 0:00:39.991,0:00:40.930 So, I'm Blithe 0:00:40.939,0:00:43.374 You can find me @blithe[br]on Twitter and Github 0:00:45.103,0:00:47.517 I work for a company call Big Nerd Ranch 0:00:47.517,0:00:49.711 It's based in Atlanta and 0:00:49.711,0:00:51.905 some people know it. Alright! 0:00:51.905,0:00:54.916 It's based in Atlanta and [br]I work remotely full time in Oakland 0:00:54.916,0:00:57.216 We do a couple of things at[br]Big Nerd Ranch 0:00:57.220,0:01:01.295 We develop apps, we write books[br]and we also teach courses. 0:01:02.163,0:01:04.673 And of course, we're hiring[br]good people, always. 0:01:06.336,0:01:08.582 As you heard, I used to be a scientist 0:01:08.597,0:01:10.781 I have a PhD in Physical Chemistry 0:01:11.475,0:01:13.913 And a lot of people ask me [br]what is physical chemistry? 0:01:13.913,0:01:15.400 what does that mean? 0:01:15.416,0:01:17.956 Well, if you think about it[br]It's right on the border between 0:01:17.956,0:01:23.470 what you know as physics and[br]what you know as chemistry 0:01:23.491,0:01:26.566 That means I spent a [br]long time in grad school 0:01:27.156,0:01:30.122 It also means I've done a lot[br]of experiments 0:01:30.123,0:01:32.510 A lot of people asked me[br]"How did you do it? 0:01:32.510,0:01:34.397 How did you make it [br]through 6 years of grad school 0:01:34.622,0:01:36.160 make it to the end?" 0:01:36.194,0:01:39.026 And I did it by using the scientific method 0:01:41.118,0:01:44.992 and I'm still using it everyday 0:01:45.420,0:01:48.910 I'm a developer, but[br]I'm still using the scientific method everyday 0:01:49.470,0:01:51.247 How many of you have gotten an error 0:01:51.788,0:01:52.721 Google it 0:01:53.061,0:01:56.030 pull the first answer straight from StackOverflow 0:01:56.033,0:01:57.517 and put it in your code and run it 0:01:58.795,0:02:00.236 I think we all tried it 0:02:01.786,0:02:03.097 And did it solve your problem? 0:02:03.847,0:02:04.658 Maybe 0:02:04.678,0:02:06.878 Maybe it did.[br]Maybe if you were lucky 0:02:07.038,0:02:08.387 But probably not 0:02:08.532,0:02:09.788 Most of the time, probably not 0:02:09.788,0:02:11.400 and it was pretty inefficient 0:02:11.412,0:02:13.015 and the more important question is 0:02:13.015,0:02:15.564 Did you learn anything from that? 0:02:17.227,0:02:20.690 The most important part of troubleshooting is learning 0:02:20.921,0:02:23.991 If you solved a problem without learning[br]from it, 0:02:23.991,0:02:25.922 It's only a temporary fix 0:02:25.922,0:02:32.095 It's either going to come back later or[br]you're going to make the same mistake in the future 0:02:33.515,0:02:37.711 Learning is how you level up as a developer 0:02:37.711,0:02:40.381 by learning from your experiences 0:02:40.381,0:02:43.279 And that bring me back to the scientific method 0:02:43.282,0:02:48.225 How can using the scientific method[br]help you level up as a developer? 0:02:48.225,0:02:49.794 Well, What is it? 0:02:49.794,0:02:54.665 Well, if you Google it and go straight to[br]Wikipedia you'll see this definition 0:02:54.665,0:02:58.295 It's a set of techniques for acquiring knowledge 0:02:58.295,0:03:01.005 And I love this definition because it can apply to anything 0:03:01.005,0:03:04.699 any career, including being a developer 0:03:04.699,0:03:07.915 The scientific method, it's methodical 0:03:07.915,0:03:13.322 It's an established procedure and[br]scientists have been using it since the 17th century 0:03:13.322,0:03:15.452 It's also systematic 0:03:15.452,0:03:19.198 It's a step-by-step process 0:03:19.198,0:03:23.881 and it's for gaining knowledge[br]and incorporating that into your process 0:03:23.881,0:03:28.660 and the time for reflection is built right into the[br]scientific method 0:03:30.130,0:03:35.196 The other day, a coworker of mine popped up[br]in the company chat room and said 0:03:35.196,0:03:39.790 "Has anyone seen Ruby string interpolation fail?" 0:03:39.790,0:03:41.617 and I thought that's a pretty interesting question 0:03:41.617,0:03:45.147 Why do you ask? Why are you asking that? 0:03:45.147,0:03:50.115 So we dug a little deeper and they were [br]using factory girl sequencing method 0:03:50.115,0:03:54.155 to create a series of users [br]with unique email addresses. 0:03:54.155,0:03:57.154 So email 1, email 2, email 3... 0:03:57.154,0:03:58.872 and it wasn't working. It was failing. 0:03:58.872,0:04:01.867 It was trying to create users [br]with the same email address 0:04:01.867,0:04:04.133 and it was failing and [br]they couldn't figure out why 0:04:04.133,0:04:06.399 and their solution, 0:04:06.399,0:04:09.115 they ended up just rolling [br]their own sequencing method 0:04:09.115,0:04:11.831 Well, that may have solved [br]their problem temporarily, 0:04:11.831,0:04:14.547 that wasn't really the [br]most elegant solution 0:04:14.547,0:04:16.374 and it turned out, 0:04:16.374,0:04:20.061 the real problem was that they [br]were missing the hash symbol 0:04:20.061,0:04:22.819 that was required for interpolation 0:04:22.819,0:04:26.202 so simple mistakes, but we all [br]make simple mistakes like that 0:04:26.202,0:04:28.151 We all make them all the times 0:04:28.151,0:04:32.320 But maybe using the scientific[br]method would have helped in this case 0:04:33.120,0:04:37.452 The first step of the scientific [br]method is defining the problem 0:04:37.452,0:04:43.296 As a scientist, this means saying what is [br]the information that you're trying to gain? 0:04:43.296,0:04:49.007 What knowledge are you[br]trying to gain or learn? 0:04:49.007,0:04:52.315 What's important to keep in mind[br]when you're defining the problem is 0:04:52.315,0:04:56.803 forget what you think you know [br]and question everything 0:04:56.803,0:05:01.622 Just think about open up your mind, question [br]everything and just define the problem 0:05:01.622,0:05:06.050 It's also important to get rid of [br]your emotions at this point 0:05:06.050,0:05:10.299 You want to, maybe you're on a tight deadline[br]maybe you think you know what the answer is 0:05:10.299,0:05:14.906 I'm just going to go do this. I already [br]know what's wrong blah blah blah 0:05:14.906,0:05:18.457 Get rid of all that and [br]just define the problem 0:05:18.457,0:05:20.904 You can do that by [br]answering a few questions 0:05:20.904,0:05:23.533 What is behavior that [br]you're expecting to happen? 0:05:23.533,0:05:26.162 What's actually happening? 0:05:26.162,0:05:28.792 and how are those two things different? 0:05:28.792,0:05:31.950 and how will you know [br]when you solved your problem? 0:05:31.950,0:05:35.550 What is your criteria for success? 0:05:35.550,0:05:38.616 This is particularly important when 0:05:38.616,0:05:42.492 when other people come and [br]ask you to help them troubleshoot 0:05:42.492,0:05:44.375 Don't listen to their assumptions. 0:05:44.375,0:05:46.238 Get rid of that out of the way. 0:05:46.238,0:05:49.192 and just start from scratch and [br]answer these simple questions 0:05:49.192,0:05:52.142 What do you want to happen? [br]What's actually happening? 0:05:52.142,0:05:55.012 How will you know when [br]you fixed the problem? 0:05:55.012,0:05:57.048 Once you defined your problem,[br] 0:05:57.048,0:05:59.474 you can start by doing [br]some background research 0:05:59.474,0:06:01.866 and in reality, you guys are already doing this. 0:06:01.866,0:06:04.258 Everyone's doing it. 0:06:04.258,0:06:06.652 In grad school, we would just be constantly reading 0:06:06.652,0:06:08.669 Before we would ever start an experiment,[br] 0:06:08.669,0:06:11.716 we would just be reading for days and days and days 0:06:11.716,0:06:14.190 Reading recent articles 0:06:14.190,0:06:18.034 or sometimes really old article that we would have to go to the library and dig up 0:06:18.034,0:06:20.780 We were just constantly reading 0:06:20.780,0:06:25.167 And the reason is because you want [br]to have enough background information 0:06:25.167,0:06:30.506 So that you know you're starting [br]with the right experiment 0:06:30.506,0:06:33.556 As a scientist, it's really expensive both[br] 0:06:33.556,0:06:36.606 It cost a lot of time and money to do an experiment 0:06:36.606,0:06:39.656 So you want to make sure you're starting with the right experiment 0:06:39.656,0:06:44.627 and you do that by making sure you have enough background information 0:06:44.627,0:06:47.878 As a developer, you can do that by knowing your environment 0:06:47.878,0:06:51.072 So you need to know the language that you're working in 0:06:51.072,0:06:54.285 and you can always become a little more familiar with it 0:06:54.285,0:06:58.227 go dig in that dark area that you're unfamiliar with 0:06:58.227,0:07:00.884 or how does this work? What's going on here? 0:07:00.884,0:07:04.063 When you're working on a specific application, 0:07:04.063,0:07:07.622 you can look at what are the dependencies that you're using 0:07:07.622,0:07:13.183 Get to know those and even which version of those dependency are you using 0:07:13.183,0:07:16.859 For the case of the factory girl sequencing, 0:07:16.859,0:07:20.165 probably just taking a look at the documentation might have helped 0:07:20.165,0:07:23.802 Oh, I'm missing the hash symbol. That's it. 0:07:23.802,0:07:26.147 You also want to be reading the literature 0:07:26.147,0:07:29.294 You want to stay up to date with blog post 0:07:29.294,0:07:32.380 Always be reading what's coming out, [br]what's new 0:07:32.380,0:07:36.571 There's always a lot of content out there,[br]so you want to be reading it 0:07:36.571,0:07:38.635 For your specific dependency, 0:07:38.635,0:07:40.401 you can look at the README 0:07:40.401,0:07:43.307 or the changelog for the most recent version 0:07:43.307,0:07:45.645 What changed, what's different 0:07:45.645,0:07:49.754 You can also look at the specific source code[br]of the version you're using 0:07:49.754,0:07:53.901 Either on GitHub or using bundle open and the gem name 0:07:53.901,0:07:56.796 You can pull it right up, [br]right on your computer 0:07:56.796,0:07:59.734 And dig around in there.[br]Look at what's going on. 0:07:59.734,0:08:03.122 And also a helpful thing is to look at the test suite 0:08:03.122,0:08:05.612 of this dependency that you're looking at 0:08:05.612,0:08:08.280 Sometimes that helps you tell [br]the expect behavior of the gem[br] 0:08:08.280,0:08:10.528 What's suppose to be happening 0:08:11.348,0:08:14.996 Another helpful source of background information is[br]just discussion 0:08:14.996,0:08:17.138 with your friends and colleagues 0:08:17.138,0:08:19.840 Maybe they have already encounter your problem 0:08:19.840,0:08:22.263 and they know the perfect solution 0:08:22.263,0:08:25.531 The best first experiment for you to start with[br] 0:08:25.531,0:08:27.244 That's really hellpful 0:08:27.244,0:08:30.949 Particularly, when you're struggling on a problem 0:08:30.949,0:08:33.274 maybe you been working on it for a long time 0:08:33.274,0:08:34.881 and you're not getting anywhere 0:08:34.881,0:08:37.842 it's time to get up and go ask somebody for help 0:08:37.842,0:08:39.743 Have you seen anything like this? 0:08:39.743,0:08:42.176 And that's exactly what my colleague did 0:08:42.176,0:08:43.755 They popped in the company chatroom 0:08:43.755,0:08:46.102 "Hey, I need some help on this" 0:08:46.102,0:08:47.754 We have a rule at Big Nerd Ranch 0:08:47.754,0:08:50.059 If you're working on something for more than an hour 0:08:50.059,0:08:51.424 and you're not making progress 0:08:51.424,0:08:52.450 Don't! 0:08:52.450,0:08:54.800 It's time to stop and go ask somebody for help[br] 0:08:54.800,0:08:57.600 It's better to get help from other people 0:08:57.600,0:09:02.769 And of course, sometime the good [br]old rubber duck is a good helpful solution 0:09:02.769,0:09:04.798 Maybe the rubber duck doesn't talk back, 0:09:04.798,0:09:06.934 but just by explaining your problem 0:09:06.934,0:09:12.140 and how you got there is a good way to get ideas 0:09:12.140,0:09:17.698 You also want to make sure you can [br]replicate the problem that you're having 0:09:17.698,0:09:19.185 Make it fail. 0:09:19.185,0:09:23.132 I mean can you even reproduce it? [br]Is it an error you can reproduce? 0:09:23.132,0:09:26.255 And what are the steps that it takes to do that 0:09:26.255,0:09:27.927 Once you have that information, 0:09:27.927,0:09:30.099 you can go ahead and write an automated test 0:09:30.099,0:09:32.223 to help you solve that problem 0:09:32.803,0:09:35.507 After you gather a lot of background information, 0:09:35.507,0:09:38.213 you can then establish a hypothesis 0:09:38.213,0:09:43.768 A hypothesis needs to be educated and based in evidence 0:09:43.768,0:09:46.388 So this goes back to all the research [br]that you've been doing 0:09:46.388,0:09:49.696 And it also need to be something that you can test 0:09:49.696,0:09:52.436 So this goes back to defining your problem 0:09:52.436,0:09:55.236 and your criteria for success 0:09:55.236,0:09:57.200 So once you have a hypothesis, 0:09:57.200,0:09:59.724 then you can start to design an experiment 0:09:59.724,0:10:02.141 And the most important part of an experiment design 0:10:02.141,0:10:04.781 is that it test your hypothesis, of course. 0:10:04.781,0:10:08.687 Don't do an experiment that doesn't test your hypothesis 0:10:08.687,0:10:11.715 Couple of tips for designing an experiment 0:10:11.715,0:10:16.294 One good thing to start with is just dividing and conquering your code base 0:10:16.294,0:10:19.387 Well first of all, hopefully you've [br]written an automated test 0:10:19.387,0:10:21.918 So you can just run that test over and over again 0:10:21.918,0:10:24.939 to focus on the condition that you're working on 0:10:24.939,0:10:30.240 So that isolate a lot other behavior that you don't [br]need to test immediately right now 0:10:30.240,0:10:33.821 Of course, you can always comment [br]out big chunks of codes 0:10:33.821,0:10:35.597 If you're like "I know this stuff is working. 0:10:35.597,0:10:37.201 Let me kind of comment it out 0:10:37.201,0:10:40.855 and just run the part of the code [br]that I need to look at right now." 0:10:40.855,0:10:45.359 Breakpoints are excellent helpful way to do it 0:10:45.359,0:10:47.515 Say your code has to go through 10 steps 0:10:47.515,0:10:49.751 and only the last one isn't working 0:10:49.751,0:10:51.462 Go ahead and enter a breakpoint 0:10:51.462,0:10:53.343 or a binding .pry right in there 0:10:53.343,0:10:58.276 You can stop and just look at the code is broken,[br]that is not working 0:11:00.446,0:11:02.230 You can also 0:11:02.230,0:11:06.285 Say you suspect there's a problem [br]with the dependency or a gem 0:11:06.285,0:11:08.590 What you can do is maybe create a new app 0:11:08.590,0:11:12.155 and only use that one dependency or API 0:11:12.155,0:11:13.872 Are you still having the problem? 0:11:13.872,0:11:17.469 OK, well maybe you just got rid of all [br]of the other code that you have written 0:11:17.469,0:11:18.886 and you know it just with that 0:11:18.886,0:11:21.070 you can replicate it in a fresh app 0:11:21.070,0:11:25.946 That's another way you can isolate the code 0:11:27.246,0:11:30.125 Another important thing is to limit the variables 0:11:30.125,0:11:31.484 that you're testing 0:11:31.484,0:11:34.355 When you look at beginner troubleshoot sometimes 0:11:34.355,0:11:37.374 They try to change many variables at once 0:11:37.374,0:11:39.337 Maybe it's a problem with the controller over here 0:11:39.337,0:11:42.970 and the view or maybe it's in the model. I don't know. 0:11:42.970,0:11:46.953 and sometimes they get down a road[br]that's really hard to come back from 0:11:46.953,0:11:50.885 and they can't even answer the question [br]"what has changed?" 0:11:50.885,0:11:52.543 So you really don't want to do that 0:11:52.543,0:11:56.125 You want to limit your experiment [br]to one variable at a time. 0:11:56.125,0:11:58.218 Let's test one variable 0:11:58.218,0:12:01.043 and finish our experiment before we start another one 0:12:01.043,0:12:02.698 so that we know 0:12:02.698,0:12:07.644 and we need to make sure we do [br]the analysis part of the experiment 0:12:07.644,0:12:11.734 Don't be afraid to try something weird 0:12:11.734,0:12:14.050 Sometimes, you know you think, you're thinking 0:12:14.050,0:12:16.816 "Ah this never gonna work[br]but I'll try it anyway." 0:12:16.816,0:12:20.282 And you try it and you find your solution 0:12:20.282,0:12:23.107 Don't be afraid to do that.[br]Try something strange. 0:12:23.107,0:12:24.857 You can also try maybe 0:12:24.857,0:12:28.171 try something that you know is [br]going to break your program 0:12:28.171,0:12:30.488 Go throw some gibberish in there. [br]Type it in there. 0:12:30.488,0:12:32.618 And you know it's going to break it. 0:12:32.618,0:12:34.748 You know it's going to fail. 0:12:34.748,0:12:38.285 What happen when you run your program[br]and it doesn't fail? 0:12:38.285,0:12:40.308 Maybe that code was never even getting run 0:12:40.308,0:12:43.039 Maybe you're not including that file or something 0:12:43.039,0:12:45.592 So try something strange 0:12:45.592,0:12:48.108 A friend of mine told me a story the other day 0:12:48.108,0:12:50.724 about how they've created a table 0:12:50.724,0:12:53.495 anytime they were trying to do a join with that table, 0:12:53.495,0:12:56.266 it was throwing some obscure error [br]and they couldn't figure it out 0:12:56.266,0:12:59.037 What's wrong with this one table?[br]What's wrong with it? 0:12:59.037,0:13:01.462 So they ended up, they just 0:13:01.462,0:13:03.757 they got rid of the table 0:13:03.757,0:13:06.192 They created a new one and they named it Bananas. [br] 0:13:06.192,0:13:07.626 Just something weird. 0:13:07.626,0:13:09.410 Like just do it weird. 0:13:09.410,0:13:11.387 And that actually fixed their problem.[br] 0:13:11.387,0:13:12.924 So Bananas worked. 0:13:12.924,0:13:14.407 And they're just like "What? What is going on? 0:13:14.407,0:13:16.240 Why? Why did that work" 0:13:16.240,0:13:21.195 and it turned out they had named[br]their original table attributes 0:13:21.945,0:13:25.321 So of course that's a protected name [br]so it didn't work 0:13:25.321,0:13:26.983 So trying something weird, 0:13:26.983,0:13:30.385 naming the table Bananas, [br]that worked for them. 0:13:31.555,0:13:34.847 How many of you have ever [br]done something like this? 0:13:34.847,0:13:37.710 Where you dig, you super deep dive. Yeah. 0:13:37.710,0:13:39.820 You're like oh it's way down here. 0:13:39.820,0:13:41.690 There's some weird problem. 0:13:41.690,0:13:43.930 And it ends up being [br]just right on the surface. 0:13:43.930,0:13:45.660 Something simple. 0:13:46.140,0:13:47.978 When you're designing your experiment, 0:13:47.978,0:13:49.546 you want to focus on 0:13:49.546,0:13:52.156 Think about the hierarchy of blame. 0:13:52.156,0:13:53.441 Think about OK, 0:13:53.441,0:13:57.246 what is the most likely [br]candidate for this problem? 0:13:57.246,0:14:00.474 Once you eliminated [br]the most likely candidates, 0:14:00.474,0:14:03.952 then you can go on[br]to the harder problems 0:14:03.952,0:14:05.052 For example, 0:14:05.052,0:14:07.246 more recently changed code 0:14:07.246,0:14:10.250 is probably more likely to be at fault 0:14:10.250,0:14:13.894 than codes that's been in [br]production for a long time 0:14:13.894,0:14:16.178 and something that you wrote 0:14:16.178,0:14:19.332 is probably more likely to[br]be the problem than say, 0:14:19.332,0:14:21.106 something in Ruby 0:14:22.156,0:14:26.413 But through your experiments go ahead [br]and eliminate the most likely candidate 0:14:26.413,0:14:28.230 and then work your way down 0:14:28.230,0:14:32.419 Don't start by trying to figure out [br]what's wrong with Ruby 0:14:32.979,0:14:35.138 After you designed your experiment, 0:14:35.138,0:14:36.997 go ahead and carry it out 0:14:36.997,0:14:38.867 and you're going to start [br]gathering your data 0:14:38.867,0:14:41.787 that you're going to use for your analysis 0:14:42.687,0:14:44.441 So you need to think about OK, 0:14:44.441,0:14:46.825 what's the current status of your program now? 0:14:46.825,0:14:48.267 What's happening now? 0:14:49.167,0:14:50.795 Were there any changes? 0:14:50.795,0:14:52.487 Are there any new messages? 0:14:52.487,0:14:55.539 Are there any new results from your experiment? 0:14:55.539,0:14:57.390 What else changed recently? 0:14:57.390,0:14:59.597 Were there any other things that you changed? 0:14:59.597,0:15:01.644 What does the log file say? 0:15:01.644,0:15:04.142 Gather all that information 0:15:04.522,0:15:06.250 And this one may seem obvious 0:15:06.250,0:15:09.498 but it need to be said [br]even for senior developers 0:15:09.498,0:15:11.737 Read the error message! 0:15:11.737,0:15:12.781 Just read it. 0:15:12.781,0:15:13.927 Read it out loud. 0:15:13.927,0:15:15.447 Even that alone will help it. 0:15:15.447,0:15:16.357 Just read it. 0:15:16.917,0:15:18.385 Take a look at the stack trace. 0:15:18.385,0:15:19.827 Look at the line number. 0:15:19.827,0:15:21.122 What's going on? 0:15:21.122,0:15:24.113 That's very useful information for a reason 0:15:24.113,0:15:26.027 So gather that information 0:15:26.027,0:15:28.091 as part of your experiment. 0:15:29.011,0:15:30.440 Once you have all your data, 0:15:30.440,0:15:32.519 you can start doing your analysis 0:15:32.519,0:15:35.140 and you really don't [br]want to skip this part 0:15:35.140,0:15:36.912 This is the most important part 0:15:36.912,0:15:39.424 because this where the learning happens 0:15:39.424,0:15:42.058 This is where you level up as a developer 0:15:43.048,0:15:46.441 and it's built right into the scientific method 0:15:47.801,0:15:49.218 So now that you've done your experiment 0:15:49.218,0:15:51.138 Did it solve your problem? 0:15:51.138,0:15:53.828 That test that you wrote, is it passing now? 0:15:53.828,0:15:56.030 and what about all the rest of your test suite? 0:15:56.030,0:15:58.622 Make sure it's also passing 0:15:58.622,0:16:02.106 Make sure you solved your problem [br]without breaking something else 0:16:02.106,0:16:06.297 And make sure you met all [br]your criteria for success 0:16:07.227,0:16:09.079 And you also want to think about 0:16:09.079,0:16:12.191 what did you learn from that experiment? 0:16:12.191,0:16:14.924 What information can you get from that? 0:16:14.924,0:16:17.366 Don't just move on to the next thing and say 0:16:17.366,0:16:19.628 "OK, it's fixed now. Let's go" 0:16:20.068,0:16:21.632 And take a moment, 0:16:21.632,0:16:24.251 Take the time to reflect on your experiment. 0:16:24.251,0:16:27.250 What went well? [br]What didn't go well? 0:16:27.250,0:16:28.931 Think about that 0:16:29.431,0:16:30.799 And most importantly, 0:16:30.799,0:16:32.840 you need to understand 0:16:32.840,0:16:35.892 why you solved your problem 0:16:35.892,0:16:37.674 Have you ever said, 0:16:37.674,0:16:41.187 "Well, I don't why it works, [br]but it works." 0:16:41.997,0:16:44.185 I have news for you. [br]You didn't fix it. 0:16:44.185,0:16:46.553 You didn't solve your problem. 0:16:47.223,0:16:49.140 It's the understanding 0:16:49.140,0:16:52.077 that cement the knowledge in your brain. 0:16:52.077,0:16:54.574 That's what make you a better developer. 0:16:54.574,0:16:57.076 And for those of you in leadership positions, 0:16:57.076,0:16:59.908 maybe you're teaching a newer developer 0:16:59.908,0:17:03.741 It's important that you make sure[br]that they understand the why 0:17:03.741,0:17:06.126 So make them explain it to you, 0:17:06.126,0:17:08.761 Why did this change solved your problem? 0:17:10.441,0:17:12.564 Your results from your experiment 0:17:12.564,0:17:14.379 will also help you determine 0:17:14.379,0:17:17.704 what's going to happen in your next experiment. 0:17:17.704,0:17:19.809 Maybe you solved your problem already 0:17:19.809,0:17:22.534 and you don't have to do another experiment 0:17:22.534,0:17:25.881 but it will influence your experiment in the future 0:17:25.881,0:17:29.259 Maybe now you know [br]a better first experiment to start with 0:17:29.259,0:17:30.040 "I know. 0:17:30.040,0:17:32.691 I know the fix. [br]I'll start with this next time." 0:17:32.691,0:17:34.883 Or if you didn't solve your problem, 0:17:34.883,0:17:37.255 maybe you have a new error message 0:17:37.255,0:17:38.797 "Ok, you can work with that. 0:17:38.797,0:17:40.649 Now what's the new experiment?" 0:17:40.649,0:17:42.997 Or "Oh maybe it's a problem with this gem. 0:17:42.997,0:17:46.605 I should do more [br]background research on that" 0:17:47.925,0:17:49.899 Another important part of the analysis 0:17:49.899,0:17:52.423 is embracing your successes. 0:17:52.723,0:17:54.206 This is really important. 0:17:54.206,0:17:55.368 A lot of people they just, 0:17:55.368,0:17:57.133 they sort of skip over this part 0:17:57.133,0:17:58.998 and go back to work 0:17:59.278,0:18:00.974 But it's really important. 0:18:01.164,0:18:03.498 If you did solve your problem, 0:18:03.498,0:18:05.302 let that sink in 0:18:05.302,0:18:06.884 because that's going to drive you 0:18:06.884,0:18:09.286 for future troubleshooting problems 0:18:09.736,0:18:11.610 You need to remember all those problems 0:18:11.610,0:18:13.139 that you solved before 0:18:13.139,0:18:14.758 and know that you can do it 0:18:14.758,0:18:16.907 and that you can keep going 0:18:17.027,0:18:18.956 And even if you didn't solved [br]your problem this time 0:18:18.956,0:18:20.645 and you're still working on it 0:18:20.645,0:18:23.000 maybe you got a new error message. 0:18:23.000,0:18:27.655 That's progress and that's [br]something to be celebrated 0:18:29.535,0:18:32.101 Another important part of being a scientist 0:18:32.101,0:18:34.137 is keeping a good lab notebook 0:18:34.137,0:18:35.981 and the reason you do this is because 0:18:35.981,0:18:39.545 it tells the story of your experiences 0:18:39.545,0:18:43.258 either to you in the future when [br]you're going back to look at it 0:18:43.258,0:18:45.231 or to somebody else 0:18:45.231,0:18:47.844 maybe another developer in the future 0:18:47.924,0:18:51.054 So this is the picture of one of my [br]lab notebook from grad school. 0:18:51.054,0:18:55.402 I probably filled about 10 of these [br]and they're like 300 pages each 0:18:55.402,0:18:58.716 So I did a lot of documenting in grad school. 0:18:58.716,0:19:01.026 The reason I included this is just to say 0:19:01.026,0:19:05.336 " it's OK to have a paper lab notebook [br]and write the things that you're doing 0:19:05.336,0:19:08.606 That's OK. Digital work also." 0:19:08.826,0:19:11.076 And the reason you keep [br]a lab notebook is because 0:19:11.076,0:19:13.796 you're just not going to remember it 0:19:13.796,0:19:15.898 you're not going to remember 0:19:15.898,0:19:16.899 As a grad student, 0:19:16.899,0:19:20.900 we probably did about 20 to [br]30 experiments a day 0:19:21.340,0:19:24.273 each just changing one variable at a time. 0:19:24.273,0:19:26.621 And there's just no way we would've remember 0:19:26.621,0:19:28.879 all of the things that we tried 0:19:28.879,0:19:32.551 And think about how many experiments [br]you do as a developer each day 0:19:32.551,0:19:34.783 when you're troubleshooting 0:19:35.363,0:19:36.961 And maybe you think 0:19:36.961,0:19:40.089 "OK, well I'm already just [br]recording all this stuff in the log. 0:19:40.089,0:19:41.993 It's all saved over there. 0:19:41.993,0:19:44.257 I can always go back and look 0:19:44.257,0:19:48.572 But that's not an sufficient lab notebook 0:19:48.572,0:19:53.096 Too much information can be just[br]as bad as too little information 0:19:53.096,0:19:54.379 So it's up to you 0:19:54.379,0:19:58.512 to glean the meaning from [br]these experiment that you're doing 0:19:58.512,0:20:00.736 and record that 0:20:00.736,0:20:04.416 One of the best first step for[br]keeping a good lab notebook 0:20:04.416,0:20:06.796 is writing a good commit message 0:20:06.806,0:20:08.917 It's all fresh in your brain 0:20:08.917,0:20:11.685 and so you can maybe you solve the problem 0:20:11.685,0:20:14.073 so you can commit that change and push it 0:20:14.073,0:20:16.242 So write some explanation in that 0:20:16.242,0:20:19.634 that commit message and let [br]people know what's going on 0:20:19.634,0:20:21.771 and people will see this in the future 0:20:21.771,0:20:23.985 Either you'll come back and look at it 0:20:23.985,0:20:28.529 or maybe another developer who's working [br]in the codebase will come back and look 0:20:28.889,0:20:33.068 Additionally , if you added test for [br]the scenario that you're working on, 0:20:33.068,0:20:36.397 that's also a good documentation for what's going on. 0:20:36.397,0:20:38.340 "OK, this was the the problem. 0:20:38.340,0:20:40.193 We added a test for it now." 0:20:42.133,0:20:44.443 Also, right after you solve a problem, 0:20:44.443,0:20:46.393 you want to update the documentation. 0:20:46.393,0:20:48.285 Is it missing anything? 0:20:48.285,0:20:50.039 Did you have that error because 0:20:50.039,0:20:52.693 the documentation wasn't good enough? 0:20:52.693,0:20:54.698 So go ahead and go update the README. 0:20:54.698,0:20:58.153 Or maybe you were missing [br]some environment variable 0:20:58.153,0:21:01.627 Go ahead and set up an example[br]environment variable file 0:21:01.627,0:21:05.141 so people know "Hey, you need this thing." 0:21:05.141,0:21:06.935 to save them that time 0:21:06.935,0:21:09.135 So that's all part of good documentation. 0:21:09.135,0:21:10.375 so keep that 0:21:10.375,0:21:12.627 Set that up for other people. 0:21:12.627,0:21:15.310 You can also contribute to open source. 0:21:15.310,0:21:20.738 So say you find a problem in [br]someone else software or gem, 0:21:20.738,0:21:22.596 go ahead and let them know 0:21:22.596,0:21:26.996 So open up an issue on Github [br]if it doesn't already exist. 0:21:26.996,0:21:31.223 Let them know the step that [br]it takes to recreate this problem. 0:21:32.163,0:21:34.668 If you were able to write a test for it, 0:21:34.668,0:21:37.513 go ahead and submit a pull request with that test 0:21:37.513,0:21:40.976 Sometimes that's helpful even if you [br]don't know how to solve the problem. 0:21:40.976,0:21:42.591 That's helpful for maintainers to say 0:21:42.591,0:21:45.046 "Oh, this is the test that's failing." 0:21:45.046,0:21:46.088 And of course, 0:21:46.088,0:21:47.800 if you do know how how to solve the problem, 0:21:47.800,0:21:49.704 go ahead and submit a pull request for that 0:21:49.704,0:21:51.924 You just got some open source contribution 0:21:51.924,0:21:53.764 and that's awesome 0:21:54.984,0:21:58.774 You can also write about your experiences 0:22:00.464,0:22:03.420 Have you ever written something up and then 0:22:03.420,0:22:07.666 later down the road and you're like[br]googling for that same problem 0:22:07.666,0:22:10.437 and you come back and [br]you find your own blog post? 0:22:10.787,0:22:12.058 Yes. Yes. 0:22:12.058,0:22:16.218 And you're like "Man,[br]thank you so much old me. [br] 0:22:16.378,0:22:17.628 That was really helpful. 0:22:17.628,0:22:20.108 Thank you for writing that down." 0:22:20.108,0:22:22.775 So think about all those other people out there 0:22:22.775,0:22:25.632 that are getting the same reaction [br]when they find your blog post 0:22:25.632,0:22:28.428 and they're like "Man, that was really helpful blog post. 0:22:28.428,0:22:30.364 Thank you for writing that down." 0:22:30.364,0:22:33.080 So if you're not doing this already, [br]you should be doing this 0:22:33.080,0:22:34.784 Anyone can start a blog. 0:22:34.784,0:22:38.088 If you don't already have one, go start it. 0:22:39.522,0:22:42.061 You can also write failed experiment. 0:22:42.061,0:22:44.060 Don't be afraid to do that. 0:22:44.060,0:22:48.370 In grad school, we always joked about [br]starting a journal of failed experiments 0:22:48.370,0:22:51.671 That way we would publish a million papers that way 0:22:51.671,0:22:55.462 Like well, these are the million things[br]we tried and they didn't work 0:22:55.462,0:22:57.456 But that's OK. If you... 0:22:57.456,0:23:00.310 Sometimes that's also helpful 0:23:00.310,0:23:03.705 and maybe somebody comes along [br]and read this and can help you 0:23:03.705,0:23:05.085 and say "Hey, 0:23:05.085,0:23:07.095 you might try doing it this way. 0:23:07.095,0:23:09.387 That might solve your problem." 0:23:10.067,0:23:11.696 The most important part 0:23:11.696,0:23:16.005 about keeping a lab notebook[br]is sharing the the knowledge 0:23:16.005,0:23:18.489 In academia, it's all about 0:23:18.489,0:23:21.523 gaining knowledge and [br]then sharing that knowledge 0:23:21.523,0:23:24.958 either through publication [br]or through teaching 0:23:24.958,0:23:29.622 and I think developers can [br]really learn a lot from that 0:23:29.622,0:23:31.743 So as you're doing these experiments, 0:23:31.743,0:23:33.464 go ahead and share that information 0:23:33.464,0:23:35.417 Maybe tweet about it 0:23:35.417,0:23:38.510 or blog about it, like I said 0:23:38.510,0:23:42.124 or you can even come and present [br]a talk at a conference like this 0:23:42.124,0:23:44.361 "Hey, here's this weird [br]thing that I figured out. 0:23:44.361,0:23:46.368 Let me tell you about it." 0:23:47.057,0:23:49.817 So that's really the most important part 0:23:49.817,0:23:52.109 is sharing that knowledge with other people 0:23:52.109,0:23:54.211 and teaching it to other people 0:23:54.211,0:23:59.595 And so I'm really looking forward to [br]seeing all of your lab notebooks online. 0:23:59.595,0:24:01.542 Thanks very much