1 00:00:17,020 --> 00:00:18,240 CARLOS SOUZA: Thanks everyone for coming. 2 00:00:18,250 --> 00:00:21,660 It's a great pleasure to be here at RailsConf. 3 00:00:21,660 --> 00:00:24,060 Just so we know, who's go, coming to RailsConf 4 00:00:24,060 --> 00:00:28,810 for the first time? Wow. That's amazing. 5 00:00:28,810 --> 00:00:32,549 Cool. Welcome. And, we're gonna be talking 6 00:00:32,549 --> 00:00:35,910 to you today a little bit about Coding Dojo, 7 00:00:35,910 --> 00:00:38,550 and how you can use the Dojo to improve 8 00:00:38,550 --> 00:00:45,550 your coding skills and become better developers. 9 00:00:45,820 --> 00:00:47,890 My name's Carlos Souza, and this is my friend 10 00:00:47,890 --> 00:00:51,840 David Rogers. We, we're both from Orlando, Florida. We're 11 00:00:51,840 --> 00:00:55,949 from Code School, and we love development and we 12 00:00:55,949 --> 00:01:00,070 love teaching. And that love for development and for 13 00:01:00,070 --> 00:01:03,920 teaching others how to developer brought us to the 14 00:01:03,920 --> 00:01:07,430 Coding Dojo, and we formed our Coding Dojo group 15 00:01:07,430 --> 00:01:09,570 back in Orlando a couple of years back. And 16 00:01:09,570 --> 00:01:14,990 we ran that biweekly for about two and a 17 00:01:14,990 --> 00:01:16,509 half years? And we also used it, the Coding 18 00:01:16,509 --> 00:01:18,640 Dojo as a teaching tool. 19 00:01:18,640 --> 00:01:20,520 So what we're gonna do here today is try 20 00:01:20,520 --> 00:01:23,860 to teach you guys a little bit about our 21 00:01:23,860 --> 00:01:27,909 experience running the Dojo, and we're actually gonna run 22 00:01:27,909 --> 00:01:31,729 a Dojo here with you guys, and hopefully you, 23 00:01:31,729 --> 00:01:34,280 you can run Dojos on your own. At your 24 00:01:34,280 --> 00:01:37,460 company, with your friends, in your local meet ups. 25 00:01:37,460 --> 00:01:43,299 And this is a message to all developers, right. 26 00:01:43,299 --> 00:01:46,130 We're all developers here, even if you're not, if 27 00:01:46,130 --> 00:01:49,110 you don't spend your day-to-day coding, I'm gonna ask 28 00:01:49,110 --> 00:01:51,619 you to put on the developer hat for just 29 00:01:51,619 --> 00:01:53,890 a little bit to understand where we're coming from. 30 00:01:53,890 --> 00:01:56,270 And then the problems that we're trying to solve 31 00:01:56,270 --> 00:01:58,100 with the Coding Dojo. 32 00:01:58,100 --> 00:02:02,880 And we have different levels of exper- expertise, as 33 00:02:02,880 --> 00:02:06,049 developers. Maybe you're a beginner developer. You're just starting. 34 00:02:06,049 --> 00:02:08,758 You're on the first couple of years of, of 35 00:02:08,758 --> 00:02:12,190 working with the software development, with Ruby, with Rails. 36 00:02:12,190 --> 00:02:15,100 Maybe you just graduated a Dev BootCamp. Maybe you 37 00:02:15,100 --> 00:02:17,720 just graduated college, or maybe you're going through online 38 00:02:17,720 --> 00:02:20,410 classes and learning how to program in Ruby and 39 00:02:20,410 --> 00:02:22,450 JavaScript and whatever. 40 00:02:22,450 --> 00:02:24,389 Or maybe you're a little bit more advanced. You're 41 00:02:24,389 --> 00:02:28,040 more on the intermediate level. You've been working with 42 00:02:28,040 --> 00:02:30,639 the, some programming language and framework for a couple 43 00:02:30,639 --> 00:02:33,519 of years. You're starting to get more responsibilities at 44 00:02:33,519 --> 00:02:36,449 work. You're starting to lead projects. 45 00:02:36,449 --> 00:02:39,720 And maybe you're even more expert. Maybe you've been 46 00:02:39,720 --> 00:02:43,180 working with software development for maybe over a decade. 47 00:02:43,180 --> 00:02:45,669 Maybe you're an architect. Maybe you're responsible for the 48 00:02:45,669 --> 00:02:50,160 architectural decisions in your company. And, I guess, regardless 49 00:02:50,160 --> 00:02:53,730 of the level of expertise that you're at, you've 50 00:02:53,730 --> 00:02:57,320 probably realized that this point, the technology that you're 51 00:02:57,320 --> 00:03:01,359 working with, it gets better. It evolves. That's the 52 00:03:01,359 --> 00:03:04,910 natural way of things. The tools that we use, 53 00:03:04,910 --> 00:03:06,609 they are, they're getting better. 54 00:03:06,609 --> 00:03:10,010 And this, especially in the open source community, because 55 00:03:10,010 --> 00:03:12,359 there's sort of a natural selection. If something is 56 00:03:12,359 --> 00:03:14,940 not good enough for the community, the community will 57 00:03:14,940 --> 00:03:18,750 naturally look for better ways of doing something, for 58 00:03:18,750 --> 00:03:23,940 better practices, for better tools, for better frameworks. 59 00:03:23,940 --> 00:03:27,910 Just as an example, Rails has an average of 60 00:03:27,910 --> 00:03:32,900 a hundred commits every week. So, things change very, 61 00:03:32,900 --> 00:03:37,010 very, very fast. And, Rails is just one of 62 00:03:37,010 --> 00:03:39,220 the projects, or the tools that you use on 63 00:03:39,220 --> 00:03:42,010 your day to day, when you stop and think. 64 00:03:42,010 --> 00:03:46,400 You're using Rails, you're using Ruby, you're using, you're 65 00:03:46,400 --> 00:03:49,579 using Bundler. You're using a, a variety of open 66 00:03:49,579 --> 00:03:54,229 source tools, and they're always changing. Every day, there's 67 00:03:54,229 --> 00:03:57,609 many changes going into those projects. New features being 68 00:03:57,609 --> 00:04:02,169 added. Old features being removed. Existing features being changed. 69 00:04:02,169 --> 00:04:05,070 And it's really, really hard to keep track of 70 00:04:05,070 --> 00:04:07,759 all the changes that are going on in all 71 00:04:07,759 --> 00:04:10,120 the various tools that you're using. So, what I'm 72 00:04:10,120 --> 00:04:13,180 trying to say is that us, as developers, we 73 00:04:13,180 --> 00:04:16,040 are not necessarily getting better at the same pace 74 00:04:16,040 --> 00:04:19,130 that our tools are evolving. It's very hard to 75 00:04:19,130 --> 00:04:21,220 keep track of all the changes that are happening 76 00:04:21,220 --> 00:04:24,130 in the ecosystem. And still being able to put 77 00:04:24,130 --> 00:04:26,009 on your, your nine to five and pay the 78 00:04:26,009 --> 00:04:26,900 bills. 79 00:04:26,900 --> 00:04:31,120 And it's, it's good to look at other types 80 00:04:31,120 --> 00:04:34,340 of artists, other people that work with creativity or 81 00:04:34,340 --> 00:04:39,950 art. Say, musicians and athletes, that also rely on 82 00:04:39,950 --> 00:04:42,940 their art, right, and they, they need to practice, 83 00:04:42,940 --> 00:04:46,600 right. So martial artists, like the first guy on 84 00:04:46,600 --> 00:04:49,600 the, on the first slide, he goes to the 85 00:04:49,600 --> 00:04:54,030 gym 24/7. He's practicing a lot, right. Musicians - 86 00:04:54,030 --> 00:04:57,130 they practice a lot before going into the studio, 87 00:04:57,130 --> 00:04:58,440 before putting on a show. 88 00:04:58,440 --> 00:05:01,660 And. The microphone died. There's another one. Is, is 89 00:05:01,660 --> 00:05:07,780 there another microphone, perhaps? No? There's just one microphone. 90 00:05:07,780 --> 00:05:12,850 Oh man. That sucks. So. Well, so yeah. So, 91 00:05:12,850 --> 00:05:17,060 all these athletes and artists, they spend countless hours 92 00:05:17,060 --> 00:05:19,210 in the gym or at the studio practicing their 93 00:05:19,210 --> 00:05:22,040 art, so when the time comes to perform, they 94 00:05:22,040 --> 00:05:24,630 are prepared. So they all practice. 95 00:05:24,630 --> 00:05:27,680 You want to talk a little bit about practicing, 96 00:05:27,680 --> 00:05:28,190 David? 97 00:05:28,190 --> 00:05:32,510 DAVID ROGERS: Pass the mic. Yeah, so, I, you 98 00:05:32,510 --> 00:05:36,010 know, the one key point here is that as, 99 00:05:36,010 --> 00:05:37,950 as practitioners of an art or a craft, we 100 00:05:37,950 --> 00:05:42,040 need to practice as well. Anybody read Malcolm Gladwell's 101 00:05:42,040 --> 00:05:45,200 book Outliers, or heard of Outliers? I think the 102 00:05:45,200 --> 00:05:49,810 one take away from Outliers is that, the one, 103 00:05:49,810 --> 00:05:52,760 while it appears that some people are exceptional and 104 00:05:52,760 --> 00:05:55,420 live outside of the regular bell curve, what it 105 00:05:55,420 --> 00:05:57,660 actually turns out to be the case is that 106 00:05:57,660 --> 00:06:01,140 they were given, or have spent, much more time 107 00:06:01,140 --> 00:06:05,230 practicing. That, that, on average, it's somewhere around 10,000 108 00:06:05,230 --> 00:06:07,850 hours worth of practice in order to become an 109 00:06:07,850 --> 00:06:10,020 expert in a particular field was, that was his 110 00:06:10,020 --> 00:06:11,470 assertation. 111 00:06:11,470 --> 00:06:13,960 The one big take away from the book is 112 00:06:13,960 --> 00:06:15,910 that, that is ind of summed up in one 113 00:06:15,910 --> 00:06:18,330 quote there, that practice isn't the thing that you 114 00:06:18,330 --> 00:06:21,370 do once you get good. It is the thing 115 00:06:21,370 --> 00:06:23,600 that you do that makes you good. And, some 116 00:06:23,600 --> 00:06:26,440 of you might be saying, well, I practice. Of 117 00:06:26,440 --> 00:06:28,780 course I practice. I practice every day. I practice 118 00:06:28,780 --> 00:06:31,650 every day for nine hours, sometimes ten hours, occasionally 119 00:06:31,650 --> 00:06:35,330 twelve hours, sometimes twenty-four or seventy-two hours at a 120 00:06:35,330 --> 00:06:37,490 stint. And then eventually take a shower or die 121 00:06:37,490 --> 00:06:39,750 and fall into a coma. 122 00:06:39,750 --> 00:06:42,430 But, the key thing to remember there is that 123 00:06:42,430 --> 00:06:46,280 work does not equal practice. Like Carlos was saying, 124 00:06:46,280 --> 00:06:48,280 when you look at a martial artist or you 125 00:06:48,280 --> 00:06:50,370 look at a concert violinist, or you look at 126 00:06:50,370 --> 00:06:53,060 someone who practices a craft or a art for 127 00:06:53,060 --> 00:06:57,240 their profession, they don't perform nearly as much time 128 00:06:57,240 --> 00:06:59,990 as they practice. There's a def- there's a definite 129 00:06:59,990 --> 00:07:03,370 separation between the performance of their art and the 130 00:07:03,370 --> 00:07:05,270 practice of their art. 131 00:07:05,270 --> 00:07:07,490 So we can't really equate what we do on 132 00:07:07,490 --> 00:07:11,210 a daily basis, nine to five, as practice. That's 133 00:07:11,210 --> 00:07:15,340 work. We need, do ship software. We need to 134 00:07:15,340 --> 00:07:18,560 perform. We need to hit our deadlines. We're concerned 135 00:07:18,560 --> 00:07:22,710 with building stuff that works. Work time is not 136 00:07:22,710 --> 00:07:23,800 practice time. 137 00:07:23,800 --> 00:07:27,210 Well, then that brings up the inevitable question, how 138 00:07:27,210 --> 00:07:30,020 then, do we practice what it is that we 139 00:07:30,020 --> 00:07:34,020 do? And how should we practice what we do? 140 00:07:34,020 --> 00:07:36,669 What does practicing code actually look like? How do 141 00:07:36,669 --> 00:07:38,600 I practice, as a programmer? 142 00:07:38,600 --> 00:07:40,180 Well, one way we could do that is to 143 00:07:40,180 --> 00:07:43,490 emulate how other artists practice their art and their 144 00:07:43,490 --> 00:07:45,370 craft. 145 00:07:45,370 --> 00:07:49,990 C.S.: And we're talking about here, is, for example, 146 00:07:49,990 --> 00:07:53,960 martial arts. So we have the, the term Dojo, 147 00:07:53,960 --> 00:07:57,050 which in martial arts means, the place where people 148 00:07:57,050 --> 00:08:00,210 practice those arts. And this is a term that 149 00:08:00,210 --> 00:08:05,169 was coined by Dave Thomas of the Pragmatic Programmers. 150 00:08:05,169 --> 00:08:07,580 And he brought that to the programming world, saying 151 00:08:07,580 --> 00:08:10,360 we should set up a Dojo for programming, so 152 00:08:10,360 --> 00:08:13,850 we can practice code. 153 00:08:13,850 --> 00:08:18,300 D.R.: And the, the keys to a code Coding 154 00:08:18,300 --> 00:08:20,790 Dojo is that we are providing, just like in 155 00:08:20,790 --> 00:08:25,740 a martial arts setting, we're providing a safe, collaborative, 156 00:08:25,740 --> 00:08:30,300 non-competitive location at a, at a space and a 157 00:08:30,300 --> 00:08:34,820 time to practice together. We get together and we 158 00:08:34,820 --> 00:08:37,940 code. WE learn something. We actually practice programming. WE 159 00:08:37,940 --> 00:08:40,208 practice learning and teaching one another. And we also 160 00:08:40,208 --> 00:08:41,630 have a lot of fun. Just like you would 161 00:08:41,630 --> 00:08:43,479 if you, has anybody taken martial arts of any 162 00:08:43,479 --> 00:08:46,110 sort? Yoga counts. Well, I'll give you yoga, right, 163 00:08:46,110 --> 00:08:48,070 we'll give you yoga, right. 164 00:08:48,070 --> 00:08:52,820 So, that's, that's really the goal of the, the 165 00:08:52,820 --> 00:08:56,550 Dojo. But, how we actually live it out is, 166 00:08:56,550 --> 00:09:00,790 just like in martial arts, we practice Katas. And 167 00:09:00,790 --> 00:09:03,620 a Kata in martial arts is this kind of 168 00:09:03,620 --> 00:09:08,720 detailed choreography of very ritualized movements that you practice, 169 00:09:08,720 --> 00:09:11,810 either solo or in a pair or in a 170 00:09:11,810 --> 00:09:14,800 group. And they don't really have a direct translation 171 00:09:14,800 --> 00:09:17,240 to, if I was a martial artist, fighting another 172 00:09:17,240 --> 00:09:21,029 person. Like, I would not use my Kata skills 173 00:09:21,029 --> 00:09:23,839 to win a battle. But, they teach me how 174 00:09:23,839 --> 00:09:26,940 to punch. They teach me how to block. They 175 00:09:26,940 --> 00:09:30,070 teach me how to evade, through the choreography. So 176 00:09:30,070 --> 00:09:32,010 that when the time comes to actually block a 177 00:09:32,010 --> 00:09:35,000 punch or throw a punch, my body remembers even 178 00:09:35,000 --> 00:09:36,670 though my brain is not thinking about throwing a 179 00:09:36,670 --> 00:09:38,029 punch here. 180 00:09:38,029 --> 00:09:41,730 In programmer, as Carlos was saying, Dave Thomas, Pragmatic 181 00:09:41,730 --> 00:09:45,970 Programmer Dave, Prag Dave, coined this term to describe, 182 00:09:45,970 --> 00:09:47,400 along with Kent Beck and some of the other 183 00:09:47,400 --> 00:09:51,100 guys, Ward Cunningham, tried to describe a method of 184 00:09:51,100 --> 00:09:54,000 practice inside of a Dojo. So inside of a 185 00:09:54,000 --> 00:09:56,880 Coding Dojo, just like inside of a Karate Dojo, 186 00:09:56,880 --> 00:10:00,710 we practice Katas, which are choreographed patterns of movements 187 00:10:00,710 --> 00:10:03,890 that we practice either in solo or in pair, 188 00:10:03,890 --> 00:10:08,320 to reinforce skills that we don't necess- we wouldn't 189 00:10:08,320 --> 00:10:12,080 necessarily use in the choreographed pattern, but we would 190 00:10:12,080 --> 00:10:14,290 use on a daily basis when we actually come 191 00:10:14,290 --> 00:10:16,080 face-to-face with that variable that needs to be punched 192 00:10:16,080 --> 00:10:17,420 in the head. 193 00:10:17,420 --> 00:10:19,690 And we break that down, when we're talking about 194 00:10:19,690 --> 00:10:24,180 choreographed patterns, inside of the Dojo inside of a 195 00:10:24,180 --> 00:10:28,750 coding Kata, as Prag Dave coined it, we're talking 196 00:10:28,750 --> 00:10:31,080 about test-driven development. And, regardless of what you may 197 00:10:31,080 --> 00:10:36,420 have heard earlier today, tests are not the devil. 198 00:10:36,420 --> 00:10:39,120 They will not, they are not a sin, and 199 00:10:39,120 --> 00:10:40,810 a lot of the Pragmatic guys, a lot of 200 00:10:40,810 --> 00:10:42,980 the guys that we're talking about, that coined the 201 00:10:42,980 --> 00:10:47,290 terms the Dojo and Katas, were in that deck 202 00:10:47,290 --> 00:10:50,110 referring to just enough testing. 203 00:10:50,110 --> 00:10:52,310 What we're doing in the Dojo is not just 204 00:10:52,310 --> 00:10:56,040 enough testing. It is way-too-much testing, so that we 205 00:10:56,040 --> 00:10:59,870 can practice the art of testing. When we practice 206 00:10:59,870 --> 00:11:02,320 martial arts, and we learn a Kata in martial 207 00:11:02,320 --> 00:11:05,480 arts, we're not punching just enough. We're punching a 208 00:11:05,480 --> 00:11:08,350 whole lot, so that when the time comes to 209 00:11:08,350 --> 00:11:10,690 actually punch, we know how much to punch and 210 00:11:10,690 --> 00:11:13,120 with how much force we're to punch. 211 00:11:13,120 --> 00:11:14,770 C.S.: And it's, it's kind of, if you play 212 00:11:14,770 --> 00:11:18,610 a musical instrument, you, and you practice that musical 213 00:11:18,610 --> 00:11:21,170 instrument, chances are, you're practicing along with a metronome. 214 00:11:21,170 --> 00:11:23,290 And I like to make that analogy between a 215 00:11:23,290 --> 00:11:27,589 metronome and writing tests when you're practicing, right. So 216 00:11:27,589 --> 00:11:30,230 you need to metronome when you're practicing music to 217 00:11:30,230 --> 00:11:33,310 keep that pace, so you can focus on repeating 218 00:11:33,310 --> 00:11:36,850 your movements very, very slowly, and with very close 219 00:11:36,850 --> 00:11:40,910 attention, so you can gradually increase the speed to 220 00:11:40,910 --> 00:11:43,589 which you play, to get to the point where 221 00:11:43,589 --> 00:11:46,470 you're shredding that speed solo. And then when you 222 00:11:46,470 --> 00:11:49,029 play that live it just feels natural. 223 00:11:49,029 --> 00:11:50,830 But, for you to get to that point, you 224 00:11:50,830 --> 00:11:52,870 needed to start very slowly, and you needed a 225 00:11:52,870 --> 00:11:56,050 tool to assist you. In music, that's the metronome. 226 00:11:56,050 --> 00:12:00,730 In coding, that's test-driven development. That's writing tests. And, 227 00:12:00,730 --> 00:12:03,200 like Dave said, in the Coding Dojo, we're not 228 00:12:03,200 --> 00:12:06,620 practicing just enough tests. We're practicing a whole lot 229 00:12:06,620 --> 00:12:08,880 of tests. So when the time comes for you 230 00:12:08,880 --> 00:12:11,470 to write production code, you'll naturally be able to 231 00:12:11,470 --> 00:12:15,670 tell whether you need to test-drive that feature or 232 00:12:15,670 --> 00:12:19,660 not. 233 00:12:19,660 --> 00:12:23,810 And one other thing that we practice is pair 234 00:12:23,810 --> 00:12:26,690 programming. And pair programming is not just sitting down 235 00:12:26,690 --> 00:12:29,709 and coding next to someone. It requires a set 236 00:12:29,709 --> 00:12:33,360 of social skills. It requires knowing how to suggest 237 00:12:33,360 --> 00:12:36,220 a feature, knowing how to accept a suggestion, knowing 238 00:12:36,220 --> 00:12:38,300 how to accept a criticism, and not take it 239 00:12:38,300 --> 00:12:41,370 personally. So there's way more to pair programming than 240 00:12:41,370 --> 00:12:44,300 simply sitting next to each other and either watching 241 00:12:44,300 --> 00:12:46,540 them code or telling them what to code. 242 00:12:46,540 --> 00:12:49,600 D.R.: And, and again, like, like Kaikay was saying, 243 00:12:49,600 --> 00:12:53,480 these are, these are social skills. And while they 244 00:12:53,480 --> 00:12:57,610 might be accentuated inside of the Dojo, they definitely 245 00:12:57,610 --> 00:12:59,860 have a lasting impact as a programmer. I, I 246 00:12:59,860 --> 00:13:03,160 personally, and Kaikay, we both pair program as a 247 00:13:03,160 --> 00:13:06,440 part of our writing production code, as a part 248 00:13:06,440 --> 00:13:10,950 of our performant art, and we've found a huge 249 00:13:10,950 --> 00:13:15,350 increase in our productivity whenever we selectively and intentionally 250 00:13:15,350 --> 00:13:16,170 pair with others. 251 00:13:16,170 --> 00:13:17,510 Maybe we don't do it all the time. We 252 00:13:17,510 --> 00:13:18,890 certainly don't do it all the time, because sometimes 253 00:13:18,890 --> 00:13:22,500 you just gotta get stuff done, right. But when 254 00:13:22,500 --> 00:13:24,750 we do pair, we know the etiquettes, we know 255 00:13:24,750 --> 00:13:28,279 the social currency to be able to use one 256 00:13:28,279 --> 00:13:30,980 of the styles of pair programming. Be it pilot, 257 00:13:30,980 --> 00:13:33,399 co-pilot, where I sit back and Kaikay's on the 258 00:13:33,399 --> 00:13:37,830 keyboard and he types into the, into the editor 259 00:13:37,830 --> 00:13:42,110 and I make suggestions, or I notice syntax errors 260 00:13:42,110 --> 00:13:45,029 or I ask him questions about what he's doing 261 00:13:45,029 --> 00:13:46,700 and he tells me how he's going to do 262 00:13:46,700 --> 00:13:49,520 something, and then we switch and I start typing 263 00:13:49,520 --> 00:13:52,440 and he plays co-pilot and helps keep me, navigating. 264 00:13:52,440 --> 00:13:54,480 Or you use a ping-pong type approach. There's lots 265 00:13:54,480 --> 00:13:56,080 of different types that we can, that we can 266 00:13:56,080 --> 00:13:59,089 use. For the Coding Dojo, especially when we're talking 267 00:13:59,089 --> 00:14:03,459 about small pairs or to practice pair programming, in 268 00:14:03,459 --> 00:14:06,029 this Coding Dojo we're gonna use a ping pong 269 00:14:06,029 --> 00:14:07,589 approach. And in that, and that approach is a 270 00:14:07,589 --> 00:14:11,610 lot like playing ping pong. One person serves the 271 00:14:11,610 --> 00:14:14,730 ball by writing some tests, and the tests then 272 00:14:14,730 --> 00:14:18,550 fail, right. Test-driven development. We do red-green-refactor. So the 273 00:14:18,550 --> 00:14:22,180 tests fail. Then he passes the mic over to 274 00:14:22,180 --> 00:14:25,440 the pair, his, his partner then writes some code 275 00:14:25,440 --> 00:14:27,910 to pass the test. They might talk, the pair 276 00:14:27,910 --> 00:14:30,050 will talk through it, but write some code to 277 00:14:30,050 --> 00:14:32,880 pass the tests. And then, immediately writes another test 278 00:14:32,880 --> 00:14:35,279 that will fail, to serve the ball back across 279 00:14:35,279 --> 00:14:37,120 the net to his partner. 280 00:14:37,120 --> 00:14:39,010 We'll see an example of that a little bit 281 00:14:39,010 --> 00:14:41,240 later. We'll do a, a, what's called a practice 282 00:14:41,240 --> 00:14:43,580 Kata. But, Kaikay, why don't you tell us a 283 00:14:43,580 --> 00:14:45,670 little bit more about the different types of Katas 284 00:14:45,670 --> 00:14:46,200 that we could do. 285 00:14:46,200 --> 00:14:48,850 Anybody have any questions so far, before we, before 286 00:14:48,850 --> 00:14:51,149 we go on? Is everybody tracking on that, you 287 00:14:51,149 --> 00:14:54,690 know, for, four to five fingers? Perhaps just one. 288 00:14:54,690 --> 00:14:57,220 One finger. No? OK. 289 00:14:57,220 --> 00:15:01,250 C.S.: So there, there's different types of Katas. The 290 00:15:01,250 --> 00:15:04,390 three most popular, I want to say, the Randori 291 00:15:04,390 --> 00:15:07,970 Kata, the Prepared and the Code Retreat, which is 292 00:15:07,970 --> 00:15:09,760 more like an event, but we're gonna treat it 293 00:15:09,760 --> 00:15:10,550 as a Kata. 294 00:15:10,550 --> 00:15:14,170 And the Randori Kata is the most popular for 295 00:15:14,170 --> 00:15:17,959 meet ups and schools and university. David is a 296 00:15:17,959 --> 00:15:21,149 teacher at a local university in Orlando, and he 297 00:15:21,149 --> 00:15:23,890 uses Coding Dojo as part of the curriculum. 298 00:15:23,890 --> 00:15:26,450 And the way that the Randori works, you have 299 00:15:26,450 --> 00:15:29,420 one computer, and the code in that computer is 300 00:15:29,420 --> 00:15:33,290 projected onto a screen, where an audience, between five 301 00:15:33,290 --> 00:15:34,990 and fifteen people, a little bit more than that 302 00:15:34,990 --> 00:15:37,269 gets a little bit confusing. So, the audience is 303 00:15:37,269 --> 00:15:41,870 watching the code, is watching the evolution of the 304 00:15:41,870 --> 00:15:44,040 code towards the solution all the time. So they're 305 00:15:44,040 --> 00:15:46,890 constantly, you know, learning things and watching where the 306 00:15:46,890 --> 00:15:49,019 pair is going with the code. 307 00:15:49,019 --> 00:15:52,390 And, in the computer, there's always two people pair 308 00:15:52,390 --> 00:15:55,899 programming. The pilot and the co-pilot. And every three 309 00:15:55,899 --> 00:15:59,980 to seven minutes, they rotate. So, the driver goes 310 00:15:59,980 --> 00:16:03,029 back to the audience. The co-pilot becomes the pilot. 311 00:16:03,029 --> 00:16:06,120 And someone from the audience volunteers to be the 312 00:16:06,120 --> 00:16:08,230 co-pilot. So that way we have everyone in the 313 00:16:08,230 --> 00:16:10,880 room collaborating towards learning. 314 00:16:10,880 --> 00:16:14,240 D.R.: And, and like Carlos was saying, I, I 315 00:16:14,240 --> 00:16:17,450 used this in my, in my courses at Valencia. 316 00:16:17,450 --> 00:16:20,930 We, we spend, it's an Introduction to Programming course 317 00:16:20,930 --> 00:16:23,399 where we spend the first half of the course 318 00:16:23,399 --> 00:16:26,970 learning the concepts of programming and practicing reading the 319 00:16:26,970 --> 00:16:30,260 code, reading open source projects, identifying pieces of the 320 00:16:30,260 --> 00:16:31,990 code that we've talked about, and the second half 321 00:16:31,990 --> 00:16:34,910 of the class is all these Coding Dojos, these 322 00:16:34,910 --> 00:16:37,370 Randori-style Coding Dojos. 323 00:16:37,370 --> 00:16:39,600 Over the, the couple years that we ran the 324 00:16:39,600 --> 00:16:43,240 Coding Dojo in Orlando, we got a mixed bag 325 00:16:43,240 --> 00:16:45,620 of folks from all over the spectrum. People that 326 00:16:45,620 --> 00:16:48,269 had no coding experience all the way up to 327 00:16:48,269 --> 00:16:50,089 people that had been coding for years and years 328 00:16:50,089 --> 00:16:53,209 and years and years. And strangely enough, the super 329 00:16:53,209 --> 00:16:56,070 experts were the ones that were least interested in 330 00:16:56,070 --> 00:16:57,290 the format. 331 00:16:57,290 --> 00:16:59,810 But we used it as a method of teaching 332 00:16:59,810 --> 00:17:05,419 ourselves new tools, new techniques, completely different languages. Our 333 00:17:05,419 --> 00:17:07,609 first attempt at a Python Coding Dojo was a 334 00:17:07,609 --> 00:17:10,819 complete dog's breakfast. But we came back, we learned, 335 00:17:10,819 --> 00:17:12,898 we learned enough Python that now I actually run 336 00:17:12,898 --> 00:17:16,349 the Python user group in Orlando, and teach other 337 00:17:16,349 --> 00:17:19,019 people how to use Python and when to use 338 00:17:19,019 --> 00:17:20,739 Python and that sort of thing. 339 00:17:20,739 --> 00:17:22,309 We, we taught a bunch of people Ruby. We've 340 00:17:22,309 --> 00:17:24,409 taught a bunch of people JavaScript, learned that there 341 00:17:24,409 --> 00:17:26,789 are like seventeen different JavaScript frameworks, and a new 342 00:17:26,789 --> 00:17:32,179 one every week, to run tests or implement assertions. 343 00:17:32,179 --> 00:17:33,340 That's always fun. 344 00:17:33,340 --> 00:17:34,509 But the, the key is, we give them, we 345 00:17:34,509 --> 00:17:37,470 give everybody a time box and we wait for, 346 00:17:37,470 --> 00:17:40,429 either everyone gets a chance to code, we solve 347 00:17:40,429 --> 00:17:42,279 the problem - which very rarely happens - or 348 00:17:42,279 --> 00:17:44,519 we have it, the entire thing time-boxed to maybe 349 00:17:44,519 --> 00:17:46,179 a two hour time frame. 350 00:17:46,179 --> 00:17:47,489 So that really works well for a lot of 351 00:17:47,489 --> 00:17:49,139 people, like a classroom setting where you know you 352 00:17:49,139 --> 00:17:52,330 have x number of hours to participate, and you 353 00:17:52,330 --> 00:17:54,419 have, you know, somewhere between that magic number of 354 00:17:54,419 --> 00:17:56,399 five to fifteen people so that everyone can get 355 00:17:56,399 --> 00:17:59,499 a chance to code inside of that two hours. 356 00:17:59,499 --> 00:18:01,799 C.S.: And one thing worth mentioning, too, is that 357 00:18:01,799 --> 00:18:03,899 the Randori-style Kata is also a great way to 358 00:18:03,899 --> 00:18:06,940 interview potential developer candidates. If you want to move 359 00:18:06,940 --> 00:18:08,769 away from the typical, where do you see yourself 360 00:18:08,769 --> 00:18:11,350 in five years? And cut that, cut out all 361 00:18:11,350 --> 00:18:13,190 that bull shit, and get to what matters, which 362 00:18:13,190 --> 00:18:16,419 is coding and seeing, you know, how efficient your 363 00:18:16,419 --> 00:18:19,669 developer is, and how willing to pair program, how 364 00:18:19,669 --> 00:18:21,950 willing to collaborate he is. The Coding Dojo, I 365 00:18:21,950 --> 00:18:23,549 want to say, is the best way to do 366 00:18:23,549 --> 00:18:26,470 that, right. Because you're hiring someone to be a 367 00:18:26,470 --> 00:18:26,799 developer. 368 00:18:26,799 --> 00:18:29,129 So, sit with them, code with them. Seeing how 369 00:18:29,129 --> 00:18:32,850 well the fit with the culture, with the pair 370 00:18:32,850 --> 00:18:35,679 programming culture in your company, or with the development 371 00:18:35,679 --> 00:18:38,230 style that your company adopts. And we use it 372 00:18:38,230 --> 00:18:40,239 a lot at Code School and Envy Labs, and 373 00:18:40,239 --> 00:18:43,639 it's worked out great, I'd say. 374 00:18:43,639 --> 00:18:46,590 The second type of Kata is the Prepared Kata, 375 00:18:46,590 --> 00:18:50,999 and that is when you watch perform a, a 376 00:18:50,999 --> 00:18:54,710 Kata that has been previously worked on. So, David 377 00:18:54,710 --> 00:18:56,179 and I are gonna show that to you in 378 00:18:56,179 --> 00:18:58,830 a little bit. We're going to start coding a 379 00:18:58,830 --> 00:19:02,220 problem from scratch, and we're going to be pair 380 00:19:02,220 --> 00:19:05,090 programming on that problem. You can either pair program 381 00:19:05,090 --> 00:19:07,399 or do it solo, but the thing is, you're 382 00:19:07,399 --> 00:19:11,429 showing people one way to solve the problem, and 383 00:19:11,429 --> 00:19:14,879 you're showing them, also, a bunch of, of tricks 384 00:19:14,879 --> 00:19:17,179 that you may use. Perhaps you're showing them how 385 00:19:17,179 --> 00:19:20,019 to use a different editor that just came out, 386 00:19:20,019 --> 00:19:22,129 or perhaps you're showing them one feature of an 387 00:19:22,129 --> 00:19:25,059 existing editor that you might already use. You're showing 388 00:19:25,059 --> 00:19:28,529 them different API for the language. So there's different, 389 00:19:28,529 --> 00:19:31,029 there's a multitude of things that you can learn 390 00:19:31,029 --> 00:19:34,460 by watching someone perform a prepared Kata. 391 00:19:34,460 --> 00:19:36,869 And lastly. 392 00:19:36,869 --> 00:19:40,970 D.R.: We, we actually had the, the opportunity to 393 00:19:40,970 --> 00:19:43,230 have Corey Haines - has anybody heard of Corey 394 00:19:43,230 --> 00:19:45,379 Haines? If you guys know anything about the Dojo, 395 00:19:45,379 --> 00:19:48,929 you've probably heard about Corey Haines. Corey Haines, yeah, 396 00:19:48,929 --> 00:19:53,129 he's local up here. He came down to Orlando 397 00:19:53,129 --> 00:19:55,789 and gave what he calls a Code Retreat, and 398 00:19:55,789 --> 00:19:59,909 those are fantastic, all-day events where you get the 399 00:19:59,909 --> 00:20:02,019 opportunity to pair up with people that you've never 400 00:20:02,019 --> 00:20:06,139 programmed with before, maybe never seen before. You, everyone 401 00:20:06,139 --> 00:20:08,279 agrees to solve the same problem. He usually uses 402 00:20:08,279 --> 00:20:12,159 Conway's Game of Life, which is a wonderfully brain-bending 403 00:20:12,159 --> 00:20:14,210 program in whatever language you're trying to learn. 404 00:20:14,210 --> 00:20:17,399 You all pair for thirty minutes or an hour 405 00:20:17,399 --> 00:20:20,320 or, or whatever the time box is for that 406 00:20:20,320 --> 00:20:22,629 event. You pair with different people at the end 407 00:20:22,629 --> 00:20:24,159 of the time box. You're free to switch pairs. 408 00:20:24,159 --> 00:20:26,609 You're free to switch languages. You're free to try 409 00:20:26,609 --> 00:20:29,070 a different approach. Add some constraints. Whatever. But you 410 00:20:29,070 --> 00:20:30,669 agree to do it all day. You have a 411 00:20:30,669 --> 00:20:32,889 lot of practice and a lot of time. 412 00:20:32,889 --> 00:20:35,029 That's similar to the format that we're gonna use 413 00:20:35,029 --> 00:20:38,259 today for the second half, or second two-thirds of 414 00:20:38,259 --> 00:20:41,090 the seminar. And if you want to know more 415 00:20:41,090 --> 00:20:44,309 about Corey Haines Code Retreat, or perhaps bug him 416 00:20:44,309 --> 00:20:46,409 incessantly on Twitter for him to bring a Code 417 00:20:46,409 --> 00:20:48,729 Retreat to your city, you can find him at 418 00:20:48,729 --> 00:20:52,229 his horribly ugly website, coderetreat dot org. And on 419 00:20:52,229 --> 00:20:54,100 the internets as @CoreyHaines. 420 00:20:54,100 --> 00:20:59,409 C.S.: Cool. So. I think we're good to move 421 00:20:59,409 --> 00:21:02,139 on to show you guys a Prepared Kata that 422 00:21:02,139 --> 00:21:08,769 David and I practiced and. Cool. Let's do it. 423 00:21:08,769 --> 00:21:12,070 Like I said, we're gonna do something that we're 424 00:21:12,070 --> 00:21:15,489 already worked on. We've previously worked on. And we're 425 00:21:15,489 --> 00:21:17,909 gonna show you how to implement a very, very, 426 00:21:17,909 --> 00:21:21,850 very simple calculator. And, and this calculator is going 427 00:21:21,850 --> 00:21:26,940 to have one operation, which is gonna be addition. 428 00:21:26,940 --> 00:21:29,859 This operation should be able to accept two numbers 429 00:21:29,859 --> 00:21:32,169 and return the result. 430 00:21:32,169 --> 00:21:35,320 Should be simple enough, right? Cool. We're gonna use 431 00:21:35,320 --> 00:21:38,350 Ruby, Ruby 2 point 0, but if you have 432 00:21:38,350 --> 00:21:41,830 Ruby 1.9 in your computer, it's fine. And we're 433 00:21:41,830 --> 00:21:46,539 gonna use miniTest, also known as Test Unit, for 434 00:21:46,539 --> 00:21:48,629 this, and that's it. We're not gonna use any 435 00:21:48,629 --> 00:21:52,409 framework. Everything is built into the standard library. 436 00:21:52,409 --> 00:21:55,009 If you can, you can follow along. Or if 437 00:21:55,009 --> 00:21:56,950 you just want to watch it, and then try 438 00:21:56,950 --> 00:21:59,179 to do it on your own after we're done, 439 00:21:59,179 --> 00:22:01,190 that's fine too. Right. So this is like the 440 00:22:01,190 --> 00:22:03,559 first Kata that we're gonna run. 441 00:22:03,559 --> 00:22:07,039 D.R.: And because pairing, because the ping pong style 442 00:22:07,039 --> 00:22:09,279 pairing is a lot of vocal back and forth, 443 00:22:09,279 --> 00:22:10,940 we're gonna shove the mic right up here in 444 00:22:10,940 --> 00:22:12,639 the front, and we'll attempt to talk into it 445 00:22:12,639 --> 00:22:16,129 as much as possible. So bear with us. If 446 00:22:16,129 --> 00:22:18,489 you can't hear us, just holler or throw paper 447 00:22:18,489 --> 00:22:19,149 or something. 448 00:22:19,149 --> 00:22:22,239 C.S.: And also, if you have any questions, if 449 00:22:22,239 --> 00:22:23,960 you don't understand anything that we do - we're 450 00:22:23,960 --> 00:22:26,399 gonna try to explain everything and describe as we 451 00:22:26,399 --> 00:22:28,700 go, but if you have any questions, please, please, 452 00:22:28,700 --> 00:22:35,700 please raise your hand and ask us. Don't hesitate. 453 00:22:37,929 --> 00:22:44,929 So, so far we have an empty file. There's 454 00:22:46,499 --> 00:22:49,529 nothing on this file. Kata dot rb. And we're 455 00:22:49,529 --> 00:22:53,489 going to develop a very simple calculator. So I'm 456 00:22:53,489 --> 00:22:58,029 gonna fire up Vim, open the file. Can everyone 457 00:22:58,029 --> 00:23:02,200 see? Good? Decent? Cool? All right. So we're going 458 00:23:02,200 --> 00:23:08,580 to use miniTest, the unit. Because you have miniTest 459 00:23:08,580 --> 00:23:10,440 unit and you also have miniTest specs. So we're 460 00:23:10,440 --> 00:23:12,559 gonna do the unit type. 461 00:23:12,559 --> 00:23:15,029 And, to run our tests, we also have to 462 00:23:15,029 --> 00:23:21,820 require 'minitest/auto' to automatically run this file. We're gonna 463 00:23:21,820 --> 00:23:24,239 start with our test case, which is going to 464 00:23:24,239 --> 00:23:31,239 be CalculatorTest < Minitest::Unit::TestCase. We got our test suite 465 00:23:35,840 --> 00:23:39,269 class, and we're going to write our first test. 466 00:23:39,269 --> 00:23:43,830 So test_adds_two_numbers. 467 00:23:43,830 --> 00:23:46,259 So if we change it and you go to 468 00:23:46,259 --> 00:23:53,259 that same folder, if we're in Ruby, Kata cannot 469 00:23:54,769 --> 00:23:55,869 load minitest/auto. 470 00:23:55,869 --> 00:23:57,259 AUDIENCE: Autorun. 471 00:23:57,259 --> 00:24:02,720 C.S.: Autorun. Thank you. There you go. Collaborative. 472 00:24:02,720 --> 00:24:05,509 D.R.: Thank you audience. 473 00:24:05,509 --> 00:24:08,549 C.S.: Right. So now we got something here. Let 474 00:24:08,549 --> 00:24:11,590 me add clear. And Ruby Kata. 475 00:24:11,590 --> 00:24:14,220 D.R.: Tada! 476 00:24:14,220 --> 00:24:18,940 C.S.: Cool. So that gives us proof that we 477 00:24:18,940 --> 00:24:21,059 were able to import the correct libraries, we were 478 00:24:21,059 --> 00:24:23,999 able to create the correct test suite, and that 479 00:24:23,999 --> 00:24:26,470 Ruby picked it up and it gives us a 480 00:24:26,470 --> 00:24:29,169 proper error message, or at least a proper message. 481 00:24:29,169 --> 00:24:30,710 Cause we don't have any assertions yet. So it's 482 00:24:30,710 --> 00:24:33,940 just saying, hey, we found one test. There's zero 483 00:24:33,940 --> 00:24:38,369 assertions, zero failures, no errors, and no skips. Right. 484 00:24:38,369 --> 00:24:41,179 So moving on to the first failing test, I'm 485 00:24:41,179 --> 00:24:48,039 going to create a local variable, and instantiate an 486 00:24:48,039 --> 00:24:50,619 object from a class that I want to have, 487 00:24:50,619 --> 00:24:52,299 but I don't have yet. So I'm gonna let 488 00:24:52,299 --> 00:24:54,659 my tests tell me what I should do next. 489 00:24:54,659 --> 00:24:57,169 If I run this again, it's gonna blow up, 490 00:24:57,169 --> 00:24:57,440 right. 491 00:24:57,440 --> 00:24:58,859 So I got a failing test. So now I'm 492 00:24:58,859 --> 00:25:00,820 gonna pass it along to David to solve that 493 00:25:00,820 --> 00:25:01,009 test. 494 00:25:01,009 --> 00:25:03,539 D.R.: Yeah. Thanks for leaving me a lovely mess 495 00:25:03,539 --> 00:25:04,869 there. 496 00:25:04,869 --> 00:25:06,340 C.S.: That's real life, man. 497 00:25:06,340 --> 00:25:08,379 D.R.: Yeah. This is a. At least you didn't 498 00:25:08,379 --> 00:25:12,690 commit it, right? So I'm gonna actually, gonna type 499 00:25:12,690 --> 00:25:14,879 only the code that I need to fulfill this 500 00:25:14,879 --> 00:25:16,359 task. And I'm gonna do it right in the 501 00:25:16,359 --> 00:25:18,840 same file. Some people would split it out, but 502 00:25:18,840 --> 00:25:21,999 for, for this simple example, we're gonna just do 503 00:25:21,999 --> 00:25:25,269 exactly what we need. 504 00:25:25,269 --> 00:25:32,269 And so, if I just define a Calculator, then 505 00:25:33,460 --> 00:25:38,179 that should, at least, change the error message. And 506 00:25:38,179 --> 00:25:41,269 it does. Now I have one test. No assertions. 507 00:25:41,269 --> 00:25:43,029 But I don't have a big giant barf. 508 00:25:43,029 --> 00:25:45,200 So I'm gonna write a test. This is using 509 00:25:45,200 --> 00:25:51,289 the ping pong method. Equals or equal? 510 00:25:51,289 --> 00:25:53,529 C.S.: Equal. 511 00:25:53,529 --> 00:25:59,190 D.R.: Equal. Of course. I'm gonna add two numbers 512 00:25:59,190 --> 00:26:06,190 together, say, one and one. All right? Rerun the 513 00:26:08,570 --> 00:26:11,359 tests. And now I get barf. And so I 514 00:26:11,359 --> 00:26:14,979 hand it back off to my pair. Ping. 515 00:26:14,979 --> 00:26:17,769 C.S.: So the error is saying there's an undefined 516 00:26:17,769 --> 00:26:21,789 method add. So that's simple enough. I'm going to 517 00:26:21,789 --> 00:26:25,029 come here and define a method add. If I 518 00:26:25,029 --> 00:26:28,049 run it again, now it's complaining about another thing, 519 00:26:28,049 --> 00:26:30,479 which is sort of good. If you're doing TDD, 520 00:26:30,479 --> 00:26:32,989 you want either to make the test pass or 521 00:26:32,989 --> 00:26:34,970 to make the message change. 522 00:26:34,970 --> 00:26:37,309 So, this is to ensure that whatever code you're 523 00:26:37,309 --> 00:26:42,029 writing in your production part is effecting your tests, 524 00:26:42,029 --> 00:26:45,190 right. Because, I cannot count how many times it 525 00:26:45,190 --> 00:26:47,619 happened to me in real life, I'm editing a 526 00:26:47,619 --> 00:26:50,309 file, but it just happens to be a file 527 00:26:50,309 --> 00:26:52,499 with the same name on a completely different project. 528 00:26:52,499 --> 00:26:53,210 D.R.: Right. 529 00:26:53,210 --> 00:26:55,609 C.S.: So I'm editing like a calculated dot rb 530 00:26:55,609 --> 00:26:57,679 on a different project, and I'm refreshing the browser, 531 00:26:57,679 --> 00:26:59,989 wondering, what the hell is this not taking effect? 532 00:26:59,989 --> 00:27:02,090 Right. So when you're doing test-driven development, you want 533 00:27:02,090 --> 00:27:03,899 to make sure that whatever code you write in 534 00:27:03,899 --> 00:27:05,999 production, you run the test, so, to make sure 535 00:27:05,999 --> 00:27:08,289 that your code is taking effect. Right. 536 00:27:08,289 --> 00:27:10,359 D.R.: Right. And the, the key there is, run 537 00:27:10,359 --> 00:27:13,229 your tests and observe the expected failure, or at 538 00:27:13,229 --> 00:27:15,690 least observe that something, the failure has changed. 539 00:27:15,690 --> 00:27:16,059 C.S.: Right. 540 00:27:16,059 --> 00:27:17,440 D.R.: That you're, you're having an effect. 541 00:27:17,440 --> 00:27:20,299 C.S.: So I'm going to save this. Add in 542 00:27:20,299 --> 00:27:23,059 two arguments. Run the test again. Now it's saying, 543 00:27:23,059 --> 00:27:25,229 now it's giving us a different message. It's saying 544 00:27:25,229 --> 00:27:28,599 it expected Nil, but, but it got two. So, 545 00:27:28,599 --> 00:27:30,629 I'm reading this, and I'm thinking. Well that's, that's, 546 00:27:30,629 --> 00:27:33,429 that's kind of weird. I'm not expecting Nil. I 547 00:27:33,429 --> 00:27:35,429 should be expecting two. 548 00:27:35,429 --> 00:27:37,580 So that leads me to the conclusion that maybe 549 00:27:37,580 --> 00:27:42,519 we passed the wrong order to our assert method. 550 00:27:42,519 --> 00:27:47,239 So to go back, here, assert_equal is very strict 551 00:27:47,239 --> 00:27:50,409 about the order of arguments. So we can produce 552 00:27:50,409 --> 00:27:53,019 the best error message for you. So what we 553 00:27:53,019 --> 00:27:57,960 should do here, instead, is put two calculator.add one 554 00:27:57,960 --> 00:28:00,460 and one. And when we do that and then 555 00:28:00,460 --> 00:28:01,969 we run our tests again, we can see that 556 00:28:01,969 --> 00:28:04,749 now the error message is, it makes more sense, 557 00:28:04,749 --> 00:28:07,989 right. It expected two but it actually got Nil. 558 00:28:07,989 --> 00:28:10,570 Now, it's time to write the simplest thing that 559 00:28:10,570 --> 00:28:13,859 could possibly make this work. And will probably make 560 00:28:13,859 --> 00:28:20,539 your skin crawl. Is to return two. Cool. So 561 00:28:20,539 --> 00:28:23,269 now we have one test and one assertion. Now 562 00:28:23,269 --> 00:28:25,719 it's time for me to write a test, a 563 00:28:25,719 --> 00:28:28,609 failing test, or David to fulfill. 564 00:28:28,609 --> 00:28:35,609 Equal. Seven. Five and two. So I'm gonna do 565 00:28:37,669 --> 00:28:39,349 AUDIENCE: Could that also lead you to splitting the 566 00:28:39,349 --> 00:28:46,039 two tests out of this matter? 567 00:28:46,039 --> 00:28:52,190 C.S.: Say that again. 568 00:28:52,190 --> 00:28:52,940 AUDIENCE: Will you, should you be splitting the two 569 00:28:52,940 --> 00:28:53,599 tests into two assertions. Two assertions, two tests. 570 00:28:53,599 --> 00:28:54,519 C.S.: That is a good point. I do that 571 00:28:54,519 --> 00:28:58,210 when I'm talking about different features, right. So there's, 572 00:28:58,210 --> 00:28:59,529 it's really up to you how fine-grained you want 573 00:28:59,529 --> 00:29:00,219 to get. Because we're testing, if you look at 574 00:29:00,219 --> 00:29:00,909 the name of the test method, the test_that_adds_two_numbers. So 575 00:29:00,909 --> 00:29:07,909 those two assertions, they still belong to that idea, 576 00:29:08,609 --> 00:29:11,789 to that context of adding two numbers. 577 00:29:11,789 --> 00:29:14,779 D.R.: Right. And we, we talk about the granularity 578 00:29:14,779 --> 00:29:17,820 of testing, just simple assertion testing which is what 579 00:29:17,820 --> 00:29:19,820 we're doing with assert_equal or any of the assert 580 00:29:19,820 --> 00:29:22,690 methods. That's like the smallest little piece of a 581 00:29:22,690 --> 00:29:24,979 test. That's the tiniest little piece of a test. 582 00:29:24,979 --> 00:29:28,539 We then compose those assertions together into the unit, 583 00:29:28,539 --> 00:29:30,399 and the unit, in this case, like Kaikay had 584 00:29:30,399 --> 00:29:32,570 described, is just that we can add two numbers. 585 00:29:32,570 --> 00:29:35,460 There might be multiple assertions that describe how we 586 00:29:35,460 --> 00:29:37,429 can add two numbers, and as we go through 587 00:29:37,429 --> 00:29:39,239 the example we'll see that, and we'll start to 588 00:29:39,239 --> 00:29:42,289 break out, what happens if we give it three 589 00:29:42,289 --> 00:29:42,719 numbers? 590 00:29:42,719 --> 00:29:46,009 C.S.: And that's when we break into another test. 591 00:29:46,009 --> 00:29:49,960 D.R.: Right. Does that answer your question? More or 592 00:29:49,960 --> 00:29:50,969 less? All right. Great. 593 00:29:50,969 --> 00:29:53,749 So, I've got this busted up test sitting in 594 00:29:53,749 --> 00:29:57,779 front of me. So the simplest thing that I 595 00:29:57,779 --> 00:30:01,149 could possibly do is, I'm gonna go ahead and 596 00:30:01,149 --> 00:30:07,070 do some math. Actually do some work here. Buddy. 597 00:30:07,070 --> 00:30:09,799 And now I've got passing tests. But I sort 598 00:30:09,799 --> 00:30:12,679 of see, already, that Calculator is gonna be a 599 00:30:12,679 --> 00:30:15,729 whole lot to type. So I'm gonna take a 600 00:30:15,729 --> 00:30:19,960 minute and just refactor. Rather than typing calculator all 601 00:30:19,960 --> 00:30:22,929 the dang time, why don't we change this to 602 00:30:22,929 --> 00:30:25,869 just, like, calc? That's still descriptive of what the 603 00:30:25,869 --> 00:30:32,869 object is, but it's a lot less repetitive. 604 00:30:34,059 --> 00:30:37,239 So I make my couple of changes to refactor, 605 00:30:37,239 --> 00:30:41,599 and then I rerun the tests. And boy, it'd 606 00:30:41,599 --> 00:30:43,849 be nice if these, if these tests were a 607 00:30:43,849 --> 00:30:45,169 little prettier. But I'll leave that to another, to 608 00:30:45,169 --> 00:30:46,039 another person. 609 00:30:46,039 --> 00:30:50,509 Now, what do you think? We've got, we've got 610 00:30:50,509 --> 00:30:52,119 the ability to add two numbers. Should we add 611 00:30:52,119 --> 00:30:54,619 some more two numbers? Or do you, maybe we 612 00:30:54,619 --> 00:30:57,739 can move on? Maybe we'll move on and get 613 00:30:57,739 --> 00:30:58,349 a little more complicated. 614 00:30:58,349 --> 00:30:59,450 C.S.: Yeah. Let's do that. 615 00:30:59,450 --> 00:31:05,029 D.R.: So yeah. Why don't we write another test? 616 00:31:05,029 --> 00:31:07,320 And this time, I'll, I'll throw you a curve 617 00:31:07,320 --> 00:31:13,809 ball. You can add three numbers. Now we're getting 618 00:31:13,809 --> 00:31:20,809 fancy. So, if I, if I expect nine, three 619 00:31:21,489 --> 00:31:26,749 and three and three, should add up to nine. 620 00:31:26,749 --> 00:31:28,809 But should be clearly, clear, that I'm gonna need 621 00:31:28,809 --> 00:31:32,029 to do some copy pasta here. Which is a 622 00:31:32,029 --> 00:31:34,479 great opportunity to refactor, of course. 623 00:31:34,479 --> 00:31:39,659 But I feel like making Kaikay work. Look at 624 00:31:39,659 --> 00:31:44,659 that. Ping pong, sir. 625 00:31:44,659 --> 00:31:50,529 C.S.: Cool. So. Says the number, wrong number of 626 00:31:50,529 --> 00:31:52,599 arguments. It took three but it was only expecting 627 00:31:52,599 --> 00:31:55,279 two. So, I'm gonna write the simplest thing that 628 00:31:55,279 --> 00:31:59,969 could possibly work, or change this message, right. So 629 00:31:59,969 --> 00:32:02,799 what I'm gonna do is add another argument. But 630 00:32:02,799 --> 00:32:05,820 if I simply add another argument, then I made 631 00:32:05,820 --> 00:32:07,710 that test pass but I make the other ones 632 00:32:07,710 --> 00:32:07,950 fail. 633 00:32:07,950 --> 00:32:09,879 Cause, if I look at the error message. 634 00:32:09,879 --> 00:32:11,519 D.R.: If you could look at the error message. 635 00:32:11,519 --> 00:32:14,589 C.S.: If I could look at the error message. 636 00:32:14,589 --> 00:32:16,330 D.R.: The little green. 637 00:32:16,330 --> 00:32:17,639 C.S.: What's that? 638 00:32:17,639 --> 00:32:20,419 D.R.: It's too tall. The window's too tall. 639 00:32:20,419 --> 00:32:22,529 C.S.: Is it? Right. All right. So, if you 640 00:32:22,529 --> 00:32:24,979 can see here, now I broke the other ones. 641 00:32:24,979 --> 00:32:27,609 So what I'm going to do is actually make. 642 00:32:27,609 --> 00:32:30,769 Let me fix my window. Is actually make this 643 00:32:30,769 --> 00:32:35,450 third one optional. If I run it again, now 644 00:32:35,450 --> 00:32:37,419 I don't have a syntax error anymore. Now I 645 00:32:37,419 --> 00:32:39,960 have an assertion error. Which, again, is good, right. 646 00:32:39,960 --> 00:32:41,229 D.R.: Man it would be nice if we could 647 00:32:41,229 --> 00:32:46,009 see the differences there. That, that white text on 648 00:32:46,009 --> 00:32:47,710 a white back- on a, on a black background 649 00:32:47,710 --> 00:32:48,259 is particularly- 650 00:32:48,259 --> 00:32:49,379 C.S.: You're right. I wonder if we can make 651 00:32:49,379 --> 00:32:50,059 this colored, right. 652 00:32:50,059 --> 00:32:52,379 D.R.: I wondered. If we could make this prettier. 653 00:32:52,379 --> 00:32:56,690 C.S.: So let's go ahead and add require 'minitest/bright' 654 00:32:56,690 --> 00:32:59,729 and make our tests fabulous. So now you can 655 00:32:59,729 --> 00:33:01,809 see, down at the bottom here, that we have 656 00:33:01,809 --> 00:33:03,759 a little column. Might not be able to see 657 00:33:03,759 --> 00:33:05,989 it clearly on the projector, but it does make 658 00:33:05,989 --> 00:33:07,499 a lot of difference when you're look at your 659 00:33:07,499 --> 00:33:08,259 terminal, right. 660 00:33:08,259 --> 00:33:09,599 D.R.: You get a nice big red F. 661 00:33:09,599 --> 00:33:13,019 C.S.: So, the big F is saying that expected 662 00:33:13,019 --> 00:33:15,279 nine, but it got six. So I'm gonna go 663 00:33:15,279 --> 00:33:21,580 ahead and add C to make it pass. Cool. 664 00:33:21,580 --> 00:33:24,339 And because I don't like reading a lot, I'm 665 00:33:24,339 --> 00:33:27,749 just gonna remove return, because Ruby automatically returns the 666 00:33:27,749 --> 00:33:30,629 last expression of the method. So I'm gonna run 667 00:33:30,629 --> 00:33:35,799 this again, and now all my tests pass, right. 668 00:33:35,799 --> 00:33:37,429 Cool. 669 00:33:37,429 --> 00:33:39,580 Let's see what we can do now. Should we 670 00:33:39,580 --> 00:33:43,029 add more numbers? So we can refactor this whole 671 00:33:43,029 --> 00:33:43,080 thing? 672 00:33:43,080 --> 00:33:43,179 D.R.: Yeah. 673 00:33:43,179 --> 00:33:43,499 C.S.: What do you think? 674 00:33:43,499 --> 00:33:44,289 D.R.: Let's do, let's do one more, one more 675 00:33:44,289 --> 00:33:45,059 test. 676 00:33:45,059 --> 00:33:48,070 C.S.: So, I don't want you to cheat, cause 677 00:33:48,070 --> 00:33:50,719 I don't want you to keep adding single arguments. 678 00:33:50,719 --> 00:33:57,279 I'm just gonna add five numbers, right. So I'm 679 00:33:57,279 --> 00:34:00,289 gonna copy and paste this, and copying and pasting 680 00:34:00,289 --> 00:34:04,029 never resulted in any error, ever. And, it's gonna- 681 00:34:04,029 --> 00:34:07,690 D.R.: It certainly results in highly maintainable code. 682 00:34:07,690 --> 00:34:13,330 C.S.: Twenty-five. Five, five, five, five, five. 683 00:34:13,330 --> 00:34:16,339 D.R.: You can tell we're mathematicians as well, right. 684 00:34:16,339 --> 00:34:18,690 Neither one of us aspire to computer science. 685 00:34:18,690 --> 00:34:22,270 C.S.: Cool. So now you got one more. 686 00:34:22,270 --> 00:34:26,929 D.R.: Dun, dun, duh! So. Back again we go. 687 00:34:26,929 --> 00:34:28,540 The simplest thing that I could possibly do is 688 00:34:28,540 --> 00:34:31,520 add five, and a bunch of, and a bunch 689 00:34:31,520 --> 00:34:34,960 of junk inside my add method. But that seems, 690 00:34:34,960 --> 00:34:41,960 well, stupid. So, let's, instead, just replace. 691 00:34:42,860 --> 00:34:47,870 C.S.: Hello? Is that a duck? Duck face? 692 00:34:47,870 --> 00:34:51,080 D.R.: There we go. 693 00:34:51,080 --> 00:34:52,679 C.S.: nice. 694 00:34:52,679 --> 00:34:59,060 D.R.: Let's instead replace this with a splat. That's 695 00:34:59,060 --> 00:35:03,270 my favorite. And that should get rid of my 696 00:35:03,270 --> 00:35:06,520 wrong arguments error. Oh god. But I got a 697 00:35:06,520 --> 00:35:10,630 whole bunch. And you know what, this, this running 698 00:35:10,630 --> 00:35:12,480 this test thing's getting kind of tedious. I don't 699 00:35:12,480 --> 00:35:15,400 like flipping back and forth between the windows. Is 700 00:35:15,400 --> 00:35:16,470 there a way we could automate that? 701 00:35:16,470 --> 00:35:17,060 C.S.: I wonder. 702 00:35:17,060 --> 00:35:19,410 D.R.: I wonder. Well, I'm more of a, a 703 00:35:19,410 --> 00:35:22,240 bash-y person than most, so, in. 704 00:35:22,240 --> 00:35:25,520 C.S.: So we could add auto-watch if we really 705 00:35:25,520 --> 00:35:27,700 wanted to add a dependency and all that stuff, 706 00:35:27,700 --> 00:35:27,800 right. 707 00:35:27,800 --> 00:35:29,310 D.R.: Oh, right. And download a gem or, you 708 00:35:29,310 --> 00:35:31,860 know, we know our way around Grunt. I'm more 709 00:35:31,860 --> 00:35:33,950 of a JavaScript guy than a Ruby guy, so 710 00:35:33,950 --> 00:35:34,510 I know way more- 711 00:35:34,510 --> 00:35:35,770 D.C.: Dude, haven't you heard? Gulp is the new 712 00:35:35,770 --> 00:35:35,910 Grunt. 713 00:35:35,910 --> 00:35:37,420 D.R.: Oh, right. And so, and then followed by 714 00:35:37,420 --> 00:35:42,110 Guzzle and, and Yak, I think is coming eventually, 715 00:35:42,110 --> 00:35:44,820 right. We could do all that and wait through 716 00:35:44,820 --> 00:35:46,990 like fifteen minutes of downloading stuff. But I, I 717 00:35:46,990 --> 00:35:48,750 know bash really well, so I'm just gonna write 718 00:35:48,750 --> 00:35:55,750 myself a wonderful infinite loop. But I'll add a 719 00:35:57,930 --> 00:36:01,810 sleep. So that I don't blow my stack out. 720 00:36:01,810 --> 00:36:03,420 And now every two seconds or so, it's going 721 00:36:03,420 --> 00:36:05,930 to run, rerun the tests, rerun the tests, rerun 722 00:36:05,930 --> 00:36:07,080 the tests. And I never have to touch that 723 00:36:07,080 --> 00:36:08,300 window again. Thank you very much. 724 00:36:08,300 --> 00:36:09,020 AUDIENCE: [indecipherable] 725 00:36:09,020 --> 00:36:10,090 C.S.: What's that? 726 00:36:10,090 --> 00:36:10,810 AUDIENCE: [indecipherable] 727 00:36:10,810 --> 00:36:11,880 D.R.: Oh, sure. 728 00:36:11,880 --> 00:36:15,110 C.S.: Oh, the code for the, yeah. The bash. 729 00:36:15,110 --> 00:36:16,510 D.R.: So it's just a simple- 730 00:36:16,510 --> 00:36:18,830 AUDIENCE: [chatter] 731 00:36:18,830 --> 00:36:25,830 D.R.: Oh, lame. Lame. Pretty simple. Here, let's. Let's 732 00:36:29,270 --> 00:36:35,310 do this. So, pretty simple bash infinite loop. While 733 00:36:35,310 --> 00:36:38,700 true, run the tests. Sleep for two. If we 734 00:36:38,700 --> 00:36:41,970 really wanted to make it even, even closer to 735 00:36:41,970 --> 00:36:45,500 what Kaikay typed last, we'll do a clear. And 736 00:36:45,500 --> 00:36:49,320 while I run that, every two seconds it's going 737 00:36:49,320 --> 00:36:51,660 to refresh the screen and rerun the tests for 738 00:36:51,660 --> 00:36:55,840 me. That is the poor-man's file-watcher. That's just in 739 00:36:55,840 --> 00:36:58,510 case you're running free BSD or a clone thereof 740 00:36:58,510 --> 00:37:03,070 and do not have watch installed by default. 741 00:37:03,070 --> 00:37:04,670 So now the simplest thing that I could possibly 742 00:37:04,670 --> 00:37:07,940 do here is numbers. Now, if this was JavaScript 743 00:37:07,940 --> 00:37:11,220 I would probably use reduce on this array, but 744 00:37:11,220 --> 00:37:13,280 this isn't JavaScript. So what is it in, in 745 00:37:13,280 --> 00:37:14,010 Ruby? 746 00:37:14,010 --> 00:37:15,470 AUDIENCE: Inject. 747 00:37:15,470 --> 00:37:22,070 D.R.: Inject? Reduce? Oh, look. You steered me wrong. 748 00:37:22,070 --> 00:37:24,340 And so, reduce is gonna take, does it take 749 00:37:24,340 --> 00:37:26,030 the same arguments? 750 00:37:26,030 --> 00:37:29,390 AUDIENCE: The first argument's the seed. 751 00:37:29,390 --> 00:37:32,050 D.R.: Right. So I take the seed. And then 752 00:37:32,050 --> 00:37:34,970 I give it a block. And so then I 753 00:37:34,970 --> 00:37:40,490 have my, my value and my number. 754 00:37:40,490 --> 00:37:46,690 C.S.: You might have to use params. I don't 755 00:37:46,690 --> 00:37:47,000 know. 756 00:37:47,000 --> 00:37:48,440 D.R.: I don't know. Let's, let's find out. 757 00:37:48,440 --> 00:37:49,070 C.S.: Yeah. Let's find out. 758 00:37:49,070 --> 00:37:50,330 D.R.: Find out what happens, right. So we give 759 00:37:50,330 --> 00:37:52,980 it a block, and then we'll just return v 760 00:37:52,980 --> 00:37:57,170 plus n, from the block. Write the file and 761 00:37:57,170 --> 00:37:57,170 D.R.: Yeah. 762 00:38:05,910 --> 00:38:12,380 passing a block. 763 00:38:12,380 --> 00:38:16,700 D.R.: Oops. 764 00:38:16,700 --> 00:38:19,830 And the best part is, I never have to 765 00:38:19,830 --> 00:38:22,480 touch this dang test file again. He just keeps 766 00:38:22,480 --> 00:38:25,410 running my tests. So now I've got a, I've 767 00:38:25,410 --> 00:38:27,660 got a reduce function that works for an infinite 768 00:38:27,660 --> 00:38:29,990 number of numbers. And I'm back to green tests. 769 00:38:29,990 --> 00:38:31,590 And I, I've already noticed, you know, let's just, 770 00:38:31,590 --> 00:38:34,240 let's go ahead and make this guy a little 771 00:38:34,240 --> 00:38:34,760 bigger. 772 00:38:34,760 --> 00:38:38,130 I've already noticed that, I've got all this repetition 773 00:38:38,130 --> 00:38:40,420 in here, right. I've got calc equals, calc equals, 774 00:38:40,420 --> 00:38:42,910 calc equals. Oh god. So, let's reduce some of 775 00:38:42,910 --> 00:38:44,200 that repetition. 776 00:38:44,200 --> 00:38:47,710 C.S.: Reduce? That. 777 00:38:47,710 --> 00:38:50,100 D.R.: He's a funny guy. 778 00:38:50,100 --> 00:38:53,860 AUDIENCE: Trying to inject a little humor. 779 00:38:53,860 --> 00:38:56,540 D.R.: Ha. Ha. Ha. Ha. 780 00:38:56,540 --> 00:38:59,230 C.S.: Nice. I liked that. 781 00:38:59,230 --> 00:39:02,810 D.R.: So I'll, I'll add a little set up 782 00:39:02,810 --> 00:39:09,810 method. Get rid of all those. Oops. Do a 783 00:39:13,280 --> 00:39:20,280 little find and replace. Rerun. Hey, everything's still passing. 784 00:39:22,490 --> 00:39:24,920 C.S.: Cool. 785 00:39:24,920 --> 00:39:29,690 D.R.: Groovy, groovy. Should we go further? Or, I 786 00:39:29,690 --> 00:39:31,810 mean, I think we've, we've pretty much added as 787 00:39:31,810 --> 00:39:33,470 many numbers as we can possibly add. We could 788 00:39:33,470 --> 00:39:37,060 add additional tests, or refactor this test to say, 789 00:39:37,060 --> 00:39:38,370 adds an infinite number of tes- or, numbers. 790 00:39:38,370 --> 00:39:38,680 C.S.: Mhmm. 791 00:39:38,680 --> 00:39:40,640 D.R.: And throw it all kinds of different numbers 792 00:39:40,640 --> 00:39:43,950 inside of there. Or we could go do something, 793 00:39:43,950 --> 00:39:45,930 something completely crazy and totally off the spec. 794 00:39:45,930 --> 00:39:46,420 C.S.: We could. 795 00:39:46,420 --> 00:39:47,170 D.R.: What else? 796 00:39:47,170 --> 00:39:49,490 C.S.: What if we added arguments, instead of numbers, 797 00:39:49,490 --> 00:39:50,930 as strings? Would that work? 798 00:39:50,930 --> 00:39:52,080 D.R.: Ah, I see. 799 00:39:52,080 --> 00:39:54,490 C.S.: Does Ruby automatically convert, like, each b would 800 00:39:54,490 --> 00:39:56,470 do? 801 00:39:56,470 --> 00:39:59,910 AUDIENCE: Is Ruby as good as PHP? 802 00:39:59,910 --> 00:40:02,530 D.R.: Is Ruby as good as PHP? 803 00:40:02,530 --> 00:40:04,410 AUDIENCE: I'll write that down. 804 00:40:04,410 --> 00:40:08,250 D.R.: Test. Ruby as good as PHP. 805 00:40:08,250 --> 00:40:10,200 So what should, what, what would we expect it 806 00:40:10,200 --> 00:40:13,150 to equal? If we do a calc dot add, 807 00:40:13,150 --> 00:40:17,750 say, one and banana. What should we reason we 808 00:40:17,750 --> 00:40:19,390 expect this to, to return to us? 809 00:40:19,390 --> 00:40:21,830 C.S.: So that would probably generate an error, right. 810 00:40:21,830 --> 00:40:22,970 D.R.: I would expect so. 811 00:40:22,970 --> 00:40:24,630 C.S.: So what if, instead of banana, we pass 812 00:40:24,630 --> 00:40:28,160 number two as a string. 813 00:40:28,160 --> 00:40:31,170 D.R.: Sure. That seems reasonably. I mean, Ruby should 814 00:40:31,170 --> 00:40:33,520 be able to convert a string with a numeric 815 00:40:33,520 --> 00:40:34,030 value, right. 816 00:40:34,030 --> 00:40:36,850 C.S.: So that should equal three integer, right. 817 00:40:36,850 --> 00:40:41,200 D.R.: Let's see. Oh. Oh. String can't be coerced 818 00:40:41,200 --> 00:40:45,780 into fixnum? That sounds wonderful. And I'll let you 819 00:40:45,780 --> 00:40:48,130 take over from there. 820 00:40:48,130 --> 00:40:51,630 C.S.: Cool. 821 00:40:51,630 --> 00:40:56,370 So, Ruby has a, a method. I'm not sure 822 00:40:56,370 --> 00:40:59,700 if it's. I believe it's injected into object. It's 823 00:40:59,700 --> 00:41:02,300 extended. It's in a part of object, which is 824 00:41:02,300 --> 00:41:04,740 to_i, right, which is gonna try to convert whatever 825 00:41:04,740 --> 00:41:07,260 that object is into an integer. So, in this 826 00:41:07,260 --> 00:41:11,220 case, we're converting the string two into an integer. 827 00:41:11,220 --> 00:41:14,610 And that made our test pass. 828 00:41:14,610 --> 00:41:14,830 But now. 829 00:41:14,830 --> 00:41:16,490 D.R.: But then we get back to that banana 830 00:41:16,490 --> 00:41:17,600 that I was trying to throw you earlier. 831 00:41:17,600 --> 00:41:20,030 C.S.: Yeah. So here's the thing. We're looking at 832 00:41:20,030 --> 00:41:21,900 the test, at the name of the method. Test 833 00:41:21,900 --> 00:41:24,370 adds string, right. But we want to be a 834 00:41:24,370 --> 00:41:27,970 little bit more specific about what that does, right. 835 00:41:27,970 --> 00:41:32,250 So I'm gonna rename this method to test parses 836 00:41:32,250 --> 00:41:33,710 valid strings. 837 00:41:33,710 --> 00:41:37,800 And I'm gonna write another test that says test 838 00:41:37,800 --> 00:41:44,800 raises error for invalid strings, which kind of, kind 839 00:41:45,080 --> 00:41:48,200 of gives us a bit of a path of 840 00:41:48,200 --> 00:41:50,920 where we're going with implementing this test, this test 841 00:41:50,920 --> 00:41:52,690 method. So what we want to do, we'll make 842 00:41:52,690 --> 00:41:56,100 sure that it raises an, I believe this is 843 00:41:56,100 --> 00:41:56,380 in the- 844 00:41:56,380 --> 00:41:56,550 D.R.: Yup. 845 00:41:56,550 --> 00:42:00,570 C.S.: -in the plural, an argument error, and then 846 00:42:00,570 --> 00:42:04,640 we'd pass it a block. If we pass it 847 00:42:04,640 --> 00:42:10,760 an invalid argument. So in this case, a banana. 848 00:42:10,760 --> 00:42:13,740 Kaboom. 849 00:42:13,740 --> 00:42:18,080 D.R.: So that brings us back to our original 850 00:42:18,080 --> 00:42:23,250 question, what is the numeric value of banana, right? 851 00:42:23,250 --> 00:42:24,980 Apparently to_i is not working the way we expect 852 00:42:24,980 --> 00:42:27,530 it to. Or, at least, Ruby's doing something with 853 00:42:27,530 --> 00:42:28,830 it. It's definitely not throwing an error. 854 00:42:28,830 --> 00:42:29,190 C.S.: Right. 855 00:42:29,190 --> 00:42:32,000 D.R.: So maybe we should figure out what the 856 00:42:32,000 --> 00:42:34,460 numeric value of banana is. 857 00:42:34,460 --> 00:42:35,820 C.S.: Right. 858 00:42:35,820 --> 00:42:37,260 D.R.: One way we could do that is to 859 00:42:37,260 --> 00:42:39,850 write a test for it, right. We could write 860 00:42:39,850 --> 00:42:42,420 an expectation. We expect x to be. Yeah. 861 00:42:42,420 --> 00:42:45,160 AUDIENCE: [indecipherable] Would it be easier to see? 862 00:42:45,160 --> 00:42:47,890 C.S.: Do you want me to do that? 863 00:42:47,890 --> 00:42:49,620 D.R.: Yeah. Use your magic fingers. 864 00:42:49,620 --> 00:42:52,980 C.S.: If you want, you could do. 865 00:42:52,980 --> 00:42:54,910 AUDIENCE: That doesn't work? 866 00:42:54,910 --> 00:42:57,790 D.R.: I don't think that helped. 867 00:42:57,790 --> 00:42:58,750 C.S.: Yeah. 868 00:42:58,750 --> 00:42:59,240 AUDIENCE: ?? 869 00:42:59,240 --> 00:43:02,660 C.S.: Should I make this one bigger and this 870 00:43:02,660 --> 00:43:03,420 one smaller? 871 00:43:03,420 --> 00:43:05,500 D.R.: Yeah, we can. I mean, the tests. We 872 00:43:05,500 --> 00:43:12,500 can even make the font size on the tests 873 00:43:15,800 --> 00:43:16,050 smaller. 874 00:43:16,050 --> 00:43:17,020 C.S.: Does that help? 875 00:43:17,020 --> 00:43:17,760 AUDIENCE: Yeah. Thanks. 876 00:43:17,760 --> 00:43:18,730 C.S.: All right. Cool. 877 00:43:18,730 --> 00:43:19,900 D.R.: So now we're stuck with this, you know, 878 00:43:19,900 --> 00:43:22,350 what is the numeric value of, of, banana. And- 879 00:43:22,350 --> 00:43:23,140 C.S.: So, yeah. 880 00:43:23,140 --> 00:43:25,190 D.R.: -I would approach it by writing a test 881 00:43:25,190 --> 00:43:32,190 for it. Test numeric. Numberic. Numberic. Numeric value of 882 00:43:33,210 --> 00:43:37,370 banana. That's a drinking game actually. Every time a 883 00:43:37,370 --> 00:43:43,850 presenter says banana you have to take a drink. 884 00:43:43,850 --> 00:43:48,230 I, I would expect banana to raise an ex- 885 00:43:48,230 --> 00:43:50,420 an exception if I tried to coerce it to 886 00:43:50,420 --> 00:43:52,250 an integer. But, apparently Ruby's doing something else with 887 00:43:52,250 --> 00:43:54,700 that. So maybe it gives it a value of 888 00:43:54,700 --> 00:43:56,510 zero. Maybe it's trying to turn it into a 889 00:43:56,510 --> 00:43:59,280 number. I know another language that begins with a 890 00:43:59,280 --> 00:44:00,800 P and ends with a P that does something 891 00:44:00,800 --> 00:44:05,330 similar that confounds many people. 892 00:44:05,330 --> 00:44:07,100 And we'll use that same to_i trick that you 893 00:44:07,100 --> 00:44:10,610 just showed me. And let's see what happens. Oh. 894 00:44:10,610 --> 00:44:12,320 I get a passing test. 895 00:44:12,320 --> 00:44:13,280 C.S.: Yup. 896 00:44:13,280 --> 00:44:16,400 D.R.: So. Let's, just to verify, I'll make this 897 00:44:16,400 --> 00:44:19,160 another value. Like one. Maybe the value of banana 898 00:44:19,160 --> 00:44:24,700 is one. Nope. The actual value is zero. And, 899 00:44:24,700 --> 00:44:28,010 interesting thing there, you can see that the, the 900 00:44:28,010 --> 00:44:30,250 tests are flipping every time we run it, because 901 00:44:30,250 --> 00:44:35,790 it's implemented as a hash and not. Fun stuff. 902 00:44:35,790 --> 00:44:38,900 So then if the, if, if the numeric value 903 00:44:38,900 --> 00:44:45,830 of, of banana is zero, how are we gonna 904 00:44:45,830 --> 00:44:47,810 test- how are we gonna figure out that we've 905 00:44:47,810 --> 00:44:51,380 been given a banana instead of a number inside 906 00:44:51,380 --> 00:44:52,980 of our calculator? 907 00:44:52,980 --> 00:44:57,160 Well, we could start with a little refactor, right. 908 00:44:57,160 --> 00:44:59,130 We're probably gonna need some code inside of this 909 00:44:59,130 --> 00:45:01,470 block. And we run into a number, an argument 910 00:45:01,470 --> 00:45:04,110 that we've been given that isn't numerically, isn't a 911 00:45:04,110 --> 00:45:10,160 numericalized varia- or, value. Something that we can coerce. 912 00:45:10,160 --> 00:45:16,260 Then, we need to do something different. 913 00:45:16,260 --> 00:45:23,260 So, we'll put a little guard in there. Because 914 00:45:25,960 --> 00:45:32,150 we want to raise an exception, according to Carlos's 915 00:45:32,150 --> 00:45:34,810 test. And. 916 00:45:34,810 --> 00:45:38,850 C.S.: So the reason behind this is, we, we 917 00:45:38,850 --> 00:45:41,940 realized that if we pass a valid string that 918 00:45:41,940 --> 00:45:44,280 is able to be parsed to a number, say 919 00:45:44,280 --> 00:45:45,530 one, in double quotes- 920 00:45:45,530 --> 00:45:47,080 Or. So. 921 00:45:47,080 --> 00:45:52,470 D.R.: Just take it. Just take it. 922 00:45:52,470 --> 00:45:54,570 C.S.: So if you pass a string that is 923 00:45:54,570 --> 00:45:57,430 able to be converted to an integer, right, say, 924 00:45:57,430 --> 00:46:00,580 one in quotes, it's successfully converted into one integer. 925 00:46:00,580 --> 00:46:02,830 But if we pass a string that's not able 926 00:46:02,830 --> 00:46:04,570 to be converted to an integer, it's gonna resolve 927 00:46:04,570 --> 00:46:08,190 to zero. So, what we realize is that, the 928 00:46:08,190 --> 00:46:13,170 valid argument would be if n dash to_i equals 929 00:46:13,170 --> 00:46:17,120 zero, and at the same time, if the original 930 00:46:17,120 --> 00:46:20,250 string was zero, then that's a valid one. Otherwise, 931 00:46:20,250 --> 00:46:22,930 raise an error. So the only reason, the only 932 00:46:22,930 --> 00:46:25,830 way that it's a valid conversion is if the 933 00:46:25,830 --> 00:46:30,670 integer zero came from a string zero. 934 00:46:30,670 --> 00:46:32,330 That's what that code means. 935 00:46:32,330 --> 00:46:39,330 AUDIENCE: Is there a reason why you're using triple 936 00:46:41,650 --> 00:46:42,690 equals? 937 00:46:42,690 --> 00:46:49,690 D.R.: Because I'm a JavaScript guy, and my brain 938 00:46:52,010 --> 00:46:54,700 is programmed to use triple equals any time I 939 00:46:54,700 --> 00:46:55,570 compare to zero. I'm sure is something my fingers 940 00:46:55,570 --> 00:46:56,440 are trained to type. Oh, you're gonna type a 941 00:46:56,440 --> 00:46:57,310 zero now, aren't you? Let me just throw another 942 00:46:57,310 --> 00:46:57,690 equal sign in there. 943 00:46:57,690 --> 00:46:58,510 So yeah. Like, like Carlos was saying. If the 944 00:46:58,510 --> 00:47:00,960 number what I'm given converts to zero, the number 945 00:47:00,960 --> 00:47:03,060 that I'm given converts to zero but it isn't 946 00:47:03,060 --> 00:47:05,910 actually string zero, then that would be one of 947 00:47:05,910 --> 00:47:08,540 those strings that coerces to zero for us. Thank 948 00:47:08,540 --> 00:47:09,750 you banana. 949 00:47:09,750 --> 00:47:10,540 Yeah? 950 00:47:10,540 --> 00:47:13,690 AUDIENCE: If you, if you coerce it to a 951 00:47:13,690 --> 00:47:18,090 string that's the same as itself, as an alternative? 952 00:47:18,090 --> 00:47:19,690 D.R.: Taking, what, sorry? 953 00:47:19,690 --> 00:47:22,520 AUDIENCE: Take, take, take whatever comes in, and coerce 954 00:47:22,520 --> 00:47:24,470 it to string, and test whether it's the same 955 00:47:24,470 --> 00:47:29,210 as itself. If it is, then it's a literal. 956 00:47:29,210 --> 00:47:31,170 It's a, it's a string. 957 00:47:31,170 --> 00:47:34,950 D.R.: So, same as that? 958 00:47:34,950 --> 00:47:36,820 AUDIENCE: Well, you got. I don't mean in the 959 00:47:36,820 --> 00:47:38,160 second bit. Yeah. 960 00:47:38,160 --> 00:47:39,680 D.R.: Let's see. 961 00:47:39,680 --> 00:47:42,220 C.S.: Doesn't look like it. 962 00:47:42,220 --> 00:47:43,750 D.R.: Apparently not. 963 00:47:43,750 --> 00:47:46,290 AUDIENCE: Valid strings are failing. 964 00:47:46,290 --> 00:47:47,300 C.S.: Yeah. 965 00:47:47,300 --> 00:47:54,300 D.R.: Right. Now valid strings are failing. 966 00:47:55,130 --> 00:47:56,800 But that's the beauty, again, of the Dojo. If 967 00:47:56,800 --> 00:47:58,480 there's something that I want to experiment with, I'm, 968 00:47:58,480 --> 00:48:01,350 I'm at green tests. I can try something else. 969 00:48:01,350 --> 00:48:03,220 Just, just to see, how does Ruby behave this 970 00:48:03,220 --> 00:48:03,870 way? 971 00:48:03,870 --> 00:48:06,470 C.S.: Right. All right. 972 00:48:06,470 --> 00:48:08,830 So, we're gonna take a little break. So you 973 00:48:08,830 --> 00:48:09,440 all can. 974 00:48:09,440 --> 00:48:11,700 D.R.: Yeah. Project Euler is a great- if, if 975 00:48:11,700 --> 00:48:15,990 you don't know about Project Euler, spelled e-u-l-e-r, Euler. 976 00:48:15,990 --> 00:48:22,990 Euler. Euler. Hello. ProjectEuler dot net has a ton 977 00:48:24,120 --> 00:48:29,660 of, of computer science problems that seem trivial at 978 00:48:29,660 --> 00:48:32,030 first, but if you implement them in the most 979 00:48:32,030 --> 00:48:35,070 trivial manner possible, you'll do something silly like blow 980 00:48:35,070 --> 00:48:37,410 out your recursion stack or take an hour and 981 00:48:37,410 --> 00:48:39,730 a half to compute the result or something like 982 00:48:39,730 --> 00:48:40,990 that. So you have to think about them a 983 00:48:40,990 --> 00:48:41,690 little more. 984 00:48:41,690 --> 00:48:44,730 But, you can do it in a test-driven style, 985 00:48:44,730 --> 00:48:48,010 and, and once you get passing tests on your 986 00:48:48,010 --> 00:48:52,330 hour and a half long solution, then optimize, refactor, 987 00:48:52,330 --> 00:48:54,830 and get a more optimal solution. Figure, there's lots 988 00:48:54,830 --> 00:48:59,580 of prime number calculations inside of Project Euler. Euler. 989 00:48:59,580 --> 00:49:02,490 Euler. You'll never forget that now. 990 00:49:02,490 --> 00:49:05,870 Code Wars is another. That's, that website launched recently. 991 00:49:05,870 --> 00:49:08,210 CodeWars dot com. You can sign up for JavaScript, 992 00:49:08,210 --> 00:49:11,600 CoffeeScript and Ruby, I think right now. They've got 993 00:49:11,600 --> 00:49:13,900 a bunch of Code Katas. They even call them 994 00:49:13,900 --> 00:49:16,910 Code Katas. You get different belts starting from 8kyu 995 00:49:16,910 --> 00:49:20,020 and work your way up to Grand Master Black 996 00:49:20,020 --> 00:49:24,880 Belt. CodeWars dot com. I, I recommend that to 997 00:49:24,880 --> 00:49:29,250 my students as well. And it's, again, emphasizing test-driven. 998 00:49:29,250 --> 00:49:31,220 You totally don't have to do it test-driven, but 999 00:49:31,220 --> 00:49:33,470 it's a great way to practice. 1000 00:49:33,470 --> 00:49:35,120 There are, there are books on the subject, which 1001 00:49:35,120 --> 00:49:36,600 we'll talk about at the end of our presentation. 1002 00:49:36,600 --> 00:49:37,640 There's a great book by- 1003 00:49:37,640 --> 00:49:43,700 C.S.: Emily Clark, if I remember correctly. 1004 00:49:43,700 --> 00:49:48,900 D.R.: Navigata. Bam. Coding Dojo Handbook. 1005 00:49:48,900 --> 00:49:52,360 C.S.: Emily Bache. Yeah. 1006 00:49:52,360 --> 00:49:59,360 D.R.: Forward by Uncle Bob. Rob Martin. So, this 1007 00:49:59,480 --> 00:50:00,910 has a lot of Katas in it, a lot 1008 00:50:00,910 --> 00:50:04,630 of very standard Katas. What we found in running 1009 00:50:04,630 --> 00:50:07,740 the Coding Dojo for a great, for, for two 1010 00:50:07,740 --> 00:50:09,340 years, two plus years at that point, was that 1011 00:50:09,340 --> 00:50:12,140 you can recycle the same problems over and over 1012 00:50:12,140 --> 00:50:14,650 again. Once you find a couple that are easy 1013 00:50:14,650 --> 00:50:17,690 to explain and get everyone to wrap their heads 1014 00:50:17,690 --> 00:50:20,150 around, you use them over and over and over 1015 00:50:20,150 --> 00:50:22,110 again, and you try them in different languages. You 1016 00:50:22,110 --> 00:50:24,390 try them with different constraints. You just try to 1017 00:50:24,390 --> 00:50:26,900 see if you can solve the dang problem. All 1018 00:50:26,900 --> 00:50:30,130 kinds of things come into your head in the 1019 00:50:30,130 --> 00:50:31,960 weeks in between when you do the Dojo, and 1020 00:50:31,960 --> 00:50:33,980 when you do the Dojo again. 1021 00:50:33,980 --> 00:50:36,430 Some of the common ones are like, Roman numberals- 1022 00:50:36,430 --> 00:50:41,060 Roman numeral conversions. Uncle Bob Martin's famous one was 1023 00:50:41,060 --> 00:50:43,350 the bowling game. We did that one time at 1024 00:50:43,350 --> 00:50:46,210 the Coding Dojo in Orlando. We tried to do 1025 00:50:46,210 --> 00:50:47,860 the bowling game. One time. And what we discovered 1026 00:50:47,860 --> 00:50:49,380 is that nerds actually do not know how to 1027 00:50:49,380 --> 00:50:50,610 score bowling at all. 1028 00:50:50,610 --> 00:50:54,770 It is, that knowledge is completely encapsulated in computer 1029 00:50:54,770 --> 00:50:56,770 software now and no one has committed any of 1030 00:50:56,770 --> 00:50:59,020 it to memory. And does not even understand how 1031 00:50:59,020 --> 00:51:02,210 that software runs anymore. We just know that, occasionally, 1032 00:51:02,210 --> 00:51:06,820 turkeys come on the screen. And we have, only 1033 00:51:06,820 --> 00:51:10,700 if we have the numbers up, right. So. 1034 00:51:10,700 --> 00:51:12,060 Those are great resources for that. 1035 00:51:12,060 --> 00:51:13,080 C.S.: Take a break now? 1036 00:51:13,080 --> 00:51:15,330 D.R.: Yeah. Yeah. Let's take a break, and when 1037 00:51:15,330 --> 00:51:18,490 we come back, we're gonna, we're gonna give everybody 1038 00:51:18,490 --> 00:51:20,520 a post-it note, a different-color post-it note. This is 1039 00:51:20,520 --> 00:51:24,660 some logistics. You'll pair up, or, pair up. You'll 1040 00:51:24,660 --> 00:51:26,410 group up into groups of three and we'll do 1041 00:51:26,410 --> 00:51:29,500 like a Code, Code Retreat-style Coding Dojo with the 1042 00:51:29,500 --> 00:51:31,880 entire group. We got a problem for you. We've 1043 00:51:31,880 --> 00:51:35,310 got some constraints for you. You can totally use 1044 00:51:35,310 --> 00:51:37,780 what you've, what you've learned just right now to 1045 00:51:37,780 --> 00:51:40,570 practice. We'll do that and we'll take another break 1046 00:51:40,570 --> 00:51:42,500 and we'll do another Coding Dojo after that with 1047 00:51:42,500 --> 00:51:43,030 a different problem. 1048 00:51:43,030 --> 00:51:43,240 C.S.: Cool. 1049 00:51:43,240 --> 00:51:44,300 D.R.: Don't have to participate in all three. Don't 1050 00:51:44,300 --> 00:51:45,810 have to participate in any of them. 1051 00:51:45,810 --> 00:51:46,240 C.S.: Yup. 1052 00:51:46,240 --> 00:51:47,940 D.R.: If you don't really want to. But we 1053 00:51:47,940 --> 00:51:50,570 encourage you to, to come and, and play and 1054 00:51:50,570 --> 00:51:51,400 practice with us. 1055 00:51:51,400 --> 00:51:52,470 C.S.: All right. Fifteen minutes? 1056 00:51:52,470 --> 00:51:52,910 D.R.: Yup. 1057 00:51:52,910 --> 00:51:53,550 C.S.: Sounds good? 1058 00:51:53,550 --> 00:51:55,060 D.R.: We'll meet back in fifteen minutes. 1059 00:51:55,060 --> 00:51:55,930 C.S.: All right. Cool. 1060 00:51:55,930 --> 00:51:57,050 Before we start, I want to make sure that 1061 00:51:57,050 --> 00:52:00,650 everyone has Ruby installed. That is pretty much the 1062 00:52:00,650 --> 00:52:04,400 only per-requisite, just to have Ruby, at least 1.9.3, 1063 00:52:04,400 --> 00:52:07,000 I want to say, which is the version that 1064 00:52:07,000 --> 00:52:07,490 comes with miniTest, right. No one- 1065 00:52:07,490 --> 00:52:09,660 how to run, write Ruby from the command line? 1066 00:52:09,660 --> 00:52:16,660 How far down the rabbit hole do we need 1067 00:52:17,170 --> 00:52:18,840 to go? 1068 00:52:18,840 --> 00:52:21,300 C.S.: So if you want to see what version 1069 00:52:21,300 --> 00:52:27,820 of Ruby you have, you run ruby dash dash 1070 00:52:27,820 --> 00:52:28,850 version. And- 1071 00:52:28,850 --> 00:52:35,630 D.R.: In a, in a window that you can- 1072 00:52:35,630 --> 00:52:36,350 C.S.: There you go. Ruby dash dash version. And 1073 00:52:36,350 --> 00:52:38,780 it should be, at least, 1.9.3. For this one, 1074 00:52:38,780 --> 00:52:40,880 I'm using 2 point 0, which is fine. You 1075 00:52:40,880 --> 00:52:42,210 don't have to be on 2 point 0, but 1076 00:52:42,210 --> 00:52:42,280 at least 1.9.3. 1077 00:52:42,280 --> 00:52:42,510 D.R.: And we'll show you that magic bash incantation 1078 00:52:42,510 --> 00:52:46,660 as well if you want to use that in 1079 00:52:46,660 --> 00:52:50,390 your, in your tests. 1080 00:52:50,390 --> 00:52:54,050 C.S.: Cool. So everyone has Ruby at least 1.9.3 1081 00:52:54,050 --> 00:52:57,250 and at least one text editor? Cool. 1082 00:52:57,250 --> 00:52:59,760 D.R.: Something emacs-flavored. 1083 00:52:59,760 --> 00:53:01,430 C.S.: Not. 1084 00:53:01,430 --> 00:53:06,380 Right. So the first problem, we want to group 1085 00:53:06,380 --> 00:53:10,760 into pairs of three, right. So, you might have 1086 00:53:10,760 --> 00:53:15,210 gotten a post-it from David or maybe got yourselves, 1087 00:53:15,210 --> 00:53:17,350 and what we want to do is, we want 1088 00:53:17,350 --> 00:53:19,010 to group together into groups of three, with people 1089 00:53:19,010 --> 00:53:21,840 with the same color post-its. So if you have 1090 00:53:21,840 --> 00:53:25,160 an orange post-it, you look for two other people 1091 00:53:25,160 --> 00:53:26,260 with that same color post-it. 1092 00:53:26,260 --> 00:53:27,760 D.R.: And that, if you have- 1093 00:53:27,760 --> 00:53:31,010 C.S.: Someone's gonna have to get up. 1094 00:53:31,010 --> 00:53:36,520 Going over the etiquettes real quick. Test-driven development, as 1095 00:53:36,520 --> 00:53:39,030 you might have seen us, David and I, doing 1096 00:53:39,030 --> 00:53:43,060 here, is red-green-refactor, so. You write a failing test 1097 00:53:43,060 --> 00:53:47,520 before you write any production code. Giggles. You make 1098 00:53:47,520 --> 00:53:50,220 that test pass. And if you need to, you 1099 00:53:50,220 --> 00:53:52,850 go back and you refactor, right. And then you 1100 00:53:52,850 --> 00:53:54,610 do that cycle. That's the cycle that you want 1101 00:53:54,610 --> 00:53:55,230 to follow. So. 1102 00:53:55,230 --> 00:53:57,070 D.R.: And just because you get to a green 1103 00:53:57,070 --> 00:53:59,110 cycle does not mean you have to refactor. 1104 00:53:59,110 --> 00:53:59,650 C.S.: Right. 1105 00:53:59,650 --> 00:54:01,170 D.R.: But it's a good time to take a 1106 00:54:01,170 --> 00:54:03,990 break. Look, you know, look back at the code 1107 00:54:03,990 --> 00:54:05,760 as a pair, as a group, and say, should 1108 00:54:05,760 --> 00:54:06,050 we refactor? 1109 00:54:06,050 --> 00:54:06,390 C.S.: Yup. 1110 00:54:06,390 --> 00:54:08,650 D.R.: Is there something we can make simpler? Is 1111 00:54:08,650 --> 00:54:10,570 there something we were copying and pasting? Is there 1112 00:54:10,570 --> 00:54:12,370 a different way we could do this? Is there 1113 00:54:12,370 --> 00:54:14,790 another test we should add? Figure, take, take your 1114 00:54:14,790 --> 00:54:16,470 break. Figure out what you're gonna do next. 1115 00:54:16,470 --> 00:54:18,110 C.S.: Right. And we're gonna do the ping pong 1116 00:54:18,110 --> 00:54:20,810 pairing, right. So just like David and I did, 1117 00:54:20,810 --> 00:54:22,810 you write a failing test. You pass it along 1118 00:54:22,810 --> 00:54:24,850 to your co-pilot. So you have three people. Most 1119 00:54:24,850 --> 00:54:26,490 of you have three people. So you're gonna have, 1120 00:54:26,490 --> 00:54:28,940 start with a pilot and a co-pilot, and then 1121 00:54:28,940 --> 00:54:31,360 the third person is gonna be the audience, right. 1122 00:54:31,360 --> 00:54:33,900 And what we recommend is that the audience does 1123 00:54:33,900 --> 00:54:37,010 not talk on red. What that means is that, 1124 00:54:37,010 --> 00:54:39,990 whenever there's a failing test, you let the pair 1125 00:54:39,990 --> 00:54:42,730 figure out what the solution is, right. So only 1126 00:54:42,730 --> 00:54:46,010 the driver and the co-pilot are part of trying 1127 00:54:46,010 --> 00:54:48,070 to figure out how to make that one test 1128 00:54:48,070 --> 00:54:48,360 pass. 1129 00:54:48,360 --> 00:54:50,340 D.R.: But don't think that you're stuck on Alcatraz 1130 00:54:50,340 --> 00:54:54,260 or something. If you're a pair and, you may 1131 00:54:54,260 --> 00:54:56,510 be really new to Ruby, or maybe just new 1132 00:54:56,510 --> 00:54:58,500 to test-driven development and you're like, I don't know 1133 00:54:58,500 --> 00:55:00,130 what to type here. Do you know what to 1134 00:55:00,130 --> 00:55:03,040 type here? I don't know what to type here. 1135 00:55:03,040 --> 00:55:06,800 Please ask your audience first, and if none of 1136 00:55:06,800 --> 00:55:08,780 the three of you know what you're doing next 1137 00:55:08,780 --> 00:55:10,619 or what you need to do next, raise your 1138 00:55:10,619 --> 00:55:12,600 hand. We've got some helpers that'll be walking around. 1139 00:55:12,600 --> 00:55:13,010 C.S.: Right. 1140 00:55:13,010 --> 00:55:13,619 D.R.: Helping out. 1141 00:55:13,619 --> 00:55:14,230 C.S.: And- yeah. 1142 00:55:14,230 --> 00:55:15,450 D.R.: We'll be walking around too. 1143 00:55:15,450 --> 00:55:18,380 C.S.: And, and the internet is not super cool, 1144 00:55:18,380 --> 00:55:21,690 but it's also good to look up. And, I 1145 00:55:21,690 --> 00:55:23,720 mean, internet's not reliable here, right. But you're more 1146 00:55:23,720 --> 00:55:27,410 than free to look up documentation and references and, 1147 00:55:27,410 --> 00:55:29,990 you know, ways to use the API and different 1148 00:55:29,990 --> 00:55:32,330 assertions that you can use. This is an open 1149 00:55:32,330 --> 00:55:33,100 book test. 1150 00:55:33,100 --> 00:55:35,340 D.R.: Yeah. And another thing to keep in mind 1151 00:55:35,340 --> 00:55:38,780 is IRB is open game as well. If you 1152 00:55:38,780 --> 00:55:40,830 are like, like, like you saw with us, when 1153 00:55:40,830 --> 00:55:42,250 we were doing the banana test- 1154 00:55:42,250 --> 00:55:42,750 C.S.: Right. 1155 00:55:42,750 --> 00:55:45,020 D.R.: We wrote a test to describe, to describe, 1156 00:55:45,020 --> 00:55:47,119 to assert what we thought the value of banana 1157 00:55:47,119 --> 00:55:49,100 would be when we passed it to integer. You're 1158 00:55:49,100 --> 00:55:51,460 more than welcome to just close down your editor 1159 00:55:51,460 --> 00:55:55,390 or bring up IRB in whatever fashion you want 1160 00:55:55,390 --> 00:55:58,300 to. And, what is banana.to_i? Oh, it's zero. That's 1161 00:55:58,300 --> 00:56:00,840 weird, but, you know. Whatever. 1162 00:56:00,840 --> 00:56:04,690 So, like, Kaikay was saying, don't talk, the audience 1163 00:56:04,690 --> 00:56:06,500 shouldn't, whoever the audience member is, if you have 1164 00:56:06,500 --> 00:56:09,630 one or two people, don't talk on red. If 1165 00:56:09,630 --> 00:56:12,200 you're not coding, keep quiet unless you're part of 1166 00:56:12,200 --> 00:56:15,240 the pair, right. And it's time to switch. 1167 00:56:15,240 --> 00:56:16,760 If you have an idea, if you have something 1168 00:56:16,760 --> 00:56:18,660 - I think it should do this or I 1169 00:56:18,660 --> 00:56:20,720 think it should do that - rather than trying 1170 00:56:20,720 --> 00:56:22,360 to describe too much of it in English, I 1171 00:56:22,360 --> 00:56:24,360 mean, it might be helpful to, to talk about 1172 00:56:24,360 --> 00:56:26,410 it a little bit in English, show your work 1173 00:56:26,410 --> 00:56:28,350 in code. Show your idea in code. Just write 1174 00:56:28,350 --> 00:56:30,690 an assert statement that does what you think it 1175 00:56:30,690 --> 00:56:32,190 needs to do. Ask the code a question. 1176 00:56:32,190 --> 00:56:34,030 C.S.: And this is not a code golf, right. 1177 00:56:34,030 --> 00:56:37,250 We're not here to show off, right, some Perl 1178 00:56:37,250 --> 00:56:39,820 black magic that you inherited from a previous job. 1179 00:56:39,820 --> 00:56:42,550 So make sure that we're, whatever you write, it's 1180 00:56:42,550 --> 00:56:45,160 explicit enough so that everyone in your group understands, 1181 00:56:45,160 --> 00:56:47,060 right. So if you need to write a little 1182 00:56:47,060 --> 00:56:48,600 bit more. If you need to break out do 1183 00:56:48,600 --> 00:56:50,790 end from a curly brace, do a do end. 1184 00:56:50,790 --> 00:56:51,630 So do that. 1185 00:56:51,630 --> 00:56:54,320 D.R.: Right. And, as the audience, this is like, 1186 00:56:54,320 --> 00:56:56,920 the one exception to the rule. If you see 1187 00:56:56,920 --> 00:57:00,930 the pair deviating from red-green-refactor, like they start writing 1188 00:57:00,930 --> 00:57:04,230 production code before they write a test, you get 1189 00:57:04,230 --> 00:57:06,990 to say, you know, eh, or test, or if 1190 00:57:06,990 --> 00:57:09,270 you see them sit on, they, they've written some 1191 00:57:09,270 --> 00:57:11,460 code and they haven't run the test for awhile, 1192 00:57:11,460 --> 00:57:15,500 eh. Give them the buzzer. Survey says. And if 1193 00:57:15,500 --> 00:57:17,400 you see somebody starting to use voodoo where, whether 1194 00:57:17,410 --> 00:57:20,230 or not you're part of the pair, or they 1195 00:57:20,230 --> 00:57:22,960 just write something and you're like, what is that? 1196 00:57:22,960 --> 00:57:26,300 Raise your hand and say no voodoo, or call 1197 00:57:26,300 --> 00:57:29,000 voodoo on them. Call molligan. Tell them to do 1198 00:57:29,000 --> 00:57:29,580 it over. 1199 00:57:29,580 --> 00:57:30,869 C.S.: And that should be enough. 1200 00:57:30,869 --> 00:57:33,190 So you guys are in groups. You've selected one 1201 00:57:33,190 --> 00:57:36,700 machine to work off of. And, please delete all 1202 00:57:36,700 --> 00:57:38,619 the code that you had previously. Just make sure 1203 00:57:38,619 --> 00:57:40,640 that you start from a blank slate. You're looking 1204 00:57:40,640 --> 00:57:45,720 at a blank canvas. Blank text editor. Everyone good 1205 00:57:45,720 --> 00:57:46,530 to start? 1206 00:57:46,530 --> 00:57:49,050 All right. So here's the problem that you're gonna 1207 00:57:49,050 --> 00:57:50,090 do. 1208 00:57:50,090 --> 00:57:55,090 Boom. A calculator. It's gonna have one operation, which 1209 00:57:55,090 --> 00:57:57,490 is gonna be addition. It should be able to 1210 00:57:57,490 --> 00:58:01,160 take a variable number of arguments, but, we're gonna 1211 00:58:01,160 --> 00:58:03,280 add in a constraint. You're not allowed to use 1212 00:58:03,280 --> 00:58:06,150 inject or, for that matter, reduce. 1213 00:58:06,150 --> 00:58:10,980 D.R.: This somewhat limits the playing field. 1214 00:58:11,020 --> 00:58:13,700 C.S.: Right. So that is the plan of action. And if- 1215 00:58:13,860 --> 00:58:15,680 D.R.: Any questions about the problem? Right? 1216 00:58:17,640 --> 00:58:18,140 C.S.: Cool? 1217 00:58:18,140 --> 00:58:19,880 D.R.: Everybody, everybody grasps the gist of it? If 1218 00:58:19,880 --> 00:58:21,760 you guys get done with this before we get 1219 00:58:21,760 --> 00:58:23,900 done with the overall Dojo, feel free to do 1220 00:58:23,900 --> 00:58:26,600 what Kaikay and I did by expanding the problem. 1221 00:58:26,600 --> 00:58:28,840 What if we gave it strings? Or what if 1222 00:58:28,840 --> 00:58:31,880 we gave it, you know, bananas. Or what if 1223 00:58:31,880 --> 00:58:33,480 we threw an object at it? 1224 00:58:33,480 --> 00:58:34,200 C.S.: Right. 1225 00:58:34,200 --> 00:58:35,200 D.R.: Or whatever, you know. 1226 00:58:35,200 --> 00:58:36,480 AUDIENCE: Can you clarify inject? 1227 00:58:36,480 --> 00:58:40,940 D.R.: So, we were gonna use numbers dot inject. 1228 00:58:40,940 --> 00:58:42,240 We were gonna use array dot inject. 1229 00:58:42,240 --> 00:58:45,040 But as we pointed out the audience, we can also use 1230 00:58:45,040 --> 00:58:46,980 array dot reduce, which I'm much more familiar with 1231 00:58:46,980 --> 00:58:50,100 since I come from JavaScript. So, don't use inject. 1232 00:58:50,100 --> 00:58:53,360 Don't use the reduce methods. There is a third 1233 00:58:53,360 --> 00:58:58,560 option available to you. If you wanted to look 1234 00:58:58,560 --> 00:58:59,510 at each- 1235 00:58:59,510 --> 00:59:00,720 C.S.: Right. 1236 00:59:00,720 --> 00:59:02,540 D.R.: Element in- 1237 00:59:02,540 --> 00:59:04,970 C.S.: -in an array. 1238 00:59:04,970 --> 00:59:07,390 D.R.: Just. Just saying. 1239 00:59:07,390 --> 00:59:11,950 C.S.: Cool. And we're gonna use three minute rotation 1240 00:59:11,950 --> 00:59:14,990 time outs. So let's bring it up here. 1241 00:59:14,990 --> 00:59:19,990 AUDIENCE: [chatter] 1242 00:59:20,700 --> 00:59:21,560 C.S.: Oh no. 1243 00:59:21,560 --> 00:59:22,380 D.R.: Oh, you've got it. You can just stick 1244 00:59:22,380 --> 00:59:23,000 it over there. 1245 00:59:23,000 --> 00:59:27,600 C.S.: All right. So, let's do. Simple timer. 1246 00:59:27,600 --> 00:59:32,060 AUDIENCE: [chatter] 1247 00:59:33,760 --> 00:59:36,020 D.R.: Pop that on the side window there. The 1248 00:59:36,020 --> 00:59:36,560 other window. 1249 00:59:37,320 --> 00:59:42,580 C.S.: Yup. All right. So. So if you need, 1250 00:59:43,130 --> 00:59:45,770 or. Do we show, like, half of it and 1251 00:59:45,770 --> 00:59:46,840 half of that? 1252 00:59:46,840 --> 00:59:48,640 D.R.: Yeah. Yeah. Do the, do the presentation again. 1253 00:59:48,640 --> 00:59:49,140 C.S.: This. 1254 00:59:49,140 --> 00:59:50,540 D.R.: Yeah. Let's do that. 1255 00:59:53,119 --> 00:59:54,959 C.S.: Well, but how do we show both at 1256 00:59:54,960 --> 00:59:55,520 the same time? 1257 00:59:57,430 --> 00:59:58,290 D.R.: Something bizarre. 1258 00:59:58,290 --> 00:59:59,110 C.S.: It's called moom. 1259 00:59:59,110 --> 00:59:59,710 AUDIENCE: Moom. 1260 00:59:59,720 --> 01:00:00,540 C.S.: Yeah. 1261 01:00:00,540 --> 01:00:01,280 AUDIENCE: Thank you. 1262 01:00:01,680 --> 01:00:04,060 D.R.: I use optimal layout, because it's basically the 1263 01:00:04,060 --> 01:00:05,180 same thing. 1264 01:00:05,500 --> 01:00:08,240 C.S.: So if you need a start, your initial 1265 01:00:08,250 --> 01:00:11,060 code, kind of a cheat sheet. This is what 1266 01:00:11,060 --> 01:00:13,890 we used to start. So requiring minitest up at 1267 01:00:13,890 --> 01:00:18,010 the top. Starting off with your test gaze. And 1268 01:00:18,010 --> 01:00:19,710 then writing the first test. If you want to 1269 01:00:19,710 --> 01:00:22,030 set up like the auto run thing, is down 1270 01:00:22,030 --> 01:00:24,790 here at the bottom. 1271 01:00:24,790 --> 01:00:29,250 Remember. Ping pong. Write a failing test. Pass it 1272 01:00:29,250 --> 01:00:30,840 along to your co-pilot. 1273 01:00:30,840 --> 01:00:36,790 D.R.: So then to do the timer, put the 1274 01:00:36,790 --> 01:00:40,760 timer up on the right screen. 1275 01:00:40,760 --> 01:00:44,730 C.S.: Full size? Close that down. 1276 01:00:44,730 --> 01:00:50,680 D.R.: You actually have to reduce the size of 1277 01:00:50,680 --> 01:00:52,000 the font. 1278 01:00:52,000 --> 01:00:53,320 C.S.: Yeah. 1279 01:00:53,320 --> 01:00:54,650 D.R.: Awesome. 1280 01:00:54,650 --> 01:00:56,770 C.S.: All right. 1281 01:00:56,770 --> 01:01:00,150 D.R.: So we're gonna give you three minutes to 1282 01:01:00,150 --> 01:01:02,610 go as a pair. Oh. We'll give you three 1283 01:01:02,610 --> 01:01:05,650 minutes as a pair, right. As the current pair. 1284 01:01:05,650 --> 01:01:07,520 And then when the timer goes off, switch. And 1285 01:01:07,520 --> 01:01:09,530 we'll do the same thing, and after that, we'll 1286 01:01:09,530 --> 01:01:12,940 take, we'll do a little half time. 1287 01:01:12,940 --> 01:01:16,410 AUDIENCE: [chatter] 1288 01:01:16,410 --> 01:01:23,410 C.S.: All right. Let's stop for here. So, stop 1289 01:01:23,980 --> 01:01:27,360 exactly where you are. All right. And now, it's 1290 01:01:27,360 --> 01:01:29,890 time for us to do a little retrospective on 1291 01:01:29,890 --> 01:01:33,640 what we just did. On this round, right. So, 1292 01:01:33,640 --> 01:01:36,490 do we have enough pens here? 1293 01:01:36,490 --> 01:01:38,619 D.R.: We might. 1294 01:01:38,619 --> 01:01:40,960 C.S.: We at least have enough- 1295 01:01:40,960 --> 01:01:43,119 D.R.: Near enough. Enough pens per group. 1296 01:01:43,119 --> 01:01:46,580 So, just like an Agile retrospective, we're gonna ask 1297 01:01:46,580 --> 01:01:49,980 each other just three question. What did we do 1298 01:01:49,980 --> 01:01:51,910 well, that we would like to do the next 1299 01:01:51,910 --> 01:01:54,400 time we do this exercise? What would we like 1300 01:01:54,400 --> 01:01:57,420 to improve for the next time? So what did 1301 01:01:57,420 --> 01:01:59,110 we do well that we want to repeat? What 1302 01:01:59,110 --> 01:02:00,619 did we do maybe not so well, maybe we'd 1303 01:02:00,619 --> 01:02:02,970 like, maybe we'd like to improve for next time. 1304 01:02:02,970 --> 01:02:04,470 And did we meet our goals and why? And, 1305 01:02:04,470 --> 01:02:06,770 again, our stated goals are not, did we solve 1306 01:02:06,770 --> 01:02:07,730 the problem? 1307 01:02:07,730 --> 01:02:10,030 That really wasn't ever an issue. That wasn't really 1308 01:02:10,030 --> 01:02:13,600 any, I mean we, we can continue inventing different 1309 01:02:13,600 --> 01:02:16,050 edge-cases to test this problem against. We can continue 1310 01:02:16,050 --> 01:02:19,540 asking questions of this problem. Even this simple problem, 1311 01:02:19,540 --> 01:02:21,600 for a very long time. So it's never really 1312 01:02:21,600 --> 01:02:23,700 about, did we solve the problem? No, the world 1313 01:02:23,700 --> 01:02:27,210 does not need another adder. 1314 01:02:27,210 --> 01:02:29,670 And most of the problems that we pick are 1315 01:02:29,670 --> 01:02:33,430 gonna be like that. But did we learn something? 1316 01:02:33,430 --> 01:02:36,119 Did we find out something new about Ruby or 1317 01:02:36,119 --> 01:02:38,420 about the people that we work with? Did we 1318 01:02:38,420 --> 01:02:40,820 practice our skills? Do we feel like we have 1319 01:02:40,820 --> 01:02:43,750 gained some skill or knowledge because of this exercise? 1320 01:02:43,750 --> 01:02:46,250 And did we have fun? 1321 01:02:46,250 --> 01:02:48,940 So. We can just, we can start with the. 1322 01:02:48,940 --> 01:02:51,680 Just give you guys another three minutes to figure 1323 01:02:51,680 --> 01:02:51,920 out- 1324 01:02:51,920 --> 01:02:52,410 C.S.: Yeah. 1325 01:02:52,410 --> 01:02:55,100 D.R.: Just ask yours- each other those three questions. 1326 01:02:55,100 --> 01:02:56,450 Did we, what did we do well that we 1327 01:02:56,450 --> 01:02:58,480 want to do for the next one? What did 1328 01:02:58,480 --> 01:03:00,330 we do maybe not so well that we would 1329 01:03:00,330 --> 01:03:03,000 like to improve for the next one? And did 1330 01:03:03,000 --> 01:03:05,220 we meet our goals, and why or why not? 1331 01:03:05,220 --> 01:03:07,670 We'll give you guys another timer for that. 1332 01:03:07,670 --> 01:03:14,670 C.S.: Just write it down on the post-it note 1333 01:03:15,920 --> 01:03:17,320 we gave you, and then we can. 1334 01:03:17,320 --> 01:03:17,720 AUDIENCE: [chatter] 1335 01:03:17,720 --> 01:03:21,160 C.S.: All right. Cool. Stop exactly where you are. 1336 01:03:21,160 --> 01:03:25,450 Go back to your editor. Delete everything. And get 1337 01:03:25,450 --> 01:03:29,900 ready for the next problem. Again, same group. Same 1338 01:03:29,900 --> 01:03:32,330 three minute rotation. But now we're gonna do a 1339 01:03:32,330 --> 01:03:34,109 different problem, right. 1340 01:03:34,109 --> 01:03:37,450 Still on the calculator realm. Still gonna be in 1341 01:03:37,450 --> 01:03:41,210 addition. But now your calc- your new calculator, that 1342 01:03:41,210 --> 01:03:43,030 you're gonna start from scratch, is gonna need to 1343 01:03:43,030 --> 01:03:48,240 take strings as arguments. As an example, you're gonna 1344 01:03:48,240 --> 01:03:52,220 add one as a string, slash two, and it's 1345 01:03:52,220 --> 01:03:56,510 gonna need to return the integer three. 1346 01:03:56,510 --> 01:03:59,190 AUDIENCE: The integer or the string? 1347 01:03:59,190 --> 01:03:59,220 D.R.: The integer. 1348 01:03:59,220 --> 01:04:00,040 C.S.: The integer. To make it- 1349 01:04:00,040 --> 01:04:04,140 D.R.: Stop wherever you want to stop. 1350 01:04:04,140 --> 01:04:09,410 I, I believe there was an earlier presentation on 1351 01:04:09,410 --> 01:04:10,580 just enough. 1352 01:04:10,580 --> 01:04:11,750 AUDIENCE: [chatter] 1353 01:04:11,750 --> 01:04:12,930 C.S.: Cool. 1354 01:04:12,930 --> 01:04:17,470 D.R.: And you can choose to you, you can 1355 01:04:17,470 --> 01:04:20,670 choose that last constraint that we offered. The don't 1356 01:04:20,670 --> 01:04:24,390 use inject. You can, and, take it or leave 1357 01:04:24,390 --> 01:04:27,770 it, right. Doing the calc add with strings might 1358 01:04:27,770 --> 01:04:28,350 be- 1359 01:04:28,350 --> 01:04:30,510 C.S.: More than a big problem to solve. 1360 01:04:30,510 --> 01:04:32,760 D.R.: Right. So, if you want to use inject 1361 01:04:32,760 --> 01:04:33,570 or reduce or yo mama, whatever. It doesn't matter. 1362 01:04:33,570 --> 01:04:34,450 The only, the only requirement we will have is, 1363 01:04:34,450 --> 01:04:35,330 you have to take, you have to accept strings, 1364 01:04:35,330 --> 01:04:36,200 like, one, two, three, four, in, in words, t-h, 1365 01:04:36,200 --> 01:04:38,840 you know, r-e-e. You go up to ten. You 1366 01:04:38,840 --> 01:04:42,300 go up to one-hundred. I don't care. How far 1367 01:04:42,300 --> 01:04:49,109 you want to go. Cause you, there may be 1368 01:04:49,109 --> 01:04:52,070 some typing involved. 1369 01:04:52,070 --> 01:04:54,050 C.S.: Right. 1370 01:04:54,050 --> 01:05:00,100 AUDIENCE: You still want it to return an integer 1371 01:05:00,100 --> 01:05:01,660 or a string? 1372 01:05:01,660 --> 01:05:03,030 D.R.: It should return an integer. 1373 01:05:03,030 --> 01:05:03,740 AUDIENCE: [indecipherable] - or should you forget integers? 1374 01:05:03,740 --> 01:05:06,100 C.S.: Forget. Array delete what you had, and then 1375 01:05:06,100 --> 01:05:10,170 start from scratch, right. 1376 01:05:10,170 --> 01:05:17,170 D.R.: And really, start from scratch. Even back to 1377 01:05:24,530 --> 01:05:25,170 the boiler plate that we gave you guys. 1378 01:05:25,170 --> 01:05:25,359 AUDIENCE: [chatter] 1379 01:05:25,359 --> 01:05:25,920 C.S.: All right everybody. Pencils down. 1380 01:05:25,920 --> 01:05:26,290 D.R.: No more coding. 1381 01:05:26,290 --> 01:05:29,440 C.S.: And just like we did before. Quick retrospective. 1382 01:05:29,440 --> 01:05:32,119 Write down things that worked well for this round. 1383 01:05:32,119 --> 01:05:39,119 Things that could have been better and need improvement 1384 01:05:39,650 --> 01:05:40,000 for upcoming rounds. 1385 01:05:40,000 --> 01:05:41,810 D.R.: And also as a process, as a whole. 1386 01:05:41,810 --> 01:05:45,090 Like, what did you guys like about the whole 1387 01:05:45,090 --> 01:05:47,990 process? What did you guys, what would you guys 1388 01:05:47,990 --> 01:05:50,000 improve about this workshop if you were to go 1389 01:05:50,000 --> 01:05:52,670 to it again? And did you- did we meet 1390 01:05:52,670 --> 01:05:55,540 our goals, and why or why not? So we'll 1391 01:05:55,540 --> 01:05:56,920 give you a couple minutes to do that real 1392 01:05:56,920 --> 01:05:59,810 quick as a group. No more coding. I will 1393 01:05:59,810 --> 01:06:01,930 come by and delete your files. 1394 01:06:01,930 --> 01:06:06,200 So, did we learn something? Everybody learn something? Feel 1395 01:06:06,200 --> 01:06:10,340 like you pulled something your way? Did we practice? 1396 01:06:10,340 --> 01:06:14,450 Do you feel like you've practiced some? Did we 1397 01:06:14,450 --> 01:06:19,300 solve the problem? Some? Solved some of the problem, 1398 01:06:19,300 --> 01:06:22,520 right. Ish. Solved-ish the problem. 1399 01:06:22,520 --> 01:06:23,609 Did we have fun? 1400 01:06:23,609 --> 01:06:24,690 AUDIENCE: Yeah. Yes. Yeah. 1401 01:06:24,690 --> 01:06:25,230 D.R.: Awesome. 1402 01:06:25,230 --> 01:06:25,770 C.S.: Cool. 1403 01:06:25,770 --> 01:06:27,720 D.R.: So, if you want to know more about 1404 01:06:27,720 --> 01:06:31,670 the Coding Dojo, this is Kaikay's new favorite book. 1405 01:06:31,670 --> 01:06:35,630 Coding Dojo Handbook. I'm totally picking up a copy. 1406 01:06:35,630 --> 01:06:37,630 There's way more resources out there. There are local 1407 01:06:37,630 --> 01:06:39,310 meet up groups. You should take this to your 1408 01:06:39,310 --> 01:06:42,330 user group. We started a whole group around Coding 1409 01:06:42,330 --> 01:06:45,780 Dojo in, in Orlando. But we also, because I 1410 01:06:45,780 --> 01:06:47,730 ran the PHP group and I ran the Python 1411 01:06:47,730 --> 01:06:49,050 group at the time, we also used it for 1412 01:06:49,050 --> 01:06:51,550 the Python group and the PHP group. We'll probably 1413 01:06:51,550 --> 01:06:54,160 do it again at node. We've done it at 1414 01:06:54,160 --> 01:06:57,580 Ruby. We've done it all the user groups around. 1415 01:06:57,580 --> 01:06:58,580 If you want to know, if you want to 1416 01:06:58,580 --> 01:07:00,540 get some starting points for that, I wrote a 1417 01:07:00,540 --> 01:07:03,720 blog post on getting start, getting past all the 1418 01:07:03,720 --> 01:07:06,869 Yak shaving of setting up the automated tests running 1419 01:07:06,869 --> 01:07:09,130 in the background and the boilerplate for each one 1420 01:07:09,130 --> 01:07:11,150 of the, for each one of the different languages 1421 01:07:11,150 --> 01:07:12,100 you want to try. 1422 01:07:12,100 --> 01:07:14,630 That's in the Orlando Dojo reporepo on, on GitHub. 1423 01:07:14,630 --> 01:07:17,369 It's, or the Orlando Dojo organization. 1424 01:07:17,369 --> 01:07:22,090 C.S.: Talking about meet ups. The best way to 1425 01:07:22,090 --> 01:07:25,270 actually experience more of this is to do it 1426 01:07:25,270 --> 01:07:29,340 in practice, right. So. So go ahead to meet 1427 01:07:29,340 --> 01:07:31,970 up dot com and look for nearby Coding Dojo 1428 01:07:31,970 --> 01:07:36,400 meet ups. There's plenty of them out there, and 1429 01:07:36,400 --> 01:07:39,119 if you don't find one, more than welcome to 1430 01:07:39,119 --> 01:07:41,990 create one yourself. All you need is a friend 1431 01:07:41,990 --> 01:07:45,320 who you can pair with every week or so, 1432 01:07:45,320 --> 01:07:47,109 and then, if you just put it out there, 1433 01:07:47,109 --> 01:07:50,350 put it online that you guys are meeting every 1434 01:07:50,350 --> 01:07:52,920 week at this specific place at this specific time, 1435 01:07:52,920 --> 01:07:54,359 people will show up. Believe me. 1436 01:07:54,359 --> 01:07:56,130 D.R.: Right. Just be consistent. 1437 01:07:56,130 --> 01:07:59,500 C.S.: Yeah. Just be consistent. And, I think that's 1438 01:07:59,500 --> 01:08:01,480 it for today. If you guys want to talk 1439 01:08:01,480 --> 01:08:02,880 more about this and that-