[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:17.02,0:00:18.24,Default,,0000,0000,0000,,CARLOS SOUZA: Thanks everyone for coming. Dialogue: 0,0:00:18.25,0:00:21.66,Default,,0000,0000,0000,,It's a great pleasure to be here at RailsConf. Dialogue: 0,0:00:21.66,0:00:24.06,Default,,0000,0000,0000,,Just so we know, who's go, coming to RailsConf Dialogue: 0,0:00:24.06,0:00:28.81,Default,,0000,0000,0000,,for the first time? Wow. That's amazing. Dialogue: 0,0:00:28.81,0:00:32.55,Default,,0000,0000,0000,,Cool. Welcome. And, we're gonna be talking Dialogue: 0,0:00:32.55,0:00:35.91,Default,,0000,0000,0000,,to you today a little bit about Coding Dojo, Dialogue: 0,0:00:35.91,0:00:38.55,Default,,0000,0000,0000,,and how you can use the Dojo to improve Dialogue: 0,0:00:38.55,0:00:45.55,Default,,0000,0000,0000,,your coding skills and become better developers. Dialogue: 0,0:00:45.82,0:00:47.89,Default,,0000,0000,0000,,My name's Carlos Souza, and this is my friend Dialogue: 0,0:00:47.89,0:00:51.84,Default,,0000,0000,0000,,David Rogers. We, we're both from Orlando,\NFlorida. We're Dialogue: 0,0:00:51.84,0:00:55.95,Default,,0000,0000,0000,,from Code School, and we love development\Nand we Dialogue: 0,0:00:55.95,0:01:00.07,Default,,0000,0000,0000,,love teaching. And that love for development\Nand for Dialogue: 0,0:01:00.07,0:01:03.92,Default,,0000,0000,0000,,teaching others how to developer brought us\Nto the Dialogue: 0,0:01:03.92,0:01:07.43,Default,,0000,0000,0000,,Coding Dojo, and we formed our Coding Dojo\Ngroup Dialogue: 0,0:01:07.43,0:01:09.57,Default,,0000,0000,0000,,back in Orlando a couple of years back. And Dialogue: 0,0:01:09.57,0:01:14.99,Default,,0000,0000,0000,,we ran that biweekly for about two and a Dialogue: 0,0:01:14.99,0:01:16.51,Default,,0000,0000,0000,,half years? And we also used it, the Coding Dialogue: 0,0:01:16.51,0:01:18.64,Default,,0000,0000,0000,,Dojo as a teaching tool. Dialogue: 0,0:01:18.64,0:01:20.52,Default,,0000,0000,0000,,So what we're gonna do here today is try Dialogue: 0,0:01:20.52,0:01:23.86,Default,,0000,0000,0000,,to teach you guys a little bit about our Dialogue: 0,0:01:23.86,0:01:27.91,Default,,0000,0000,0000,,experience running the Dojo, and we're actually\Ngonna run Dialogue: 0,0:01:27.91,0:01:31.73,Default,,0000,0000,0000,,a Dojo here with you guys, and hopefully you, Dialogue: 0,0:01:31.73,0:01:34.28,Default,,0000,0000,0000,,you can run Dojos on your own. At your Dialogue: 0,0:01:34.28,0:01:37.46,Default,,0000,0000,0000,,company, with your friends, in your local\Nmeet ups. Dialogue: 0,0:01:37.46,0:01:43.30,Default,,0000,0000,0000,,And this is a message to all developers, right. Dialogue: 0,0:01:43.30,0:01:46.13,Default,,0000,0000,0000,,We're all developers here, even if you're\Nnot, if Dialogue: 0,0:01:46.13,0:01:49.11,Default,,0000,0000,0000,,you don't spend your day-to-day coding, I'm\Ngonna ask Dialogue: 0,0:01:49.11,0:01:51.62,Default,,0000,0000,0000,,you to put on the developer hat for just Dialogue: 0,0:01:51.62,0:01:53.89,Default,,0000,0000,0000,,a little bit to understand where we're coming\Nfrom. Dialogue: 0,0:01:53.89,0:01:56.27,Default,,0000,0000,0000,,And then the problems that we're trying to\Nsolve Dialogue: 0,0:01:56.27,0:01:58.10,Default,,0000,0000,0000,,with the Coding Dojo. Dialogue: 0,0:01:58.10,0:02:02.88,Default,,0000,0000,0000,,And we have different levels of exper- expertise,\Nas Dialogue: 0,0:02:02.88,0:02:06.05,Default,,0000,0000,0000,,developers. Maybe you're a beginner developer.\NYou're just starting. Dialogue: 0,0:02:06.05,0:02:08.76,Default,,0000,0000,0000,,You're on the first couple of years of, of Dialogue: 0,0:02:08.76,0:02:12.19,Default,,0000,0000,0000,,working with the software development, with\NRuby, with Rails. Dialogue: 0,0:02:12.19,0:02:15.10,Default,,0000,0000,0000,,Maybe you just graduated a Dev BootCamp. Maybe\Nyou Dialogue: 0,0:02:15.10,0:02:17.72,Default,,0000,0000,0000,,just graduated college, or maybe you're going\Nthrough online Dialogue: 0,0:02:17.72,0:02:20.41,Default,,0000,0000,0000,,classes and learning how to program in Ruby\Nand Dialogue: 0,0:02:20.41,0:02:22.45,Default,,0000,0000,0000,,JavaScript and whatever. Dialogue: 0,0:02:22.45,0:02:24.39,Default,,0000,0000,0000,,Or maybe you're a little bit more advanced.\NYou're Dialogue: 0,0:02:24.39,0:02:28.04,Default,,0000,0000,0000,,more on the intermediate level. You've been\Nworking with Dialogue: 0,0:02:28.04,0:02:30.64,Default,,0000,0000,0000,,the, some programming language and framework\Nfor a couple Dialogue: 0,0:02:30.64,0:02:33.52,Default,,0000,0000,0000,,of years. You're starting to get more responsibilities\Nat Dialogue: 0,0:02:33.52,0:02:36.45,Default,,0000,0000,0000,,work. You're starting to lead projects. Dialogue: 0,0:02:36.45,0:02:39.72,Default,,0000,0000,0000,,And maybe you're even more expert. Maybe you've\Nbeen Dialogue: 0,0:02:39.72,0:02:43.18,Default,,0000,0000,0000,,working with software development for maybe\Nover a decade. Dialogue: 0,0:02:43.18,0:02:45.67,Default,,0000,0000,0000,,Maybe you're an architect. Maybe you're responsible\Nfor the Dialogue: 0,0:02:45.67,0:02:50.16,Default,,0000,0000,0000,,architectural decisions in your company. And,\NI guess, regardless Dialogue: 0,0:02:50.16,0:02:53.73,Default,,0000,0000,0000,,of the level of expertise that you're at,\Nyou've Dialogue: 0,0:02:53.73,0:02:57.32,Default,,0000,0000,0000,,probably realized that this point, the technology\Nthat you're Dialogue: 0,0:02:57.32,0:03:01.36,Default,,0000,0000,0000,,working with, it gets better. It evolves.\NThat's the Dialogue: 0,0:03:01.36,0:03:04.91,Default,,0000,0000,0000,,natural way of things. The tools that we use, Dialogue: 0,0:03:04.91,0:03:06.61,Default,,0000,0000,0000,,they are, they're getting better. Dialogue: 0,0:03:06.61,0:03:10.01,Default,,0000,0000,0000,,And this, especially in the open source community,\Nbecause Dialogue: 0,0:03:10.01,0:03:12.36,Default,,0000,0000,0000,,there's sort of a natural selection. If something\Nis Dialogue: 0,0:03:12.36,0:03:14.94,Default,,0000,0000,0000,,not good enough for the community, the community\Nwill Dialogue: 0,0:03:14.94,0:03:18.75,Default,,0000,0000,0000,,naturally look for better ways of doing something,\Nfor Dialogue: 0,0:03:18.75,0:03:23.94,Default,,0000,0000,0000,,better practices, for better tools, for better\Nframeworks. Dialogue: 0,0:03:23.94,0:03:27.91,Default,,0000,0000,0000,,Just as an example, Rails has an average of Dialogue: 0,0:03:27.91,0:03:32.90,Default,,0000,0000,0000,,a hundred commits every week. So, things change\Nvery, Dialogue: 0,0:03:32.90,0:03:37.01,Default,,0000,0000,0000,,very, very fast. And, Rails is just one of Dialogue: 0,0:03:37.01,0:03:39.22,Default,,0000,0000,0000,,the projects, or the tools that you use on Dialogue: 0,0:03:39.22,0:03:42.01,Default,,0000,0000,0000,,your day to day, when you stop and think. Dialogue: 0,0:03:42.01,0:03:46.40,Default,,0000,0000,0000,,You're using Rails, you're using Ruby, you're\Nusing, you're Dialogue: 0,0:03:46.40,0:03:49.58,Default,,0000,0000,0000,,using Bundler. You're using a, a variety of\Nopen Dialogue: 0,0:03:49.58,0:03:54.23,Default,,0000,0000,0000,,source tools, and they're always changing.\NEvery day, there's Dialogue: 0,0:03:54.23,0:03:57.61,Default,,0000,0000,0000,,many changes going into those projects. New\Nfeatures being Dialogue: 0,0:03:57.61,0:04:02.17,Default,,0000,0000,0000,,added. Old features being removed. Existing\Nfeatures being changed. Dialogue: 0,0:04:02.17,0:04:05.07,Default,,0000,0000,0000,,And it's really, really hard to keep track\Nof Dialogue: 0,0:04:05.07,0:04:07.76,Default,,0000,0000,0000,,all the changes that are going on in all Dialogue: 0,0:04:07.76,0:04:10.12,Default,,0000,0000,0000,,the various tools that you're using. So, what\NI'm Dialogue: 0,0:04:10.12,0:04:13.18,Default,,0000,0000,0000,,trying to say is that us, as developers, we Dialogue: 0,0:04:13.18,0:04:16.04,Default,,0000,0000,0000,,are not necessarily getting better at the\Nsame pace Dialogue: 0,0:04:16.04,0:04:19.13,Default,,0000,0000,0000,,that our tools are evolving. It's very hard\Nto Dialogue: 0,0:04:19.13,0:04:21.22,Default,,0000,0000,0000,,keep track of all the changes that are happening Dialogue: 0,0:04:21.22,0:04:24.13,Default,,0000,0000,0000,,in the ecosystem. And still being able to\Nput Dialogue: 0,0:04:24.13,0:04:26.01,Default,,0000,0000,0000,,on your, your nine to five and pay the Dialogue: 0,0:04:26.01,0:04:26.90,Default,,0000,0000,0000,,bills. Dialogue: 0,0:04:26.90,0:04:31.12,Default,,0000,0000,0000,,And it's, it's good to look at other types Dialogue: 0,0:04:31.12,0:04:34.34,Default,,0000,0000,0000,,of artists, other people that work with creativity\Nor Dialogue: 0,0:04:34.34,0:04:39.95,Default,,0000,0000,0000,,art. Say, musicians and athletes, that also\Nrely on Dialogue: 0,0:04:39.95,0:04:42.94,Default,,0000,0000,0000,,their art, right, and they, they need to practice, Dialogue: 0,0:04:42.94,0:04:46.60,Default,,0000,0000,0000,,right. So martial artists, like the first\Nguy on Dialogue: 0,0:04:46.60,0:04:49.60,Default,,0000,0000,0000,,the, on the first slide, he goes to the Dialogue: 0,0:04:49.60,0:04:54.03,Default,,0000,0000,0000,,gym 24/7. He's practicing a lot, right. Musicians\N- Dialogue: 0,0:04:54.03,0:04:57.13,Default,,0000,0000,0000,,they practice a lot before going into the\Nstudio, Dialogue: 0,0:04:57.13,0:04:58.44,Default,,0000,0000,0000,,before putting on a show. Dialogue: 0,0:04:58.44,0:05:01.66,Default,,0000,0000,0000,,And. The microphone died. There's another\None. Is, is Dialogue: 0,0:05:01.66,0:05:07.78,Default,,0000,0000,0000,,there another microphone, perhaps? No? There's\Njust one microphone. Dialogue: 0,0:05:07.78,0:05:12.85,Default,,0000,0000,0000,,Oh man. That sucks. So. Well, so yeah. So, Dialogue: 0,0:05:12.85,0:05:17.06,Default,,0000,0000,0000,,all these athletes and artists, they spend\Ncountless hours Dialogue: 0,0:05:17.06,0:05:19.21,Default,,0000,0000,0000,,in the gym or at the studio practicing their Dialogue: 0,0:05:19.21,0:05:22.04,Default,,0000,0000,0000,,art, so when the time comes to perform, they Dialogue: 0,0:05:22.04,0:05:24.63,Default,,0000,0000,0000,,are prepared. So they all practice. Dialogue: 0,0:05:24.63,0:05:27.68,Default,,0000,0000,0000,,You want to talk a little bit about practicing, Dialogue: 0,0:05:27.68,0:05:28.19,Default,,0000,0000,0000,,David? Dialogue: 0,0:05:28.19,0:05:32.51,Default,,0000,0000,0000,,DAVID ROGERS: Pass the mic. Yeah, so, I, you Dialogue: 0,0:05:32.51,0:05:36.01,Default,,0000,0000,0000,,know, the one key point here is that as, Dialogue: 0,0:05:36.01,0:05:37.95,Default,,0000,0000,0000,,as practitioners of an art or a craft, we Dialogue: 0,0:05:37.95,0:05:42.04,Default,,0000,0000,0000,,need to practice as well. Anybody read Malcolm\NGladwell's Dialogue: 0,0:05:42.04,0:05:45.20,Default,,0000,0000,0000,,book Outliers, or heard of Outliers? I think\Nthe Dialogue: 0,0:05:45.20,0:05:49.81,Default,,0000,0000,0000,,one take away from Outliers is that, the one, Dialogue: 0,0:05:49.81,0:05:52.76,Default,,0000,0000,0000,,while it appears that some people are exceptional\Nand Dialogue: 0,0:05:52.76,0:05:55.42,Default,,0000,0000,0000,,live outside of the regular bell curve, what\Nit Dialogue: 0,0:05:55.42,0:05:57.66,Default,,0000,0000,0000,,actually turns out to be the case is that Dialogue: 0,0:05:57.66,0:06:01.14,Default,,0000,0000,0000,,they were given, or have spent, much more\Ntime Dialogue: 0,0:06:01.14,0:06:05.23,Default,,0000,0000,0000,,practicing. That, that, on average, it's somewhere\Naround 10,000 Dialogue: 0,0:06:05.23,0:06:07.85,Default,,0000,0000,0000,,hours worth of practice in order to become\Nan Dialogue: 0,0:06:07.85,0:06:10.02,Default,,0000,0000,0000,,expert in a particular field was, that was\Nhis Dialogue: 0,0:06:10.02,0:06:11.47,Default,,0000,0000,0000,,assertation. Dialogue: 0,0:06:11.47,0:06:13.96,Default,,0000,0000,0000,,The one big take away from the book is Dialogue: 0,0:06:13.96,0:06:15.91,Default,,0000,0000,0000,,that, that is ind of summed up in one Dialogue: 0,0:06:15.91,0:06:18.33,Default,,0000,0000,0000,,quote there, that practice isn't the thing\Nthat you Dialogue: 0,0:06:18.33,0:06:21.37,Default,,0000,0000,0000,,do once you get good. It is the thing Dialogue: 0,0:06:21.37,0:06:23.60,Default,,0000,0000,0000,,that you do that makes you good. And, some Dialogue: 0,0:06:23.60,0:06:26.44,Default,,0000,0000,0000,,of you might be saying, well, I practice.\NOf Dialogue: 0,0:06:26.44,0:06:28.78,Default,,0000,0000,0000,,course I practice. I practice every day. I\Npractice Dialogue: 0,0:06:28.78,0:06:31.65,Default,,0000,0000,0000,,every day for nine hours, sometimes ten hours,\Noccasionally Dialogue: 0,0:06:31.65,0:06:35.33,Default,,0000,0000,0000,,twelve hours, sometimes twenty-four or seventy-two\Nhours at a Dialogue: 0,0:06:35.33,0:06:37.49,Default,,0000,0000,0000,,stint. And then eventually take a shower or\Ndie Dialogue: 0,0:06:37.49,0:06:39.75,Default,,0000,0000,0000,,and fall into a coma. Dialogue: 0,0:06:39.75,0:06:42.43,Default,,0000,0000,0000,,But, the key thing to remember there is that Dialogue: 0,0:06:42.43,0:06:46.28,Default,,0000,0000,0000,,work does not equal practice. Like Carlos\Nwas saying, Dialogue: 0,0:06:46.28,0:06:48.28,Default,,0000,0000,0000,,when you look at a martial artist or you Dialogue: 0,0:06:48.28,0:06:50.37,Default,,0000,0000,0000,,look at a concert violinist, or you look at Dialogue: 0,0:06:50.37,0:06:53.06,Default,,0000,0000,0000,,someone who practices a craft or a art for Dialogue: 0,0:06:53.06,0:06:57.24,Default,,0000,0000,0000,,their profession, they don't perform nearly\Nas much time Dialogue: 0,0:06:57.24,0:06:59.99,Default,,0000,0000,0000,,as they practice. There's a def- there's a\Ndefinite Dialogue: 0,0:06:59.99,0:07:03.37,Default,,0000,0000,0000,,separation between the performance of their\Nart and the Dialogue: 0,0:07:03.37,0:07:05.27,Default,,0000,0000,0000,,practice of their art. Dialogue: 0,0:07:05.27,0:07:07.49,Default,,0000,0000,0000,,So we can't really equate what we do on Dialogue: 0,0:07:07.49,0:07:11.21,Default,,0000,0000,0000,,a daily basis, nine to five, as practice.\NThat's Dialogue: 0,0:07:11.21,0:07:15.34,Default,,0000,0000,0000,,work. We need, do ship software. We need to Dialogue: 0,0:07:15.34,0:07:18.56,Default,,0000,0000,0000,,perform. We need to hit our deadlines. We're\Nconcerned Dialogue: 0,0:07:18.56,0:07:22.71,Default,,0000,0000,0000,,with building stuff that works. Work time\Nis not Dialogue: 0,0:07:22.71,0:07:23.80,Default,,0000,0000,0000,,practice time. Dialogue: 0,0:07:23.80,0:07:27.21,Default,,0000,0000,0000,,Well, then that brings up the inevitable question,\Nhow Dialogue: 0,0:07:27.21,0:07:30.02,Default,,0000,0000,0000,,then, do we practice what it is that we Dialogue: 0,0:07:30.02,0:07:34.02,Default,,0000,0000,0000,,do? And how should we practice what we do? Dialogue: 0,0:07:34.02,0:07:36.67,Default,,0000,0000,0000,,What does practicing code actually look like?\NHow do Dialogue: 0,0:07:36.67,0:07:38.60,Default,,0000,0000,0000,,I practice, as a programmer? Dialogue: 0,0:07:38.60,0:07:40.18,Default,,0000,0000,0000,,Well, one way we could do that is to Dialogue: 0,0:07:40.18,0:07:43.49,Default,,0000,0000,0000,,emulate how other artists practice their art\Nand their Dialogue: 0,0:07:43.49,0:07:45.37,Default,,0000,0000,0000,,craft. Dialogue: 0,0:07:45.37,0:07:49.99,Default,,0000,0000,0000,,C.S.: And we're talking about here, is, for\Nexample, Dialogue: 0,0:07:49.99,0:07:53.96,Default,,0000,0000,0000,,martial arts. So we have the, the term Dojo, Dialogue: 0,0:07:53.96,0:07:57.05,Default,,0000,0000,0000,,which in martial arts means, the place where\Npeople Dialogue: 0,0:07:57.05,0:08:00.21,Default,,0000,0000,0000,,practice those arts. And this is a term that Dialogue: 0,0:08:00.21,0:08:05.17,Default,,0000,0000,0000,,was coined by Dave Thomas of the Pragmatic\NProgrammers. Dialogue: 0,0:08:05.17,0:08:07.58,Default,,0000,0000,0000,,And he brought that to the programming world,\Nsaying Dialogue: 0,0:08:07.58,0:08:10.36,Default,,0000,0000,0000,,we should set up a Dojo for programming, so Dialogue: 0,0:08:10.36,0:08:13.85,Default,,0000,0000,0000,,we can practice code. Dialogue: 0,0:08:13.85,0:08:18.30,Default,,0000,0000,0000,,D.R.: And the, the keys to a code Coding Dialogue: 0,0:08:18.30,0:08:20.79,Default,,0000,0000,0000,,Dojo is that we are providing, just like in Dialogue: 0,0:08:20.79,0:08:25.74,Default,,0000,0000,0000,,a martial arts setting, we're providing a\Nsafe, collaborative, Dialogue: 0,0:08:25.74,0:08:30.30,Default,,0000,0000,0000,,non-competitive location at a, at a space\Nand a Dialogue: 0,0:08:30.30,0:08:34.82,Default,,0000,0000,0000,,time to practice together. We get together\Nand we Dialogue: 0,0:08:34.82,0:08:37.94,Default,,0000,0000,0000,,code. WE learn something. We actually practice\Nprogramming. WE Dialogue: 0,0:08:37.94,0:08:40.21,Default,,0000,0000,0000,,practice learning and teaching one another.\NAnd we also Dialogue: 0,0:08:40.21,0:08:41.63,Default,,0000,0000,0000,,have a lot of fun. Just like you would Dialogue: 0,0:08:41.63,0:08:43.48,Default,,0000,0000,0000,,if you, has anybody taken martial arts of\Nany Dialogue: 0,0:08:43.48,0:08:46.11,Default,,0000,0000,0000,,sort? Yoga counts. Well, I'll give you yoga,\Nright, Dialogue: 0,0:08:46.11,0:08:48.07,Default,,0000,0000,0000,,we'll give you yoga, right. Dialogue: 0,0:08:48.07,0:08:52.82,Default,,0000,0000,0000,,So, that's, that's really the goal of the,\Nthe Dialogue: 0,0:08:52.82,0:08:56.55,Default,,0000,0000,0000,,Dojo. But, how we actually live it out is, Dialogue: 0,0:08:56.55,0:09:00.79,Default,,0000,0000,0000,,just like in martial arts, we practice Katas.\NAnd Dialogue: 0,0:09:00.79,0:09:03.62,Default,,0000,0000,0000,,a Kata in martial arts is this kind of Dialogue: 0,0:09:03.62,0:09:08.72,Default,,0000,0000,0000,,detailed choreography of very ritualized movements\Nthat you practice, Dialogue: 0,0:09:08.72,0:09:11.81,Default,,0000,0000,0000,,either solo or in a pair or in a Dialogue: 0,0:09:11.81,0:09:14.80,Default,,0000,0000,0000,,group. And they don't really have a direct\Ntranslation Dialogue: 0,0:09:14.80,0:09:17.24,Default,,0000,0000,0000,,to, if I was a martial artist, fighting another Dialogue: 0,0:09:17.24,0:09:21.03,Default,,0000,0000,0000,,person. Like, I would not use my Kata skills Dialogue: 0,0:09:21.03,0:09:23.84,Default,,0000,0000,0000,,to win a battle. But, they teach me how Dialogue: 0,0:09:23.84,0:09:26.94,Default,,0000,0000,0000,,to punch. They teach me how to block. They Dialogue: 0,0:09:26.94,0:09:30.07,Default,,0000,0000,0000,,teach me how to evade, through the choreography.\NSo Dialogue: 0,0:09:30.07,0:09:32.01,Default,,0000,0000,0000,,that when the time comes to actually block\Na Dialogue: 0,0:09:32.01,0:09:35.00,Default,,0000,0000,0000,,punch or throw a punch, my body remembers\Neven Dialogue: 0,0:09:35.00,0:09:36.67,Default,,0000,0000,0000,,though my brain is not thinking about throwing\Na Dialogue: 0,0:09:36.67,0:09:38.03,Default,,0000,0000,0000,,punch here. Dialogue: 0,0:09:38.03,0:09:41.73,Default,,0000,0000,0000,,In programmer, as Carlos was saying, Dave\NThomas, Pragmatic Dialogue: 0,0:09:41.73,0:09:45.97,Default,,0000,0000,0000,,Programmer Dave, Prag Dave, coined this term\Nto describe, Dialogue: 0,0:09:45.97,0:09:47.40,Default,,0000,0000,0000,,along with Kent Beck and some of the other Dialogue: 0,0:09:47.40,0:09:51.10,Default,,0000,0000,0000,,guys, Ward Cunningham, tried to describe a\Nmethod of Dialogue: 0,0:09:51.10,0:09:54.00,Default,,0000,0000,0000,,practice inside of a Dojo. So inside of a Dialogue: 0,0:09:54.00,0:09:56.88,Default,,0000,0000,0000,,Coding Dojo, just like inside of a Karate\NDojo, Dialogue: 0,0:09:56.88,0:10:00.71,Default,,0000,0000,0000,,we practice Katas, which are choreographed\Npatterns of movements Dialogue: 0,0:10:00.71,0:10:03.89,Default,,0000,0000,0000,,that we practice either in solo or in pair, Dialogue: 0,0:10:03.89,0:10:08.32,Default,,0000,0000,0000,,to reinforce skills that we don't necess-\Nwe wouldn't Dialogue: 0,0:10:08.32,0:10:12.08,Default,,0000,0000,0000,,necessarily use in the choreographed pattern,\Nbut we would Dialogue: 0,0:10:12.08,0:10:14.29,Default,,0000,0000,0000,,use on a daily basis when we actually come Dialogue: 0,0:10:14.29,0:10:16.08,Default,,0000,0000,0000,,face-to-face with that variable that needs\Nto be punched Dialogue: 0,0:10:16.08,0:10:17.42,Default,,0000,0000,0000,,in the head. Dialogue: 0,0:10:17.42,0:10:19.69,Default,,0000,0000,0000,,And we break that down, when we're talking\Nabout Dialogue: 0,0:10:19.69,0:10:24.18,Default,,0000,0000,0000,,choreographed patterns, inside of the Dojo\Ninside of a Dialogue: 0,0:10:24.18,0:10:28.75,Default,,0000,0000,0000,,coding Kata, as Prag Dave coined it, we're\Ntalking Dialogue: 0,0:10:28.75,0:10:31.08,Default,,0000,0000,0000,,about test-driven development. And, regardless\Nof what you may Dialogue: 0,0:10:31.08,0:10:36.42,Default,,0000,0000,0000,,have heard earlier today, tests are not the\Ndevil. Dialogue: 0,0:10:36.42,0:10:39.12,Default,,0000,0000,0000,,They will not, they are not a sin, and Dialogue: 0,0:10:39.12,0:10:40.81,Default,,0000,0000,0000,,a lot of the Pragmatic guys, a lot of Dialogue: 0,0:10:40.81,0:10:42.98,Default,,0000,0000,0000,,the guys that we're talking about, that coined\Nthe Dialogue: 0,0:10:42.98,0:10:47.29,Default,,0000,0000,0000,,terms the Dojo and Katas, were in that deck Dialogue: 0,0:10:47.29,0:10:50.11,Default,,0000,0000,0000,,referring to just enough testing. Dialogue: 0,0:10:50.11,0:10:52.31,Default,,0000,0000,0000,,What we're doing in the Dojo is not just Dialogue: 0,0:10:52.31,0:10:56.04,Default,,0000,0000,0000,,enough testing. It is way-too-much testing,\Nso that we Dialogue: 0,0:10:56.04,0:10:59.87,Default,,0000,0000,0000,,can practice the art of testing. When we practice Dialogue: 0,0:10:59.87,0:11:02.32,Default,,0000,0000,0000,,martial arts, and we learn a Kata in martial Dialogue: 0,0:11:02.32,0:11:05.48,Default,,0000,0000,0000,,arts, we're not punching just enough. We're\Npunching a Dialogue: 0,0:11:05.48,0:11:08.35,Default,,0000,0000,0000,,whole lot, so that when the time comes to Dialogue: 0,0:11:08.35,0:11:10.69,Default,,0000,0000,0000,,actually punch, we know how much to punch\Nand Dialogue: 0,0:11:10.69,0:11:13.12,Default,,0000,0000,0000,,with how much force we're to punch. Dialogue: 0,0:11:13.12,0:11:14.77,Default,,0000,0000,0000,,C.S.: And it's, it's kind of, if you play Dialogue: 0,0:11:14.77,0:11:18.61,Default,,0000,0000,0000,,a musical instrument, you, and you practice\Nthat musical Dialogue: 0,0:11:18.61,0:11:21.17,Default,,0000,0000,0000,,instrument, chances are, you're practicing\Nalong with a metronome. Dialogue: 0,0:11:21.17,0:11:23.29,Default,,0000,0000,0000,,And I like to make that analogy between a Dialogue: 0,0:11:23.29,0:11:27.59,Default,,0000,0000,0000,,metronome and writing tests when you're practicing,\Nright. So Dialogue: 0,0:11:27.59,0:11:30.23,Default,,0000,0000,0000,,you need to metronome when you're practicing\Nmusic to Dialogue: 0,0:11:30.23,0:11:33.31,Default,,0000,0000,0000,,keep that pace, so you can focus on repeating Dialogue: 0,0:11:33.31,0:11:36.85,Default,,0000,0000,0000,,your movements very, very slowly, and with\Nvery close Dialogue: 0,0:11:36.85,0:11:40.91,Default,,0000,0000,0000,,attention, so you can gradually increase the\Nspeed to Dialogue: 0,0:11:40.91,0:11:43.59,Default,,0000,0000,0000,,which you play, to get to the point where Dialogue: 0,0:11:43.59,0:11:46.47,Default,,0000,0000,0000,,you're shredding that speed solo. And then\Nwhen you Dialogue: 0,0:11:46.47,0:11:49.03,Default,,0000,0000,0000,,play that live it just feels natural. Dialogue: 0,0:11:49.03,0:11:50.83,Default,,0000,0000,0000,,But, for you to get to that point, you Dialogue: 0,0:11:50.83,0:11:52.87,Default,,0000,0000,0000,,needed to start very slowly, and you needed\Na Dialogue: 0,0:11:52.87,0:11:56.05,Default,,0000,0000,0000,,tool to assist you. In music, that's the metronome. Dialogue: 0,0:11:56.05,0:12:00.73,Default,,0000,0000,0000,,In coding, that's test-driven development.\NThat's writing tests. And, Dialogue: 0,0:12:00.73,0:12:03.20,Default,,0000,0000,0000,,like Dave said, in the Coding Dojo, we're\Nnot Dialogue: 0,0:12:03.20,0:12:06.62,Default,,0000,0000,0000,,practicing just enough tests. We're practicing\Na whole lot Dialogue: 0,0:12:06.62,0:12:08.88,Default,,0000,0000,0000,,of tests. So when the time comes for you Dialogue: 0,0:12:08.88,0:12:11.47,Default,,0000,0000,0000,,to write production code, you'll naturally\Nbe able to Dialogue: 0,0:12:11.47,0:12:15.67,Default,,0000,0000,0000,,tell whether you need to test-drive that feature\Nor Dialogue: 0,0:12:15.67,0:12:19.66,Default,,0000,0000,0000,,not. Dialogue: 0,0:12:19.66,0:12:23.81,Default,,0000,0000,0000,,And one other thing that we practice is pair Dialogue: 0,0:12:23.81,0:12:26.69,Default,,0000,0000,0000,,programming. And pair programming is not just\Nsitting down Dialogue: 0,0:12:26.69,0:12:29.71,Default,,0000,0000,0000,,and coding next to someone. It requires a\Nset Dialogue: 0,0:12:29.71,0:12:33.36,Default,,0000,0000,0000,,of social skills. It requires knowing how\Nto suggest Dialogue: 0,0:12:33.36,0:12:36.22,Default,,0000,0000,0000,,a feature, knowing how to accept a suggestion,\Nknowing Dialogue: 0,0:12:36.22,0:12:38.30,Default,,0000,0000,0000,,how to accept a criticism, and not take it Dialogue: 0,0:12:38.30,0:12:41.37,Default,,0000,0000,0000,,personally. So there's way more to pair programming\Nthan Dialogue: 0,0:12:41.37,0:12:44.30,Default,,0000,0000,0000,,simply sitting next to each other and either\Nwatching Dialogue: 0,0:12:44.30,0:12:46.54,Default,,0000,0000,0000,,them code or telling them what to code. Dialogue: 0,0:12:46.54,0:12:49.60,Default,,0000,0000,0000,,D.R.: And, and again, like, like Kaikay was\Nsaying, Dialogue: 0,0:12:49.60,0:12:53.48,Default,,0000,0000,0000,,these are, these are social skills. And while\Nthey Dialogue: 0,0:12:53.48,0:12:57.61,Default,,0000,0000,0000,,might be accentuated inside of the Dojo, they\Ndefinitely Dialogue: 0,0:12:57.61,0:12:59.86,Default,,0000,0000,0000,,have a lasting impact as a programmer. I,\NI Dialogue: 0,0:12:59.86,0:13:03.16,Default,,0000,0000,0000,,personally, and Kaikay, we both pair program\Nas a Dialogue: 0,0:13:03.16,0:13:06.44,Default,,0000,0000,0000,,part of our writing production code, as a\Npart Dialogue: 0,0:13:06.44,0:13:10.95,Default,,0000,0000,0000,,of our performant art, and we've found a huge Dialogue: 0,0:13:10.95,0:13:15.35,Default,,0000,0000,0000,,increase in our productivity whenever we selectively\Nand intentionally Dialogue: 0,0:13:15.35,0:13:16.17,Default,,0000,0000,0000,,pair with others. Dialogue: 0,0:13:16.17,0:13:17.51,Default,,0000,0000,0000,,Maybe we don't do it all the time. We Dialogue: 0,0:13:17.51,0:13:18.89,Default,,0000,0000,0000,,certainly don't do it all the time, because\Nsometimes Dialogue: 0,0:13:18.89,0:13:22.50,Default,,0000,0000,0000,,you just gotta get stuff done, right. But\Nwhen Dialogue: 0,0:13:22.50,0:13:24.75,Default,,0000,0000,0000,,we do pair, we know the etiquettes, we know Dialogue: 0,0:13:24.75,0:13:28.28,Default,,0000,0000,0000,,the social currency to be able to use one Dialogue: 0,0:13:28.28,0:13:30.98,Default,,0000,0000,0000,,of the styles of pair programming. Be it pilot, Dialogue: 0,0:13:30.98,0:13:33.40,Default,,0000,0000,0000,,co-pilot, where I sit back and Kaikay's on\Nthe Dialogue: 0,0:13:33.40,0:13:37.83,Default,,0000,0000,0000,,keyboard and he types into the, into the editor Dialogue: 0,0:13:37.83,0:13:42.11,Default,,0000,0000,0000,,and I make suggestions, or I notice syntax\Nerrors Dialogue: 0,0:13:42.11,0:13:45.03,Default,,0000,0000,0000,,or I ask him questions about what he's doing Dialogue: 0,0:13:45.03,0:13:46.70,Default,,0000,0000,0000,,and he tells me how he's going to do Dialogue: 0,0:13:46.70,0:13:49.52,Default,,0000,0000,0000,,something, and then we switch and I start\Ntyping Dialogue: 0,0:13:49.52,0:13:52.44,Default,,0000,0000,0000,,and he plays co-pilot and helps keep me, navigating. Dialogue: 0,0:13:52.44,0:13:54.48,Default,,0000,0000,0000,,Or you use a ping-pong type approach. There's\Nlots Dialogue: 0,0:13:54.48,0:13:56.08,Default,,0000,0000,0000,,of different types that we can, that we can Dialogue: 0,0:13:56.08,0:13:59.09,Default,,0000,0000,0000,,use. For the Coding Dojo, especially when\Nwe're talking Dialogue: 0,0:13:59.09,0:14:03.46,Default,,0000,0000,0000,,about small pairs or to practice pair programming,\Nin Dialogue: 0,0:14:03.46,0:14:06.03,Default,,0000,0000,0000,,this Coding Dojo we're gonna use a ping pong Dialogue: 0,0:14:06.03,0:14:07.59,Default,,0000,0000,0000,,approach. And in that, and that approach is\Na Dialogue: 0,0:14:07.59,0:14:11.61,Default,,0000,0000,0000,,lot like playing ping pong. One person serves\Nthe Dialogue: 0,0:14:11.61,0:14:14.73,Default,,0000,0000,0000,,ball by writing some tests, and the tests\Nthen Dialogue: 0,0:14:14.73,0:14:18.55,Default,,0000,0000,0000,,fail, right. Test-driven development. We do\Nred-green-refactor. So the Dialogue: 0,0:14:18.55,0:14:22.18,Default,,0000,0000,0000,,tests fail. Then he passes the mic over to Dialogue: 0,0:14:22.18,0:14:25.44,Default,,0000,0000,0000,,the pair, his, his partner then writes some\Ncode Dialogue: 0,0:14:25.44,0:14:27.91,Default,,0000,0000,0000,,to pass the test. They might talk, the pair Dialogue: 0,0:14:27.91,0:14:30.05,Default,,0000,0000,0000,,will talk through it, but write some code\Nto Dialogue: 0,0:14:30.05,0:14:32.88,Default,,0000,0000,0000,,pass the tests. And then, immediately writes\Nanother test Dialogue: 0,0:14:32.88,0:14:35.28,Default,,0000,0000,0000,,that will fail, to serve the ball back across Dialogue: 0,0:14:35.28,0:14:37.12,Default,,0000,0000,0000,,the net to his partner. Dialogue: 0,0:14:37.12,0:14:39.01,Default,,0000,0000,0000,,We'll see an example of that a little bit Dialogue: 0,0:14:39.01,0:14:41.24,Default,,0000,0000,0000,,later. We'll do a, a, what's called a practice Dialogue: 0,0:14:41.24,0:14:43.58,Default,,0000,0000,0000,,Kata. But, Kaikay, why don't you tell us a Dialogue: 0,0:14:43.58,0:14:45.67,Default,,0000,0000,0000,,little bit more about the different types\Nof Katas Dialogue: 0,0:14:45.67,0:14:46.20,Default,,0000,0000,0000,,that we could do. Dialogue: 0,0:14:46.20,0:14:48.85,Default,,0000,0000,0000,,Anybody have any questions so far, before\Nwe, before Dialogue: 0,0:14:48.85,0:14:51.15,Default,,0000,0000,0000,,we go on? Is everybody tracking on that, you Dialogue: 0,0:14:51.15,0:14:54.69,Default,,0000,0000,0000,,know, for, four to five fingers? Perhaps just\None. Dialogue: 0,0:14:54.69,0:14:57.22,Default,,0000,0000,0000,,One finger. No? OK. Dialogue: 0,0:14:57.22,0:15:01.25,Default,,0000,0000,0000,,C.S.: So there, there's different types of\NKatas. The Dialogue: 0,0:15:01.25,0:15:04.39,Default,,0000,0000,0000,,three most popular, I want to say, the Randori Dialogue: 0,0:15:04.39,0:15:07.97,Default,,0000,0000,0000,,Kata, the Prepared and the Code Retreat, which\Nis Dialogue: 0,0:15:07.97,0:15:09.76,Default,,0000,0000,0000,,more like an event, but we're gonna treat\Nit Dialogue: 0,0:15:09.76,0:15:10.55,Default,,0000,0000,0000,,as a Kata. Dialogue: 0,0:15:10.55,0:15:14.17,Default,,0000,0000,0000,,And the Randori Kata is the most popular for Dialogue: 0,0:15:14.17,0:15:17.96,Default,,0000,0000,0000,,meet ups and schools and university. David\Nis a Dialogue: 0,0:15:17.96,0:15:21.15,Default,,0000,0000,0000,,teacher at a local university in Orlando,\Nand he Dialogue: 0,0:15:21.15,0:15:23.89,Default,,0000,0000,0000,,uses Coding Dojo as part of the curriculum. Dialogue: 0,0:15:23.89,0:15:26.45,Default,,0000,0000,0000,,And the way that the Randori works, you have Dialogue: 0,0:15:26.45,0:15:29.42,Default,,0000,0000,0000,,one computer, and the code in that computer\Nis Dialogue: 0,0:15:29.42,0:15:33.29,Default,,0000,0000,0000,,projected onto a screen, where an audience,\Nbetween five Dialogue: 0,0:15:33.29,0:15:34.99,Default,,0000,0000,0000,,and fifteen people, a little bit more than\Nthat Dialogue: 0,0:15:34.99,0:15:37.27,Default,,0000,0000,0000,,gets a little bit confusing. So, the audience\Nis Dialogue: 0,0:15:37.27,0:15:41.87,Default,,0000,0000,0000,,watching the code, is watching the evolution\Nof the Dialogue: 0,0:15:41.87,0:15:44.04,Default,,0000,0000,0000,,code towards the solution all the time. So\Nthey're Dialogue: 0,0:15:44.04,0:15:46.89,Default,,0000,0000,0000,,constantly, you know, learning things and\Nwatching where the Dialogue: 0,0:15:46.89,0:15:49.02,Default,,0000,0000,0000,,pair is going with the code. Dialogue: 0,0:15:49.02,0:15:52.39,Default,,0000,0000,0000,,And, in the computer, there's always two people\Npair Dialogue: 0,0:15:52.39,0:15:55.90,Default,,0000,0000,0000,,programming. The pilot and the co-pilot. And\Nevery three Dialogue: 0,0:15:55.90,0:15:59.98,Default,,0000,0000,0000,,to seven minutes, they rotate. So, the driver\Ngoes Dialogue: 0,0:15:59.98,0:16:03.03,Default,,0000,0000,0000,,back to the audience. The co-pilot becomes\Nthe pilot. Dialogue: 0,0:16:03.03,0:16:06.12,Default,,0000,0000,0000,,And someone from the audience volunteers to\Nbe the Dialogue: 0,0:16:06.12,0:16:08.23,Default,,0000,0000,0000,,co-pilot. So that way we have everyone in\Nthe Dialogue: 0,0:16:08.23,0:16:10.88,Default,,0000,0000,0000,,room collaborating towards learning. Dialogue: 0,0:16:10.88,0:16:14.24,Default,,0000,0000,0000,,D.R.: And, and like Carlos was saying, I,\NI Dialogue: 0,0:16:14.24,0:16:17.45,Default,,0000,0000,0000,,used this in my, in my courses at Valencia. Dialogue: 0,0:16:17.45,0:16:20.93,Default,,0000,0000,0000,,We, we spend, it's an Introduction to Programming\Ncourse Dialogue: 0,0:16:20.93,0:16:23.40,Default,,0000,0000,0000,,where we spend the first half of the course Dialogue: 0,0:16:23.40,0:16:26.97,Default,,0000,0000,0000,,learning the concepts of programming and practicing\Nreading the Dialogue: 0,0:16:26.97,0:16:30.26,Default,,0000,0000,0000,,code, reading open source projects, identifying\Npieces of the Dialogue: 0,0:16:30.26,0:16:31.99,Default,,0000,0000,0000,,code that we've talked about, and the second\Nhalf Dialogue: 0,0:16:31.99,0:16:34.91,Default,,0000,0000,0000,,of the class is all these Coding Dojos, these Dialogue: 0,0:16:34.91,0:16:37.37,Default,,0000,0000,0000,,Randori-style Coding Dojos. Dialogue: 0,0:16:37.37,0:16:39.60,Default,,0000,0000,0000,,Over the, the couple years that we ran the Dialogue: 0,0:16:39.60,0:16:43.24,Default,,0000,0000,0000,,Coding Dojo in Orlando, we got a mixed bag Dialogue: 0,0:16:43.24,0:16:45.62,Default,,0000,0000,0000,,of folks from all over the spectrum. People\Nthat Dialogue: 0,0:16:45.62,0:16:48.27,Default,,0000,0000,0000,,had no coding experience all the way up to Dialogue: 0,0:16:48.27,0:16:50.09,Default,,0000,0000,0000,,people that had been coding for years and\Nyears Dialogue: 0,0:16:50.09,0:16:53.21,Default,,0000,0000,0000,,and years and years. And strangely enough,\Nthe super Dialogue: 0,0:16:53.21,0:16:56.07,Default,,0000,0000,0000,,experts were the ones that were least interested\Nin Dialogue: 0,0:16:56.07,0:16:57.29,Default,,0000,0000,0000,,the format. Dialogue: 0,0:16:57.29,0:16:59.81,Default,,0000,0000,0000,,But we used it as a method of teaching Dialogue: 0,0:16:59.81,0:17:05.42,Default,,0000,0000,0000,,ourselves new tools, new techniques, completely\Ndifferent languages. Our Dialogue: 0,0:17:05.42,0:17:07.61,Default,,0000,0000,0000,,first attempt at a Python Coding Dojo was\Na Dialogue: 0,0:17:07.61,0:17:10.82,Default,,0000,0000,0000,,complete dog's breakfast. But we came back,\Nwe learned, Dialogue: 0,0:17:10.82,0:17:12.90,Default,,0000,0000,0000,,we learned enough Python that now I actually\Nrun Dialogue: 0,0:17:12.90,0:17:16.35,Default,,0000,0000,0000,,the Python user group in Orlando, and teach\Nother Dialogue: 0,0:17:16.35,0:17:19.02,Default,,0000,0000,0000,,people how to use Python and when to use Dialogue: 0,0:17:19.02,0:17:20.74,Default,,0000,0000,0000,,Python and that sort of thing. Dialogue: 0,0:17:20.74,0:17:22.31,Default,,0000,0000,0000,,We, we taught a bunch of people Ruby. We've Dialogue: 0,0:17:22.31,0:17:24.41,Default,,0000,0000,0000,,taught a bunch of people JavaScript, learned\Nthat there Dialogue: 0,0:17:24.41,0:17:26.79,Default,,0000,0000,0000,,are like seventeen different JavaScript frameworks,\Nand a new Dialogue: 0,0:17:26.79,0:17:32.18,Default,,0000,0000,0000,,one every week, to run tests or implement\Nassertions. Dialogue: 0,0:17:32.18,0:17:33.34,Default,,0000,0000,0000,,That's always fun. Dialogue: 0,0:17:33.34,0:17:34.51,Default,,0000,0000,0000,,But the, the key is, we give them, we Dialogue: 0,0:17:34.51,0:17:37.47,Default,,0000,0000,0000,,give everybody a time box and we wait for, Dialogue: 0,0:17:37.47,0:17:40.43,Default,,0000,0000,0000,,either everyone gets a chance to code, we\Nsolve Dialogue: 0,0:17:40.43,0:17:42.28,Default,,0000,0000,0000,,the problem - which very rarely happens - or Dialogue: 0,0:17:42.28,0:17:44.52,Default,,0000,0000,0000,,we have it, the entire thing time-boxed to\Nmaybe Dialogue: 0,0:17:44.52,0:17:46.18,Default,,0000,0000,0000,,a two hour time frame. Dialogue: 0,0:17:46.18,0:17:47.49,Default,,0000,0000,0000,,So that really works well for a lot of Dialogue: 0,0:17:47.49,0:17:49.14,Default,,0000,0000,0000,,people, like a classroom setting where you\Nknow you Dialogue: 0,0:17:49.14,0:17:52.33,Default,,0000,0000,0000,,have x number of hours to participate, and\Nyou Dialogue: 0,0:17:52.33,0:17:54.42,Default,,0000,0000,0000,,have, you know, somewhere between that magic\Nnumber of Dialogue: 0,0:17:54.42,0:17:56.40,Default,,0000,0000,0000,,five to fifteen people so that everyone can\Nget Dialogue: 0,0:17:56.40,0:17:59.50,Default,,0000,0000,0000,,a chance to code inside of that two hours. Dialogue: 0,0:17:59.50,0:18:01.80,Default,,0000,0000,0000,,C.S.: And one thing worth mentioning, too,\Nis that Dialogue: 0,0:18:01.80,0:18:03.90,Default,,0000,0000,0000,,the Randori-style Kata is also a great way\Nto Dialogue: 0,0:18:03.90,0:18:06.94,Default,,0000,0000,0000,,interview potential developer candidates.\NIf you want to move Dialogue: 0,0:18:06.94,0:18:08.77,Default,,0000,0000,0000,,away from the typical, where do you see yourself Dialogue: 0,0:18:08.77,0:18:11.35,Default,,0000,0000,0000,,in five years? And cut that, cut out all Dialogue: 0,0:18:11.35,0:18:13.19,Default,,0000,0000,0000,,that bull shit, and get to what matters, which Dialogue: 0,0:18:13.19,0:18:16.42,Default,,0000,0000,0000,,is coding and seeing, you know, how efficient\Nyour Dialogue: 0,0:18:16.42,0:18:19.67,Default,,0000,0000,0000,,developer is, and how willing to pair program,\Nhow Dialogue: 0,0:18:19.67,0:18:21.95,Default,,0000,0000,0000,,willing to collaborate he is. The Coding Dojo,\NI Dialogue: 0,0:18:21.95,0:18:23.55,Default,,0000,0000,0000,,want to say, is the best way to do Dialogue: 0,0:18:23.55,0:18:26.47,Default,,0000,0000,0000,,that, right. Because you're hiring someone\Nto be a Dialogue: 0,0:18:26.47,0:18:26.80,Default,,0000,0000,0000,,developer. Dialogue: 0,0:18:26.80,0:18:29.13,Default,,0000,0000,0000,,So, sit with them, code with them. Seeing\Nhow Dialogue: 0,0:18:29.13,0:18:32.85,Default,,0000,0000,0000,,well the fit with the culture, with the pair Dialogue: 0,0:18:32.85,0:18:35.68,Default,,0000,0000,0000,,programming culture in your company, or with\Nthe development Dialogue: 0,0:18:35.68,0:18:38.23,Default,,0000,0000,0000,,style that your company adopts. And we use\Nit Dialogue: 0,0:18:38.23,0:18:40.24,Default,,0000,0000,0000,,a lot at Code School and Envy Labs, and Dialogue: 0,0:18:40.24,0:18:43.64,Default,,0000,0000,0000,,it's worked out great, I'd say. Dialogue: 0,0:18:43.64,0:18:46.59,Default,,0000,0000,0000,,The second type of Kata is the Prepared Kata, Dialogue: 0,0:18:46.59,0:18:50.100,Default,,0000,0000,0000,,and that is when you watch perform a, a Dialogue: 0,0:18:50.100,0:18:54.71,Default,,0000,0000,0000,,Kata that has been previously worked on. So,\NDavid Dialogue: 0,0:18:54.71,0:18:56.18,Default,,0000,0000,0000,,and I are gonna show that to you in Dialogue: 0,0:18:56.18,0:18:58.83,Default,,0000,0000,0000,,a little bit. We're going to start coding\Na Dialogue: 0,0:18:58.83,0:19:02.22,Default,,0000,0000,0000,,problem from scratch, and we're going to be\Npair Dialogue: 0,0:19:02.22,0:19:05.09,Default,,0000,0000,0000,,programming on that problem. You can either\Npair program Dialogue: 0,0:19:05.09,0:19:07.40,Default,,0000,0000,0000,,or do it solo, but the thing is, you're Dialogue: 0,0:19:07.40,0:19:11.43,Default,,0000,0000,0000,,showing people one way to solve the problem,\Nand Dialogue: 0,0:19:11.43,0:19:14.88,Default,,0000,0000,0000,,you're showing them, also, a bunch of, of\Ntricks Dialogue: 0,0:19:14.88,0:19:17.18,Default,,0000,0000,0000,,that you may use. Perhaps you're showing them\Nhow Dialogue: 0,0:19:17.18,0:19:20.02,Default,,0000,0000,0000,,to use a different editor that just came out, Dialogue: 0,0:19:20.02,0:19:22.13,Default,,0000,0000,0000,,or perhaps you're showing them one feature\Nof an Dialogue: 0,0:19:22.13,0:19:25.06,Default,,0000,0000,0000,,existing editor that you might already use.\NYou're showing Dialogue: 0,0:19:25.06,0:19:28.53,Default,,0000,0000,0000,,them different API for the language. So there's\Ndifferent, Dialogue: 0,0:19:28.53,0:19:31.03,Default,,0000,0000,0000,,there's a multitude of things that you can\Nlearn Dialogue: 0,0:19:31.03,0:19:34.46,Default,,0000,0000,0000,,by watching someone perform a prepared Kata. Dialogue: 0,0:19:34.46,0:19:36.87,Default,,0000,0000,0000,,And lastly. Dialogue: 0,0:19:36.87,0:19:40.97,Default,,0000,0000,0000,,D.R.: We, we actually had the, the opportunity\Nto Dialogue: 0,0:19:40.97,0:19:43.23,Default,,0000,0000,0000,,have Corey Haines - has anybody heard of Corey Dialogue: 0,0:19:43.23,0:19:45.38,Default,,0000,0000,0000,,Haines? If you guys know anything about the\NDojo, Dialogue: 0,0:19:45.38,0:19:48.93,Default,,0000,0000,0000,,you've probably heard about Corey Haines.\NCorey Haines, yeah, Dialogue: 0,0:19:48.93,0:19:53.13,Default,,0000,0000,0000,,he's local up here. He came down to Orlando Dialogue: 0,0:19:53.13,0:19:55.79,Default,,0000,0000,0000,,and gave what he calls a Code Retreat, and Dialogue: 0,0:19:55.79,0:19:59.91,Default,,0000,0000,0000,,those are fantastic, all-day events where\Nyou get the Dialogue: 0,0:19:59.91,0:20:02.02,Default,,0000,0000,0000,,opportunity to pair up with people that you've\Nnever Dialogue: 0,0:20:02.02,0:20:06.14,Default,,0000,0000,0000,,programmed with before, maybe never seen before.\NYou, everyone Dialogue: 0,0:20:06.14,0:20:08.28,Default,,0000,0000,0000,,agrees to solve the same problem. He usually\Nuses Dialogue: 0,0:20:08.28,0:20:12.16,Default,,0000,0000,0000,,Conway's Game of Life, which is a wonderfully\Nbrain-bending Dialogue: 0,0:20:12.16,0:20:14.21,Default,,0000,0000,0000,,program in whatever language you're trying\Nto learn. Dialogue: 0,0:20:14.21,0:20:17.40,Default,,0000,0000,0000,,You all pair for thirty minutes or an hour Dialogue: 0,0:20:17.40,0:20:20.32,Default,,0000,0000,0000,,or, or whatever the time box is for that Dialogue: 0,0:20:20.32,0:20:22.63,Default,,0000,0000,0000,,event. You pair with different people at the\Nend Dialogue: 0,0:20:22.63,0:20:24.16,Default,,0000,0000,0000,,of the time box. You're free to switch pairs. Dialogue: 0,0:20:24.16,0:20:26.61,Default,,0000,0000,0000,,You're free to switch languages. You're free\Nto try Dialogue: 0,0:20:26.61,0:20:29.07,Default,,0000,0000,0000,,a different approach. Add some constraints.\NWhatever. But you Dialogue: 0,0:20:29.07,0:20:30.67,Default,,0000,0000,0000,,agree to do it all day. You have a Dialogue: 0,0:20:30.67,0:20:32.89,Default,,0000,0000,0000,,lot of practice and a lot of time. Dialogue: 0,0:20:32.89,0:20:35.03,Default,,0000,0000,0000,,That's similar to the format that we're gonna\Nuse Dialogue: 0,0:20:35.03,0:20:38.26,Default,,0000,0000,0000,,today for the second half, or second two-thirds\Nof Dialogue: 0,0:20:38.26,0:20:41.09,Default,,0000,0000,0000,,the seminar. And if you want to know more Dialogue: 0,0:20:41.09,0:20:44.31,Default,,0000,0000,0000,,about Corey Haines Code Retreat, or perhaps\Nbug him Dialogue: 0,0:20:44.31,0:20:46.41,Default,,0000,0000,0000,,incessantly on Twitter for him to bring a\NCode Dialogue: 0,0:20:46.41,0:20:48.73,Default,,0000,0000,0000,,Retreat to your city, you can find him at Dialogue: 0,0:20:48.73,0:20:52.23,Default,,0000,0000,0000,,his horribly ugly website, coderetreat dot\Norg. And on Dialogue: 0,0:20:52.23,0:20:54.10,Default,,0000,0000,0000,,the internets as @CoreyHaines. Dialogue: 0,0:20:54.10,0:20:59.41,Default,,0000,0000,0000,,C.S.: Cool. So. I think we're good to move Dialogue: 0,0:20:59.41,0:21:02.14,Default,,0000,0000,0000,,on to show you guys a Prepared Kata that Dialogue: 0,0:21:02.14,0:21:08.77,Default,,0000,0000,0000,,David and I practiced and. Cool. Let's do\Nit. Dialogue: 0,0:21:08.77,0:21:12.07,Default,,0000,0000,0000,,Like I said, we're gonna do something that\Nwe're Dialogue: 0,0:21:12.07,0:21:15.49,Default,,0000,0000,0000,,already worked on. We've previously worked\Non. And we're Dialogue: 0,0:21:15.49,0:21:17.91,Default,,0000,0000,0000,,gonna show you how to implement a very, very, Dialogue: 0,0:21:17.91,0:21:21.85,Default,,0000,0000,0000,,very simple calculator. And, and this calculator\Nis going Dialogue: 0,0:21:21.85,0:21:26.94,Default,,0000,0000,0000,,to have one operation, which is gonna be addition. Dialogue: 0,0:21:26.94,0:21:29.86,Default,,0000,0000,0000,,This operation should be able to accept two\Nnumbers Dialogue: 0,0:21:29.86,0:21:32.17,Default,,0000,0000,0000,,and return the result. Dialogue: 0,0:21:32.17,0:21:35.32,Default,,0000,0000,0000,,Should be simple enough, right? Cool. We're\Ngonna use Dialogue: 0,0:21:35.32,0:21:38.35,Default,,0000,0000,0000,,Ruby, Ruby 2 point 0, but if you have Dialogue: 0,0:21:38.35,0:21:41.83,Default,,0000,0000,0000,,Ruby 1.9 in your computer, it's fine. And\Nwe're Dialogue: 0,0:21:41.83,0:21:46.54,Default,,0000,0000,0000,,gonna use miniTest, also known as Test Unit,\Nfor Dialogue: 0,0:21:46.54,0:21:48.63,Default,,0000,0000,0000,,this, and that's it. We're not gonna use any Dialogue: 0,0:21:48.63,0:21:52.41,Default,,0000,0000,0000,,framework. Everything is built into the standard\Nlibrary. Dialogue: 0,0:21:52.41,0:21:55.01,Default,,0000,0000,0000,,If you can, you can follow along. Or if Dialogue: 0,0:21:55.01,0:21:56.95,Default,,0000,0000,0000,,you just want to watch it, and then try Dialogue: 0,0:21:56.95,0:21:59.18,Default,,0000,0000,0000,,to do it on your own after we're done, Dialogue: 0,0:21:59.18,0:22:01.19,Default,,0000,0000,0000,,that's fine too. Right. So this is like the Dialogue: 0,0:22:01.19,0:22:03.56,Default,,0000,0000,0000,,first Kata that we're gonna run. Dialogue: 0,0:22:03.56,0:22:07.04,Default,,0000,0000,0000,,D.R.: And because pairing, because the ping\Npong style Dialogue: 0,0:22:07.04,0:22:09.28,Default,,0000,0000,0000,,pairing is a lot of vocal back and forth, Dialogue: 0,0:22:09.28,0:22:10.94,Default,,0000,0000,0000,,we're gonna shove the mic right up here in Dialogue: 0,0:22:10.94,0:22:12.64,Default,,0000,0000,0000,,the front, and we'll attempt to talk into\Nit Dialogue: 0,0:22:12.64,0:22:16.13,Default,,0000,0000,0000,,as much as possible. So bear with us. If Dialogue: 0,0:22:16.13,0:22:18.49,Default,,0000,0000,0000,,you can't hear us, just holler or throw paper Dialogue: 0,0:22:18.49,0:22:19.15,Default,,0000,0000,0000,,or something. Dialogue: 0,0:22:19.15,0:22:22.24,Default,,0000,0000,0000,,C.S.: And also, if you have any questions,\Nif Dialogue: 0,0:22:22.24,0:22:23.96,Default,,0000,0000,0000,,you don't understand anything that we do - we're Dialogue: 0,0:22:23.96,0:22:26.40,Default,,0000,0000,0000,,gonna try to explain everything and describe\Nas we Dialogue: 0,0:22:26.40,0:22:28.70,Default,,0000,0000,0000,,go, but if you have any questions, please,\Nplease, Dialogue: 0,0:22:28.70,0:22:35.70,Default,,0000,0000,0000,,please raise your hand and ask us. Don't hesitate. Dialogue: 0,0:22:37.93,0:22:44.93,Default,,0000,0000,0000,,So, so far we have an empty file. There's Dialogue: 0,0:22:46.50,0:22:49.53,Default,,0000,0000,0000,,nothing on this file. Kata dot rb. And we're Dialogue: 0,0:22:49.53,0:22:53.49,Default,,0000,0000,0000,,going to develop a very simple calculator.\NSo I'm Dialogue: 0,0:22:53.49,0:22:58.03,Default,,0000,0000,0000,,gonna fire up Vim, open the file. Can everyone Dialogue: 0,0:22:58.03,0:23:02.20,Default,,0000,0000,0000,,see? Good? Decent? Cool? All right. So we're\Ngoing Dialogue: 0,0:23:02.20,0:23:08.58,Default,,0000,0000,0000,,to use miniTest, the unit. Because you have\NminiTest Dialogue: 0,0:23:08.58,0:23:10.44,Default,,0000,0000,0000,,unit and you also have miniTest specs. So\Nwe're Dialogue: 0,0:23:10.44,0:23:12.56,Default,,0000,0000,0000,,gonna do the unit type. Dialogue: 0,0:23:12.56,0:23:15.03,Default,,0000,0000,0000,,And, to run our tests, we also have to Dialogue: 0,0:23:15.03,0:23:21.82,Default,,0000,0000,0000,,require 'minitest/auto' to automatically run\Nthis file. We're gonna Dialogue: 0,0:23:21.82,0:23:24.24,Default,,0000,0000,0000,,start with our test case, which is going to Dialogue: 0,0:23:24.24,0:23:31.24,Default,,0000,0000,0000,,be CalculatorTest < Minitest::Unit::TestCase.\NWe got our test suite Dialogue: 0,0:23:35.84,0:23:39.27,Default,,0000,0000,0000,,class, and we're going to write our first\Ntest. Dialogue: 0,0:23:39.27,0:23:43.83,Default,,0000,0000,0000,,So test_adds_two_numbers. Dialogue: 0,0:23:43.83,0:23:46.26,Default,,0000,0000,0000,,So if we change it and you go to Dialogue: 0,0:23:46.26,0:23:53.26,Default,,0000,0000,0000,,that same folder, if we're in Ruby, Kata cannot Dialogue: 0,0:23:54.77,0:23:55.87,Default,,0000,0000,0000,,load minitest/auto. Dialogue: 0,0:23:55.87,0:23:57.26,Default,,0000,0000,0000,,AUDIENCE: Autorun. Dialogue: 0,0:23:57.26,0:24:02.72,Default,,0000,0000,0000,,C.S.: Autorun. Thank you. There you go. Collaborative. Dialogue: 0,0:24:02.72,0:24:05.51,Default,,0000,0000,0000,,D.R.: Thank you audience. Dialogue: 0,0:24:05.51,0:24:08.55,Default,,0000,0000,0000,,C.S.: Right. So now we got something here.\NLet Dialogue: 0,0:24:08.55,0:24:11.59,Default,,0000,0000,0000,,me add clear. And Ruby Kata. Dialogue: 0,0:24:11.59,0:24:14.22,Default,,0000,0000,0000,,D.R.: Tada! Dialogue: 0,0:24:14.22,0:24:18.94,Default,,0000,0000,0000,,C.S.: Cool. So that gives us proof that we Dialogue: 0,0:24:18.94,0:24:21.06,Default,,0000,0000,0000,,were able to import the correct libraries,\Nwe were Dialogue: 0,0:24:21.06,0:24:23.100,Default,,0000,0000,0000,,able to create the correct test suite, and\Nthat Dialogue: 0,0:24:23.100,0:24:26.47,Default,,0000,0000,0000,,Ruby picked it up and it gives us a Dialogue: 0,0:24:26.47,0:24:29.17,Default,,0000,0000,0000,,proper error message, or at least a proper\Nmessage. Dialogue: 0,0:24:29.17,0:24:30.71,Default,,0000,0000,0000,,Cause we don't have any assertions yet. So\Nit's Dialogue: 0,0:24:30.71,0:24:33.94,Default,,0000,0000,0000,,just saying, hey, we found one test. There's\Nzero Dialogue: 0,0:24:33.94,0:24:38.37,Default,,0000,0000,0000,,assertions, zero failures, no errors, and\Nno skips. Right. Dialogue: 0,0:24:38.37,0:24:41.18,Default,,0000,0000,0000,,So moving on to the first failing test, I'm Dialogue: 0,0:24:41.18,0:24:48.04,Default,,0000,0000,0000,,going to create a local variable, and instantiate\Nan Dialogue: 0,0:24:48.04,0:24:50.62,Default,,0000,0000,0000,,object from a class that I want to have, Dialogue: 0,0:24:50.62,0:24:52.30,Default,,0000,0000,0000,,but I don't have yet. So I'm gonna let Dialogue: 0,0:24:52.30,0:24:54.66,Default,,0000,0000,0000,,my tests tell me what I should do next. Dialogue: 0,0:24:54.66,0:24:57.17,Default,,0000,0000,0000,,If I run this again, it's gonna blow up, Dialogue: 0,0:24:57.17,0:24:57.44,Default,,0000,0000,0000,,right. Dialogue: 0,0:24:57.44,0:24:58.86,Default,,0000,0000,0000,,So I got a failing test. So now I'm Dialogue: 0,0:24:58.86,0:25:00.82,Default,,0000,0000,0000,,gonna pass it along to David to solve that Dialogue: 0,0:25:00.82,0:25:01.01,Default,,0000,0000,0000,,test. Dialogue: 0,0:25:01.01,0:25:03.54,Default,,0000,0000,0000,,D.R.: Yeah. Thanks for leaving me a lovely\Nmess Dialogue: 0,0:25:03.54,0:25:04.87,Default,,0000,0000,0000,,there. Dialogue: 0,0:25:04.87,0:25:06.34,Default,,0000,0000,0000,,C.S.: That's real life, man. Dialogue: 0,0:25:06.34,0:25:08.38,Default,,0000,0000,0000,,D.R.: Yeah. This is a. At least you didn't Dialogue: 0,0:25:08.38,0:25:12.69,Default,,0000,0000,0000,,commit it, right? So I'm gonna actually, gonna\Ntype Dialogue: 0,0:25:12.69,0:25:14.88,Default,,0000,0000,0000,,only the code that I need to fulfill this Dialogue: 0,0:25:14.88,0:25:16.36,Default,,0000,0000,0000,,task. And I'm gonna do it right in the Dialogue: 0,0:25:16.36,0:25:18.84,Default,,0000,0000,0000,,same file. Some people would split it out,\Nbut Dialogue: 0,0:25:18.84,0:25:21.100,Default,,0000,0000,0000,,for, for this simple example, we're gonna\Njust do Dialogue: 0,0:25:21.100,0:25:25.27,Default,,0000,0000,0000,,exactly what we need. Dialogue: 0,0:25:25.27,0:25:32.27,Default,,0000,0000,0000,,And so, if I just define a Calculator, then Dialogue: 0,0:25:33.46,0:25:38.18,Default,,0000,0000,0000,,that should, at least, change the error message.\NAnd Dialogue: 0,0:25:38.18,0:25:41.27,Default,,0000,0000,0000,,it does. Now I have one test. No assertions. Dialogue: 0,0:25:41.27,0:25:43.03,Default,,0000,0000,0000,,But I don't have a big giant barf. Dialogue: 0,0:25:43.03,0:25:45.20,Default,,0000,0000,0000,,So I'm gonna write a test. This is using Dialogue: 0,0:25:45.20,0:25:51.29,Default,,0000,0000,0000,,the ping pong method. Equals or equal? Dialogue: 0,0:25:51.29,0:25:53.53,Default,,0000,0000,0000,,C.S.: Equal. Dialogue: 0,0:25:53.53,0:25:59.19,Default,,0000,0000,0000,,D.R.: Equal. Of course. I'm gonna add two\Nnumbers Dialogue: 0,0:25:59.19,0:26:06.19,Default,,0000,0000,0000,,together, say, one and one. All right? Rerun\Nthe Dialogue: 0,0:26:08.57,0:26:11.36,Default,,0000,0000,0000,,tests. And now I get barf. And so I Dialogue: 0,0:26:11.36,0:26:14.98,Default,,0000,0000,0000,,hand it back off to my pair. Ping. Dialogue: 0,0:26:14.98,0:26:17.77,Default,,0000,0000,0000,,C.S.: So the error is saying there's an undefined Dialogue: 0,0:26:17.77,0:26:21.79,Default,,0000,0000,0000,,method add. So that's simple enough. I'm going\Nto Dialogue: 0,0:26:21.79,0:26:25.03,Default,,0000,0000,0000,,come here and define a method add. If I Dialogue: 0,0:26:25.03,0:26:28.05,Default,,0000,0000,0000,,run it again, now it's complaining about another\Nthing, Dialogue: 0,0:26:28.05,0:26:30.48,Default,,0000,0000,0000,,which is sort of good. If you're doing TDD, Dialogue: 0,0:26:30.48,0:26:32.99,Default,,0000,0000,0000,,you want either to make the test pass or Dialogue: 0,0:26:32.99,0:26:34.97,Default,,0000,0000,0000,,to make the message change. Dialogue: 0,0:26:34.97,0:26:37.31,Default,,0000,0000,0000,,So, this is to ensure that whatever code you're Dialogue: 0,0:26:37.31,0:26:42.03,Default,,0000,0000,0000,,writing in your production part is effecting\Nyour tests, Dialogue: 0,0:26:42.03,0:26:45.19,Default,,0000,0000,0000,,right. Because, I cannot count how many times\Nit Dialogue: 0,0:26:45.19,0:26:47.62,Default,,0000,0000,0000,,happened to me in real life, I'm editing a Dialogue: 0,0:26:47.62,0:26:50.31,Default,,0000,0000,0000,,file, but it just happens to be a file Dialogue: 0,0:26:50.31,0:26:52.50,Default,,0000,0000,0000,,with the same name on a completely different\Nproject. Dialogue: 0,0:26:52.50,0:26:53.21,Default,,0000,0000,0000,,D.R.: Right. Dialogue: 0,0:26:53.21,0:26:55.61,Default,,0000,0000,0000,,C.S.: So I'm editing like a calculated dot\Nrb Dialogue: 0,0:26:55.61,0:26:57.68,Default,,0000,0000,0000,,on a different project, and I'm refreshing\Nthe browser, Dialogue: 0,0:26:57.68,0:26:59.99,Default,,0000,0000,0000,,wondering, what the hell is this not taking\Neffect? Dialogue: 0,0:26:59.99,0:27:02.09,Default,,0000,0000,0000,,Right. So when you're doing test-driven development,\Nyou want Dialogue: 0,0:27:02.09,0:27:03.90,Default,,0000,0000,0000,,to make sure that whatever code you write\Nin Dialogue: 0,0:27:03.90,0:27:05.100,Default,,0000,0000,0000,,production, you run the test, so, to make\Nsure Dialogue: 0,0:27:05.100,0:27:08.29,Default,,0000,0000,0000,,that your code is taking effect. Right. Dialogue: 0,0:27:08.29,0:27:10.36,Default,,0000,0000,0000,,D.R.: Right. And the, the key there is, run Dialogue: 0,0:27:10.36,0:27:13.23,Default,,0000,0000,0000,,your tests and observe the expected failure,\Nor at Dialogue: 0,0:27:13.23,0:27:15.69,Default,,0000,0000,0000,,least observe that something, the failure\Nhas changed. Dialogue: 0,0:27:15.69,0:27:16.06,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:27:16.06,0:27:17.44,Default,,0000,0000,0000,,D.R.: That you're, you're having an effect. Dialogue: 0,0:27:17.44,0:27:20.30,Default,,0000,0000,0000,,C.S.: So I'm going to save this. Add in Dialogue: 0,0:27:20.30,0:27:23.06,Default,,0000,0000,0000,,two arguments. Run the test again. Now it's\Nsaying, Dialogue: 0,0:27:23.06,0:27:25.23,Default,,0000,0000,0000,,now it's giving us a different message. It's\Nsaying Dialogue: 0,0:27:25.23,0:27:28.60,Default,,0000,0000,0000,,it expected Nil, but, but it got two. So, Dialogue: 0,0:27:28.60,0:27:30.63,Default,,0000,0000,0000,,I'm reading this, and I'm thinking. Well that's,\Nthat's, Dialogue: 0,0:27:30.63,0:27:33.43,Default,,0000,0000,0000,,that's kind of weird. I'm not expecting Nil.\NI Dialogue: 0,0:27:33.43,0:27:35.43,Default,,0000,0000,0000,,should be expecting two. Dialogue: 0,0:27:35.43,0:27:37.58,Default,,0000,0000,0000,,So that leads me to the conclusion that maybe Dialogue: 0,0:27:37.58,0:27:42.52,Default,,0000,0000,0000,,we passed the wrong order to our assert method. Dialogue: 0,0:27:42.52,0:27:47.24,Default,,0000,0000,0000,,So to go back, here, assert_equal is very\Nstrict Dialogue: 0,0:27:47.24,0:27:50.41,Default,,0000,0000,0000,,about the order of arguments. So we can produce Dialogue: 0,0:27:50.41,0:27:53.02,Default,,0000,0000,0000,,the best error message for you. So what we Dialogue: 0,0:27:53.02,0:27:57.96,Default,,0000,0000,0000,,should do here, instead, is put two calculator.add\None Dialogue: 0,0:27:57.96,0:28:00.46,Default,,0000,0000,0000,,and one. And when we do that and then Dialogue: 0,0:28:00.46,0:28:01.97,Default,,0000,0000,0000,,we run our tests again, we can see that Dialogue: 0,0:28:01.97,0:28:04.75,Default,,0000,0000,0000,,now the error message is, it makes more sense, Dialogue: 0,0:28:04.75,0:28:07.99,Default,,0000,0000,0000,,right. It expected two but it actually got\NNil. Dialogue: 0,0:28:07.99,0:28:10.57,Default,,0000,0000,0000,,Now, it's time to write the simplest thing\Nthat Dialogue: 0,0:28:10.57,0:28:13.86,Default,,0000,0000,0000,,could possibly make this work. And will probably\Nmake Dialogue: 0,0:28:13.86,0:28:20.54,Default,,0000,0000,0000,,your skin crawl. Is to return two. Cool. So Dialogue: 0,0:28:20.54,0:28:23.27,Default,,0000,0000,0000,,now we have one test and one assertion. Now Dialogue: 0,0:28:23.27,0:28:25.72,Default,,0000,0000,0000,,it's time for me to write a test, a Dialogue: 0,0:28:25.72,0:28:28.61,Default,,0000,0000,0000,,failing test, or David to fulfill. Dialogue: 0,0:28:28.61,0:28:35.61,Default,,0000,0000,0000,,Equal. Seven. Five and two. So I'm gonna do Dialogue: 0,0:28:37.67,0:28:39.35,Default,,0000,0000,0000,,AUDIENCE: Could that also lead you to splitting\Nthe Dialogue: 0,0:28:39.35,0:28:46.04,Default,,0000,0000,0000,,two tests out of this matter? Dialogue: 0,0:28:46.04,0:28:52.19,Default,,0000,0000,0000,,C.S.: Say that again. Dialogue: 0,0:28:52.19,0:28:52.94,Default,,0000,0000,0000,,AUDIENCE: Will you, should you be splitting\Nthe two Dialogue: 0,0:28:52.94,0:28:53.60,Default,,0000,0000,0000,,tests into two assertions. Two assertions,\Ntwo tests. Dialogue: 0,0:28:53.60,0:28:54.52,Default,,0000,0000,0000,,C.S.: That is a good point. I do that Dialogue: 0,0:28:54.52,0:28:58.21,Default,,0000,0000,0000,,when I'm talking about different features,\Nright. So there's, Dialogue: 0,0:28:58.21,0:28:59.53,Default,,0000,0000,0000,,it's really up to you how fine-grained you\Nwant Dialogue: 0,0:28:59.53,0:29:00.22,Default,,0000,0000,0000,,to get. Because we're testing, if you look\Nat Dialogue: 0,0:29:00.22,0:29:00.91,Default,,0000,0000,0000,,the name of the test method, the test_that_adds_two_numbers.\NSo Dialogue: 0,0:29:00.91,0:29:07.91,Default,,0000,0000,0000,,those two assertions, they still belong to\Nthat idea, Dialogue: 0,0:29:08.61,0:29:11.79,Default,,0000,0000,0000,,to that context of adding two numbers. Dialogue: 0,0:29:11.79,0:29:14.78,Default,,0000,0000,0000,,D.R.: Right. And we, we talk about the granularity Dialogue: 0,0:29:14.78,0:29:17.82,Default,,0000,0000,0000,,of testing, just simple assertion testing\Nwhich is what Dialogue: 0,0:29:17.82,0:29:19.82,Default,,0000,0000,0000,,we're doing with assert_equal or any of the\Nassert Dialogue: 0,0:29:19.82,0:29:22.69,Default,,0000,0000,0000,,methods. That's like the smallest little piece\Nof a Dialogue: 0,0:29:22.69,0:29:24.98,Default,,0000,0000,0000,,test. That's the tiniest little piece of a\Ntest. Dialogue: 0,0:29:24.98,0:29:28.54,Default,,0000,0000,0000,,We then compose those assertions together\Ninto the unit, Dialogue: 0,0:29:28.54,0:29:30.40,Default,,0000,0000,0000,,and the unit, in this case, like Kaikay had Dialogue: 0,0:29:30.40,0:29:32.57,Default,,0000,0000,0000,,described, is just that we can add two numbers. Dialogue: 0,0:29:32.57,0:29:35.46,Default,,0000,0000,0000,,There might be multiple assertions that describe\Nhow we Dialogue: 0,0:29:35.46,0:29:37.43,Default,,0000,0000,0000,,can add two numbers, and as we go through Dialogue: 0,0:29:37.43,0:29:39.24,Default,,0000,0000,0000,,the example we'll see that, and we'll start\Nto Dialogue: 0,0:29:39.24,0:29:42.29,Default,,0000,0000,0000,,break out, what happens if we give it three Dialogue: 0,0:29:42.29,0:29:42.72,Default,,0000,0000,0000,,numbers? Dialogue: 0,0:29:42.72,0:29:46.01,Default,,0000,0000,0000,,C.S.: And that's when we break into another\Ntest. Dialogue: 0,0:29:46.01,0:29:49.96,Default,,0000,0000,0000,,D.R.: Right. Does that answer your question?\NMore or Dialogue: 0,0:29:49.96,0:29:50.97,Default,,0000,0000,0000,,less? All right. Great. Dialogue: 0,0:29:50.97,0:29:53.75,Default,,0000,0000,0000,,So, I've got this busted up test sitting in Dialogue: 0,0:29:53.75,0:29:57.78,Default,,0000,0000,0000,,front of me. So the simplest thing that I Dialogue: 0,0:29:57.78,0:30:01.15,Default,,0000,0000,0000,,could possibly do is, I'm gonna go ahead and Dialogue: 0,0:30:01.15,0:30:07.07,Default,,0000,0000,0000,,do some math. Actually do some work here.\NBuddy. Dialogue: 0,0:30:07.07,0:30:09.80,Default,,0000,0000,0000,,And now I've got passing tests. But I sort Dialogue: 0,0:30:09.80,0:30:12.68,Default,,0000,0000,0000,,of see, already, that Calculator is gonna\Nbe a Dialogue: 0,0:30:12.68,0:30:15.73,Default,,0000,0000,0000,,whole lot to type. So I'm gonna take a Dialogue: 0,0:30:15.73,0:30:19.96,Default,,0000,0000,0000,,minute and just refactor. Rather than typing\Ncalculator all Dialogue: 0,0:30:19.96,0:30:22.93,Default,,0000,0000,0000,,the dang time, why don't we change this to Dialogue: 0,0:30:22.93,0:30:25.87,Default,,0000,0000,0000,,just, like, calc? That's still descriptive\Nof what the Dialogue: 0,0:30:25.87,0:30:32.87,Default,,0000,0000,0000,,object is, but it's a lot less repetitive. Dialogue: 0,0:30:34.06,0:30:37.24,Default,,0000,0000,0000,,So I make my couple of changes to refactor, Dialogue: 0,0:30:37.24,0:30:41.60,Default,,0000,0000,0000,,and then I rerun the tests. And boy, it'd Dialogue: 0,0:30:41.60,0:30:43.85,Default,,0000,0000,0000,,be nice if these, if these tests were a Dialogue: 0,0:30:43.85,0:30:45.17,Default,,0000,0000,0000,,little prettier. But I'll leave that to another,\Nto Dialogue: 0,0:30:45.17,0:30:46.04,Default,,0000,0000,0000,,another person. Dialogue: 0,0:30:46.04,0:30:50.51,Default,,0000,0000,0000,,Now, what do you think? We've got, we've got Dialogue: 0,0:30:50.51,0:30:52.12,Default,,0000,0000,0000,,the ability to add two numbers. Should we\Nadd Dialogue: 0,0:30:52.12,0:30:54.62,Default,,0000,0000,0000,,some more two numbers? Or do you, maybe we Dialogue: 0,0:30:54.62,0:30:57.74,Default,,0000,0000,0000,,can move on? Maybe we'll move on and get Dialogue: 0,0:30:57.74,0:30:58.35,Default,,0000,0000,0000,,a little more complicated. Dialogue: 0,0:30:58.35,0:30:59.45,Default,,0000,0000,0000,,C.S.: Yeah. Let's do that. Dialogue: 0,0:30:59.45,0:31:05.03,Default,,0000,0000,0000,,D.R.: So yeah. Why don't we write another\Ntest? Dialogue: 0,0:31:05.03,0:31:07.32,Default,,0000,0000,0000,,And this time, I'll, I'll throw you a curve Dialogue: 0,0:31:07.32,0:31:13.81,Default,,0000,0000,0000,,ball. You can add three numbers. Now we're\Ngetting Dialogue: 0,0:31:13.81,0:31:20.81,Default,,0000,0000,0000,,fancy. So, if I, if I expect nine, three Dialogue: 0,0:31:21.49,0:31:26.75,Default,,0000,0000,0000,,and three and three, should add up to nine. Dialogue: 0,0:31:26.75,0:31:28.81,Default,,0000,0000,0000,,But should be clearly, clear, that I'm gonna\Nneed Dialogue: 0,0:31:28.81,0:31:32.03,Default,,0000,0000,0000,,to do some copy pasta here. Which is a Dialogue: 0,0:31:32.03,0:31:34.48,Default,,0000,0000,0000,,great opportunity to refactor, of course. Dialogue: 0,0:31:34.48,0:31:39.66,Default,,0000,0000,0000,,But I feel like making Kaikay work. Look at Dialogue: 0,0:31:39.66,0:31:44.66,Default,,0000,0000,0000,,that. Ping pong, sir. Dialogue: 0,0:31:44.66,0:31:50.53,Default,,0000,0000,0000,,C.S.: Cool. So. Says the number, wrong number\Nof Dialogue: 0,0:31:50.53,0:31:52.60,Default,,0000,0000,0000,,arguments. It took three but it was only expecting Dialogue: 0,0:31:52.60,0:31:55.28,Default,,0000,0000,0000,,two. So, I'm gonna write the simplest thing\Nthat Dialogue: 0,0:31:55.28,0:31:59.97,Default,,0000,0000,0000,,could possibly work, or change this message,\Nright. So Dialogue: 0,0:31:59.97,0:32:02.80,Default,,0000,0000,0000,,what I'm gonna do is add another argument.\NBut Dialogue: 0,0:32:02.80,0:32:05.82,Default,,0000,0000,0000,,if I simply add another argument, then I made Dialogue: 0,0:32:05.82,0:32:07.71,Default,,0000,0000,0000,,that test pass but I make the other ones Dialogue: 0,0:32:07.71,0:32:07.95,Default,,0000,0000,0000,,fail. Dialogue: 0,0:32:07.95,0:32:09.88,Default,,0000,0000,0000,,Cause, if I look at the error message. Dialogue: 0,0:32:09.88,0:32:11.52,Default,,0000,0000,0000,,D.R.: If you could look at the error message. Dialogue: 0,0:32:11.52,0:32:14.59,Default,,0000,0000,0000,,C.S.: If I could look at the error message. Dialogue: 0,0:32:14.59,0:32:16.33,Default,,0000,0000,0000,,D.R.: The little green. Dialogue: 0,0:32:16.33,0:32:17.64,Default,,0000,0000,0000,,C.S.: What's that? Dialogue: 0,0:32:17.64,0:32:20.42,Default,,0000,0000,0000,,D.R.: It's too tall. The window's too tall. Dialogue: 0,0:32:20.42,0:32:22.53,Default,,0000,0000,0000,,C.S.: Is it? Right. All right. So, if you Dialogue: 0,0:32:22.53,0:32:24.98,Default,,0000,0000,0000,,can see here, now I broke the other ones. Dialogue: 0,0:32:24.98,0:32:27.61,Default,,0000,0000,0000,,So what I'm going to do is actually make. Dialogue: 0,0:32:27.61,0:32:30.77,Default,,0000,0000,0000,,Let me fix my window. Is actually make this Dialogue: 0,0:32:30.77,0:32:35.45,Default,,0000,0000,0000,,third one optional. If I run it again, now Dialogue: 0,0:32:35.45,0:32:37.42,Default,,0000,0000,0000,,I don't have a syntax error anymore. Now I Dialogue: 0,0:32:37.42,0:32:39.96,Default,,0000,0000,0000,,have an assertion error. Which, again, is\Ngood, right. Dialogue: 0,0:32:39.96,0:32:41.23,Default,,0000,0000,0000,,D.R.: Man it would be nice if we could Dialogue: 0,0:32:41.23,0:32:46.01,Default,,0000,0000,0000,,see the differences there. That, that white\Ntext on Dialogue: 0,0:32:46.01,0:32:47.71,Default,,0000,0000,0000,,a white back- on a, on a black background Dialogue: 0,0:32:47.71,0:32:48.26,Default,,0000,0000,0000,,is particularly- Dialogue: 0,0:32:48.26,0:32:49.38,Default,,0000,0000,0000,,C.S.: You're right. I wonder if we can make Dialogue: 0,0:32:49.38,0:32:50.06,Default,,0000,0000,0000,,this colored, right. Dialogue: 0,0:32:50.06,0:32:52.38,Default,,0000,0000,0000,,D.R.: I wondered. If we could make this prettier. Dialogue: 0,0:32:52.38,0:32:56.69,Default,,0000,0000,0000,,C.S.: So let's go ahead and add require 'minitest/bright' Dialogue: 0,0:32:56.69,0:32:59.73,Default,,0000,0000,0000,,and make our tests fabulous. So now you can Dialogue: 0,0:32:59.73,0:33:01.81,Default,,0000,0000,0000,,see, down at the bottom here, that we have Dialogue: 0,0:33:01.81,0:33:03.76,Default,,0000,0000,0000,,a little column. Might not be able to see Dialogue: 0,0:33:03.76,0:33:05.99,Default,,0000,0000,0000,,it clearly on the projector, but it does make Dialogue: 0,0:33:05.99,0:33:07.50,Default,,0000,0000,0000,,a lot of difference when you're look at your Dialogue: 0,0:33:07.50,0:33:08.26,Default,,0000,0000,0000,,terminal, right. Dialogue: 0,0:33:08.26,0:33:09.60,Default,,0000,0000,0000,,D.R.: You get a nice big red F. Dialogue: 0,0:33:09.60,0:33:13.02,Default,,0000,0000,0000,,C.S.: So, the big F is saying that expected Dialogue: 0,0:33:13.02,0:33:15.28,Default,,0000,0000,0000,,nine, but it got six. So I'm gonna go Dialogue: 0,0:33:15.28,0:33:21.58,Default,,0000,0000,0000,,ahead and add C to make it pass. Cool. Dialogue: 0,0:33:21.58,0:33:24.34,Default,,0000,0000,0000,,And because I don't like reading a lot, I'm Dialogue: 0,0:33:24.34,0:33:27.75,Default,,0000,0000,0000,,just gonna remove return, because Ruby automatically\Nreturns the Dialogue: 0,0:33:27.75,0:33:30.63,Default,,0000,0000,0000,,last expression of the method. So I'm gonna\Nrun Dialogue: 0,0:33:30.63,0:33:35.80,Default,,0000,0000,0000,,this again, and now all my tests pass, right. Dialogue: 0,0:33:35.80,0:33:37.43,Default,,0000,0000,0000,,Cool. Dialogue: 0,0:33:37.43,0:33:39.58,Default,,0000,0000,0000,,Let's see what we can do now. Should we Dialogue: 0,0:33:39.58,0:33:43.03,Default,,0000,0000,0000,,add more numbers? So we can refactor this\Nwhole Dialogue: 0,0:33:43.03,0:33:43.08,Default,,0000,0000,0000,,thing? Dialogue: 0,0:33:43.08,0:33:43.18,Default,,0000,0000,0000,,D.R.: Yeah. Dialogue: 0,0:33:43.18,0:33:43.50,Default,,0000,0000,0000,,C.S.: What do you think? Dialogue: 0,0:33:43.50,0:33:44.29,Default,,0000,0000,0000,,D.R.: Let's do, let's do one more, one more Dialogue: 0,0:33:44.29,0:33:45.06,Default,,0000,0000,0000,,test. Dialogue: 0,0:33:45.06,0:33:48.07,Default,,0000,0000,0000,,C.S.: So, I don't want you to cheat, cause Dialogue: 0,0:33:48.07,0:33:50.72,Default,,0000,0000,0000,,I don't want you to keep adding single arguments. Dialogue: 0,0:33:50.72,0:33:57.28,Default,,0000,0000,0000,,I'm just gonna add five numbers, right. So\NI'm Dialogue: 0,0:33:57.28,0:34:00.29,Default,,0000,0000,0000,,gonna copy and paste this, and copying and\Npasting Dialogue: 0,0:34:00.29,0:34:04.03,Default,,0000,0000,0000,,never resulted in any error, ever. And, it's\Ngonna- Dialogue: 0,0:34:04.03,0:34:07.69,Default,,0000,0000,0000,,D.R.: It certainly results in highly maintainable\Ncode. Dialogue: 0,0:34:07.69,0:34:13.33,Default,,0000,0000,0000,,C.S.: Twenty-five. Five, five, five, five,\Nfive. Dialogue: 0,0:34:13.33,0:34:16.34,Default,,0000,0000,0000,,D.R.: You can tell we're mathematicians as\Nwell, right. Dialogue: 0,0:34:16.34,0:34:18.69,Default,,0000,0000,0000,,Neither one of us aspire to computer science. Dialogue: 0,0:34:18.69,0:34:22.27,Default,,0000,0000,0000,,C.S.: Cool. So now you got one more. Dialogue: 0,0:34:22.27,0:34:26.93,Default,,0000,0000,0000,,D.R.: Dun, dun, duh! So. Back again we go. Dialogue: 0,0:34:26.93,0:34:28.54,Default,,0000,0000,0000,,The simplest thing that I could possibly do\Nis Dialogue: 0,0:34:28.54,0:34:31.52,Default,,0000,0000,0000,,add five, and a bunch of, and a bunch Dialogue: 0,0:34:31.52,0:34:34.96,Default,,0000,0000,0000,,of junk inside my add method. But that seems, Dialogue: 0,0:34:34.96,0:34:41.96,Default,,0000,0000,0000,,well, stupid. So, let's, instead, just replace. Dialogue: 0,0:34:42.86,0:34:47.87,Default,,0000,0000,0000,,C.S.: Hello? Is that a duck? Duck face? Dialogue: 0,0:34:47.87,0:34:51.08,Default,,0000,0000,0000,,D.R.: There we go. Dialogue: 0,0:34:51.08,0:34:52.68,Default,,0000,0000,0000,,C.S.: nice. Dialogue: 0,0:34:52.68,0:34:59.06,Default,,0000,0000,0000,,D.R.: Let's instead replace this with a splat.\NThat's Dialogue: 0,0:34:59.06,0:35:03.27,Default,,0000,0000,0000,,my favorite. And that should get rid of my Dialogue: 0,0:35:03.27,0:35:06.52,Default,,0000,0000,0000,,wrong arguments error. Oh god. But I got a Dialogue: 0,0:35:06.52,0:35:10.63,Default,,0000,0000,0000,,whole bunch. And you know what, this, this\Nrunning Dialogue: 0,0:35:10.63,0:35:12.48,Default,,0000,0000,0000,,this test thing's getting kind of tedious.\NI don't Dialogue: 0,0:35:12.48,0:35:15.40,Default,,0000,0000,0000,,like flipping back and forth between the windows.\NIs Dialogue: 0,0:35:15.40,0:35:16.47,Default,,0000,0000,0000,,there a way we could automate that? Dialogue: 0,0:35:16.47,0:35:17.06,Default,,0000,0000,0000,,C.S.: I wonder. Dialogue: 0,0:35:17.06,0:35:19.41,Default,,0000,0000,0000,,D.R.: I wonder. Well, I'm more of a, a Dialogue: 0,0:35:19.41,0:35:22.24,Default,,0000,0000,0000,,bash-y person than most, so, in. Dialogue: 0,0:35:22.24,0:35:25.52,Default,,0000,0000,0000,,C.S.: So we could add auto-watch if we really Dialogue: 0,0:35:25.52,0:35:27.70,Default,,0000,0000,0000,,wanted to add a dependency and all that stuff, Dialogue: 0,0:35:27.70,0:35:27.80,Default,,0000,0000,0000,,right. Dialogue: 0,0:35:27.80,0:35:29.31,Default,,0000,0000,0000,,D.R.: Oh, right. And download a gem or, you Dialogue: 0,0:35:29.31,0:35:31.86,Default,,0000,0000,0000,,know, we know our way around Grunt. I'm more Dialogue: 0,0:35:31.86,0:35:33.95,Default,,0000,0000,0000,,of a JavaScript guy than a Ruby guy, so Dialogue: 0,0:35:33.95,0:35:34.51,Default,,0000,0000,0000,,I know way more- Dialogue: 0,0:35:34.51,0:35:35.77,Default,,0000,0000,0000,,D.C.: Dude, haven't you heard? Gulp is the\Nnew Dialogue: 0,0:35:35.77,0:35:35.91,Default,,0000,0000,0000,,Grunt. Dialogue: 0,0:35:35.91,0:35:37.42,Default,,0000,0000,0000,,D.R.: Oh, right. And so, and then followed\Nby Dialogue: 0,0:35:37.42,0:35:42.11,Default,,0000,0000,0000,,Guzzle and, and Yak, I think is coming eventually, Dialogue: 0,0:35:42.11,0:35:44.82,Default,,0000,0000,0000,,right. We could do all that and wait through Dialogue: 0,0:35:44.82,0:35:46.99,Default,,0000,0000,0000,,like fifteen minutes of downloading stuff.\NBut I, I Dialogue: 0,0:35:46.99,0:35:48.75,Default,,0000,0000,0000,,know bash really well, so I'm just gonna write Dialogue: 0,0:35:48.75,0:35:55.75,Default,,0000,0000,0000,,myself a wonderful infinite loop. But I'll\Nadd a Dialogue: 0,0:35:57.93,0:36:01.81,Default,,0000,0000,0000,,sleep. So that I don't blow my stack out. Dialogue: 0,0:36:01.81,0:36:03.42,Default,,0000,0000,0000,,And now every two seconds or so, it's going Dialogue: 0,0:36:03.42,0:36:05.93,Default,,0000,0000,0000,,to run, rerun the tests, rerun the tests,\Nrerun Dialogue: 0,0:36:05.93,0:36:07.08,Default,,0000,0000,0000,,the tests. And I never have to touch that Dialogue: 0,0:36:07.08,0:36:08.30,Default,,0000,0000,0000,,window again. Thank you very much. Dialogue: 0,0:36:08.30,0:36:09.02,Default,,0000,0000,0000,,AUDIENCE: [indecipherable] Dialogue: 0,0:36:09.02,0:36:10.09,Default,,0000,0000,0000,,C.S.: What's that? Dialogue: 0,0:36:10.09,0:36:10.81,Default,,0000,0000,0000,,AUDIENCE: [indecipherable] Dialogue: 0,0:36:10.81,0:36:11.88,Default,,0000,0000,0000,,D.R.: Oh, sure. Dialogue: 0,0:36:11.88,0:36:15.11,Default,,0000,0000,0000,,C.S.: Oh, the code for the, yeah. The bash. Dialogue: 0,0:36:15.11,0:36:16.51,Default,,0000,0000,0000,,D.R.: So it's just a simple- Dialogue: 0,0:36:16.51,0:36:18.83,Default,,0000,0000,0000,,AUDIENCE: [chatter] Dialogue: 0,0:36:18.83,0:36:25.83,Default,,0000,0000,0000,,D.R.: Oh, lame. Lame. Pretty simple. Here,\Nlet's. Let's Dialogue: 0,0:36:29.27,0:36:35.31,Default,,0000,0000,0000,,do this. So, pretty simple bash infinite loop.\NWhile Dialogue: 0,0:36:35.31,0:36:38.70,Default,,0000,0000,0000,,true, run the tests. Sleep for two. If we Dialogue: 0,0:36:38.70,0:36:41.97,Default,,0000,0000,0000,,really wanted to make it even, even closer\Nto Dialogue: 0,0:36:41.97,0:36:45.50,Default,,0000,0000,0000,,what Kaikay typed last, we'll do a clear.\NAnd Dialogue: 0,0:36:45.50,0:36:49.32,Default,,0000,0000,0000,,while I run that, every two seconds it's going Dialogue: 0,0:36:49.32,0:36:51.66,Default,,0000,0000,0000,,to refresh the screen and rerun the tests\Nfor Dialogue: 0,0:36:51.66,0:36:55.84,Default,,0000,0000,0000,,me. That is the poor-man's file-watcher. That's\Njust in Dialogue: 0,0:36:55.84,0:36:58.51,Default,,0000,0000,0000,,case you're running free BSD or a clone thereof Dialogue: 0,0:36:58.51,0:37:03.07,Default,,0000,0000,0000,,and do not have watch installed by default. Dialogue: 0,0:37:03.07,0:37:04.67,Default,,0000,0000,0000,,So now the simplest thing that I could possibly Dialogue: 0,0:37:04.67,0:37:07.94,Default,,0000,0000,0000,,do here is numbers. Now, if this was JavaScript Dialogue: 0,0:37:07.94,0:37:11.22,Default,,0000,0000,0000,,I would probably use reduce on this array,\Nbut Dialogue: 0,0:37:11.22,0:37:13.28,Default,,0000,0000,0000,,this isn't JavaScript. So what is it in, in Dialogue: 0,0:37:13.28,0:37:14.01,Default,,0000,0000,0000,,Ruby? Dialogue: 0,0:37:14.01,0:37:15.47,Default,,0000,0000,0000,,AUDIENCE: Inject. Dialogue: 0,0:37:15.47,0:37:22.07,Default,,0000,0000,0000,,D.R.: Inject? Reduce? Oh, look. You steered\Nme wrong. Dialogue: 0,0:37:22.07,0:37:24.34,Default,,0000,0000,0000,,And so, reduce is gonna take, does it take Dialogue: 0,0:37:24.34,0:37:26.03,Default,,0000,0000,0000,,the same arguments? Dialogue: 0,0:37:26.03,0:37:29.39,Default,,0000,0000,0000,,AUDIENCE: The first argument's the seed. Dialogue: 0,0:37:29.39,0:37:32.05,Default,,0000,0000,0000,,D.R.: Right. So I take the seed. And then Dialogue: 0,0:37:32.05,0:37:34.97,Default,,0000,0000,0000,,I give it a block. And so then I Dialogue: 0,0:37:34.97,0:37:40.49,Default,,0000,0000,0000,,have my, my value and my number. Dialogue: 0,0:37:40.49,0:37:46.69,Default,,0000,0000,0000,,C.S.: You might have to use params. I don't Dialogue: 0,0:37:46.69,0:37:47.00,Default,,0000,0000,0000,,know. Dialogue: 0,0:37:47.00,0:37:48.44,Default,,0000,0000,0000,,D.R.: I don't know. Let's, let's find out. Dialogue: 0,0:37:48.44,0:37:49.07,Default,,0000,0000,0000,,C.S.: Yeah. Let's find out. Dialogue: 0,0:37:49.07,0:37:50.33,Default,,0000,0000,0000,,D.R.: Find out what happens, right. So we\Ngive Dialogue: 0,0:37:50.33,0:37:52.98,Default,,0000,0000,0000,,it a block, and then we'll just return v Dialogue: 0,0:37:52.98,0:37:57.17,Default,,0000,0000,0000,,plus n, from the block. Write the file and Dialogue: 0,0:37:57.17,0:37:57.17,Default,,0000,0000,0000,,D.R.: Yeah. Dialogue: 0,0:38:05.91,0:38:12.38,Default,,0000,0000,0000,,passing a block. Dialogue: 0,0:38:12.38,0:38:16.70,Default,,0000,0000,0000,,D.R.: Oops. Dialogue: 0,0:38:16.70,0:38:19.83,Default,,0000,0000,0000,,And the best part is, I never have to Dialogue: 0,0:38:19.83,0:38:22.48,Default,,0000,0000,0000,,touch this dang test file again. He just keeps Dialogue: 0,0:38:22.48,0:38:25.41,Default,,0000,0000,0000,,running my tests. So now I've got a, I've Dialogue: 0,0:38:25.41,0:38:27.66,Default,,0000,0000,0000,,got a reduce function that works for an infinite Dialogue: 0,0:38:27.66,0:38:29.99,Default,,0000,0000,0000,,number of numbers. And I'm back to green tests. Dialogue: 0,0:38:29.99,0:38:31.59,Default,,0000,0000,0000,,And I, I've already noticed, you know, let's\Njust, Dialogue: 0,0:38:31.59,0:38:34.24,Default,,0000,0000,0000,,let's go ahead and make this guy a little Dialogue: 0,0:38:34.24,0:38:34.76,Default,,0000,0000,0000,,bigger. Dialogue: 0,0:38:34.76,0:38:38.13,Default,,0000,0000,0000,,I've already noticed that, I've got all this\Nrepetition Dialogue: 0,0:38:38.13,0:38:40.42,Default,,0000,0000,0000,,in here, right. I've got calc equals, calc\Nequals, Dialogue: 0,0:38:40.42,0:38:42.91,Default,,0000,0000,0000,,calc equals. Oh god. So, let's reduce some\Nof Dialogue: 0,0:38:42.91,0:38:44.20,Default,,0000,0000,0000,,that repetition. Dialogue: 0,0:38:44.20,0:38:47.71,Default,,0000,0000,0000,,C.S.: Reduce? That. Dialogue: 0,0:38:47.71,0:38:50.10,Default,,0000,0000,0000,,D.R.: He's a funny guy. Dialogue: 0,0:38:50.10,0:38:53.86,Default,,0000,0000,0000,,AUDIENCE: Trying to inject a little humor. Dialogue: 0,0:38:53.86,0:38:56.54,Default,,0000,0000,0000,,D.R.: Ha. Ha. Ha. Ha. Dialogue: 0,0:38:56.54,0:38:59.23,Default,,0000,0000,0000,,C.S.: Nice. I liked that. Dialogue: 0,0:38:59.23,0:39:02.81,Default,,0000,0000,0000,,D.R.: So I'll, I'll add a little set up Dialogue: 0,0:39:02.81,0:39:09.81,Default,,0000,0000,0000,,method. Get rid of all those. Oops. Do a Dialogue: 0,0:39:13.28,0:39:20.28,Default,,0000,0000,0000,,little find and replace. Rerun. Hey, everything's\Nstill passing. Dialogue: 0,0:39:22.49,0:39:24.92,Default,,0000,0000,0000,,C.S.: Cool. Dialogue: 0,0:39:24.92,0:39:29.69,Default,,0000,0000,0000,,D.R.: Groovy, groovy. Should we go further?\NOr, I Dialogue: 0,0:39:29.69,0:39:31.81,Default,,0000,0000,0000,,mean, I think we've, we've pretty much added\Nas Dialogue: 0,0:39:31.81,0:39:33.47,Default,,0000,0000,0000,,many numbers as we can possibly add. We could Dialogue: 0,0:39:33.47,0:39:37.06,Default,,0000,0000,0000,,add additional tests, or refactor this test\Nto say, Dialogue: 0,0:39:37.06,0:39:38.37,Default,,0000,0000,0000,,adds an infinite number of tes- or, numbers. Dialogue: 0,0:39:38.37,0:39:38.68,Default,,0000,0000,0000,,C.S.: Mhmm. Dialogue: 0,0:39:38.68,0:39:40.64,Default,,0000,0000,0000,,D.R.: And throw it all kinds of different\Nnumbers Dialogue: 0,0:39:40.64,0:39:43.95,Default,,0000,0000,0000,,inside of there. Or we could go do something, Dialogue: 0,0:39:43.95,0:39:45.93,Default,,0000,0000,0000,,something completely crazy and totally off\Nthe spec. Dialogue: 0,0:39:45.93,0:39:46.42,Default,,0000,0000,0000,,C.S.: We could. Dialogue: 0,0:39:46.42,0:39:47.17,Default,,0000,0000,0000,,D.R.: What else? Dialogue: 0,0:39:47.17,0:39:49.49,Default,,0000,0000,0000,,C.S.: What if we added arguments, instead\Nof numbers, Dialogue: 0,0:39:49.49,0:39:50.93,Default,,0000,0000,0000,,as strings? Would that work? Dialogue: 0,0:39:50.93,0:39:52.08,Default,,0000,0000,0000,,D.R.: Ah, I see. Dialogue: 0,0:39:52.08,0:39:54.49,Default,,0000,0000,0000,,C.S.: Does Ruby automatically convert, like,\Neach b would Dialogue: 0,0:39:54.49,0:39:56.47,Default,,0000,0000,0000,,do? Dialogue: 0,0:39:56.47,0:39:59.91,Default,,0000,0000,0000,,AUDIENCE: Is Ruby as good as PHP? Dialogue: 0,0:39:59.91,0:40:02.53,Default,,0000,0000,0000,,D.R.: Is Ruby as good as PHP? Dialogue: 0,0:40:02.53,0:40:04.41,Default,,0000,0000,0000,,AUDIENCE: I'll write that down. Dialogue: 0,0:40:04.41,0:40:08.25,Default,,0000,0000,0000,,D.R.: Test. Ruby as good as PHP. Dialogue: 0,0:40:08.25,0:40:10.20,Default,,0000,0000,0000,,So what should, what, what would we expect\Nit Dialogue: 0,0:40:10.20,0:40:13.15,Default,,0000,0000,0000,,to equal? If we do a calc dot add, Dialogue: 0,0:40:13.15,0:40:17.75,Default,,0000,0000,0000,,say, one and banana. What should we reason\Nwe Dialogue: 0,0:40:17.75,0:40:19.39,Default,,0000,0000,0000,,expect this to, to return to us? Dialogue: 0,0:40:19.39,0:40:21.83,Default,,0000,0000,0000,,C.S.: So that would probably generate an error,\Nright. Dialogue: 0,0:40:21.83,0:40:22.97,Default,,0000,0000,0000,,D.R.: I would expect so. Dialogue: 0,0:40:22.97,0:40:24.63,Default,,0000,0000,0000,,C.S.: So what if, instead of banana, we pass Dialogue: 0,0:40:24.63,0:40:28.16,Default,,0000,0000,0000,,number two as a string. Dialogue: 0,0:40:28.16,0:40:31.17,Default,,0000,0000,0000,,D.R.: Sure. That seems reasonably. I mean,\NRuby should Dialogue: 0,0:40:31.17,0:40:33.52,Default,,0000,0000,0000,,be able to convert a string with a numeric Dialogue: 0,0:40:33.52,0:40:34.03,Default,,0000,0000,0000,,value, right. Dialogue: 0,0:40:34.03,0:40:36.85,Default,,0000,0000,0000,,C.S.: So that should equal three integer,\Nright. Dialogue: 0,0:40:36.85,0:40:41.20,Default,,0000,0000,0000,,D.R.: Let's see. Oh. Oh. String can't be coerced Dialogue: 0,0:40:41.20,0:40:45.78,Default,,0000,0000,0000,,into fixnum? That sounds wonderful. And I'll\Nlet you Dialogue: 0,0:40:45.78,0:40:48.13,Default,,0000,0000,0000,,take over from there. Dialogue: 0,0:40:48.13,0:40:51.63,Default,,0000,0000,0000,,C.S.: Cool. Dialogue: 0,0:40:51.63,0:40:56.37,Default,,0000,0000,0000,,So, Ruby has a, a method. I'm not sure Dialogue: 0,0:40:56.37,0:40:59.70,Default,,0000,0000,0000,,if it's. I believe it's injected into object.\NIt's Dialogue: 0,0:40:59.70,0:41:02.30,Default,,0000,0000,0000,,extended. It's in a part of object, which\Nis Dialogue: 0,0:41:02.30,0:41:04.74,Default,,0000,0000,0000,,to_i, right, which is gonna try to convert\Nwhatever Dialogue: 0,0:41:04.74,0:41:07.26,Default,,0000,0000,0000,,that object is into an integer. So, in this Dialogue: 0,0:41:07.26,0:41:11.22,Default,,0000,0000,0000,,case, we're converting the string two into\Nan integer. Dialogue: 0,0:41:11.22,0:41:14.61,Default,,0000,0000,0000,,And that made our test pass. Dialogue: 0,0:41:14.61,0:41:14.83,Default,,0000,0000,0000,,But now. Dialogue: 0,0:41:14.83,0:41:16.49,Default,,0000,0000,0000,,D.R.: But then we get back to that banana Dialogue: 0,0:41:16.49,0:41:17.60,Default,,0000,0000,0000,,that I was trying to throw you earlier. Dialogue: 0,0:41:17.60,0:41:20.03,Default,,0000,0000,0000,,C.S.: Yeah. So here's the thing. We're looking\Nat Dialogue: 0,0:41:20.03,0:41:21.90,Default,,0000,0000,0000,,the test, at the name of the method. Test Dialogue: 0,0:41:21.90,0:41:24.37,Default,,0000,0000,0000,,adds string, right. But we want to be a Dialogue: 0,0:41:24.37,0:41:27.97,Default,,0000,0000,0000,,little bit more specific about what that does,\Nright. Dialogue: 0,0:41:27.97,0:41:32.25,Default,,0000,0000,0000,,So I'm gonna rename this method to test parses Dialogue: 0,0:41:32.25,0:41:33.71,Default,,0000,0000,0000,,valid strings. Dialogue: 0,0:41:33.71,0:41:37.80,Default,,0000,0000,0000,,And I'm gonna write another test that says\Ntest Dialogue: 0,0:41:37.80,0:41:44.80,Default,,0000,0000,0000,,raises error for invalid strings, which kind\Nof, kind Dialogue: 0,0:41:45.08,0:41:48.20,Default,,0000,0000,0000,,of gives us a bit of a path of Dialogue: 0,0:41:48.20,0:41:50.92,Default,,0000,0000,0000,,where we're going with implementing this test,\Nthis test Dialogue: 0,0:41:50.92,0:41:52.69,Default,,0000,0000,0000,,method. So what we want to do, we'll make Dialogue: 0,0:41:52.69,0:41:56.10,Default,,0000,0000,0000,,sure that it raises an, I believe this is Dialogue: 0,0:41:56.10,0:41:56.38,Default,,0000,0000,0000,,in the- Dialogue: 0,0:41:56.38,0:41:56.55,Default,,0000,0000,0000,,D.R.: Yup. Dialogue: 0,0:41:56.55,0:42:00.57,Default,,0000,0000,0000,,C.S.: -in the plural, an argument error, and\Nthen Dialogue: 0,0:42:00.57,0:42:04.64,Default,,0000,0000,0000,,we'd pass it a block. If we pass it Dialogue: 0,0:42:04.64,0:42:10.76,Default,,0000,0000,0000,,an invalid argument. So in this case, a banana. Dialogue: 0,0:42:10.76,0:42:13.74,Default,,0000,0000,0000,,Kaboom. Dialogue: 0,0:42:13.74,0:42:18.08,Default,,0000,0000,0000,,D.R.: So that brings us back to our original Dialogue: 0,0:42:18.08,0:42:23.25,Default,,0000,0000,0000,,question, what is the numeric value of banana,\Nright? Dialogue: 0,0:42:23.25,0:42:24.98,Default,,0000,0000,0000,,Apparently to_i is not working the way we\Nexpect Dialogue: 0,0:42:24.98,0:42:27.53,Default,,0000,0000,0000,,it to. Or, at least, Ruby's doing something\Nwith Dialogue: 0,0:42:27.53,0:42:28.83,Default,,0000,0000,0000,,it. It's definitely not throwing an error. Dialogue: 0,0:42:28.83,0:42:29.19,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:42:29.19,0:42:32.00,Default,,0000,0000,0000,,D.R.: So maybe we should figure out what the Dialogue: 0,0:42:32.00,0:42:34.46,Default,,0000,0000,0000,,numeric value of banana is. Dialogue: 0,0:42:34.46,0:42:35.82,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:42:35.82,0:42:37.26,Default,,0000,0000,0000,,D.R.: One way we could do that is to Dialogue: 0,0:42:37.26,0:42:39.85,Default,,0000,0000,0000,,write a test for it, right. We could write Dialogue: 0,0:42:39.85,0:42:42.42,Default,,0000,0000,0000,,an expectation. We expect x to be. Yeah. Dialogue: 0,0:42:42.42,0:42:45.16,Default,,0000,0000,0000,,AUDIENCE: [indecipherable] Would it be easier\Nto see? Dialogue: 0,0:42:45.16,0:42:47.89,Default,,0000,0000,0000,,C.S.: Do you want me to do that? Dialogue: 0,0:42:47.89,0:42:49.62,Default,,0000,0000,0000,,D.R.: Yeah. Use your magic fingers. Dialogue: 0,0:42:49.62,0:42:52.98,Default,,0000,0000,0000,,C.S.: If you want, you could do. Dialogue: 0,0:42:52.98,0:42:54.91,Default,,0000,0000,0000,,AUDIENCE: That doesn't work? Dialogue: 0,0:42:54.91,0:42:57.79,Default,,0000,0000,0000,,D.R.: I don't think that helped. Dialogue: 0,0:42:57.79,0:42:58.75,Default,,0000,0000,0000,,C.S.: Yeah. Dialogue: 0,0:42:58.75,0:42:59.24,Default,,0000,0000,0000,,AUDIENCE: ?? Dialogue: 0,0:42:59.24,0:43:02.66,Default,,0000,0000,0000,,C.S.: Should I make this one bigger and this Dialogue: 0,0:43:02.66,0:43:03.42,Default,,0000,0000,0000,,one smaller? Dialogue: 0,0:43:03.42,0:43:05.50,Default,,0000,0000,0000,,D.R.: Yeah, we can. I mean, the tests. We Dialogue: 0,0:43:05.50,0:43:12.50,Default,,0000,0000,0000,,can even make the font size on the tests Dialogue: 0,0:43:15.80,0:43:16.05,Default,,0000,0000,0000,,smaller. Dialogue: 0,0:43:16.05,0:43:17.02,Default,,0000,0000,0000,,C.S.: Does that help? Dialogue: 0,0:43:17.02,0:43:17.76,Default,,0000,0000,0000,,AUDIENCE: Yeah. Thanks. Dialogue: 0,0:43:17.76,0:43:18.73,Default,,0000,0000,0000,,C.S.: All right. Cool. Dialogue: 0,0:43:18.73,0:43:19.90,Default,,0000,0000,0000,,D.R.: So now we're stuck with this, you know, Dialogue: 0,0:43:19.90,0:43:22.35,Default,,0000,0000,0000,,what is the numeric value of, of, banana.\NAnd- Dialogue: 0,0:43:22.35,0:43:23.14,Default,,0000,0000,0000,,C.S.: So, yeah. Dialogue: 0,0:43:23.14,0:43:25.19,Default,,0000,0000,0000,,D.R.: -I would approach it by writing a test Dialogue: 0,0:43:25.19,0:43:32.19,Default,,0000,0000,0000,,for it. Test numeric. Numberic. Numberic.\NNumeric value of Dialogue: 0,0:43:33.21,0:43:37.37,Default,,0000,0000,0000,,banana. That's a drinking game actually. Every\Ntime a Dialogue: 0,0:43:37.37,0:43:43.85,Default,,0000,0000,0000,,presenter says banana you have to take a drink. Dialogue: 0,0:43:43.85,0:43:48.23,Default,,0000,0000,0000,,I, I would expect banana to raise an ex- Dialogue: 0,0:43:48.23,0:43:50.42,Default,,0000,0000,0000,,an exception if I tried to coerce it to Dialogue: 0,0:43:50.42,0:43:52.25,Default,,0000,0000,0000,,an integer. But, apparently Ruby's doing something\Nelse with Dialogue: 0,0:43:52.25,0:43:54.70,Default,,0000,0000,0000,,that. So maybe it gives it a value of Dialogue: 0,0:43:54.70,0:43:56.51,Default,,0000,0000,0000,,zero. Maybe it's trying to turn it into a Dialogue: 0,0:43:56.51,0:43:59.28,Default,,0000,0000,0000,,number. I know another language that begins\Nwith a Dialogue: 0,0:43:59.28,0:44:00.80,Default,,0000,0000,0000,,P and ends with a P that does something Dialogue: 0,0:44:00.80,0:44:05.33,Default,,0000,0000,0000,,similar that confounds many people. Dialogue: 0,0:44:05.33,0:44:07.10,Default,,0000,0000,0000,,And we'll use that same to_i trick that you Dialogue: 0,0:44:07.10,0:44:10.61,Default,,0000,0000,0000,,just showed me. And let's see what happens.\NOh. Dialogue: 0,0:44:10.61,0:44:12.32,Default,,0000,0000,0000,,I get a passing test. Dialogue: 0,0:44:12.32,0:44:13.28,Default,,0000,0000,0000,,C.S.: Yup. Dialogue: 0,0:44:13.28,0:44:16.40,Default,,0000,0000,0000,,D.R.: So. Let's, just to verify, I'll make\Nthis Dialogue: 0,0:44:16.40,0:44:19.16,Default,,0000,0000,0000,,another value. Like one. Maybe the value of\Nbanana Dialogue: 0,0:44:19.16,0:44:24.70,Default,,0000,0000,0000,,is one. Nope. The actual value is zero. And, Dialogue: 0,0:44:24.70,0:44:28.01,Default,,0000,0000,0000,,interesting thing there, you can see that\Nthe, the Dialogue: 0,0:44:28.01,0:44:30.25,Default,,0000,0000,0000,,tests are flipping every time we run it, because Dialogue: 0,0:44:30.25,0:44:35.79,Default,,0000,0000,0000,,it's implemented as a hash and not. Fun stuff. Dialogue: 0,0:44:35.79,0:44:38.90,Default,,0000,0000,0000,,So then if the, if, if the numeric value Dialogue: 0,0:44:38.90,0:44:45.83,Default,,0000,0000,0000,,of, of banana is zero, how are we gonna Dialogue: 0,0:44:45.83,0:44:47.81,Default,,0000,0000,0000,,test- how are we gonna figure out that we've Dialogue: 0,0:44:47.81,0:44:51.38,Default,,0000,0000,0000,,been given a banana instead of a number inside Dialogue: 0,0:44:51.38,0:44:52.98,Default,,0000,0000,0000,,of our calculator? Dialogue: 0,0:44:52.98,0:44:57.16,Default,,0000,0000,0000,,Well, we could start with a little refactor,\Nright. Dialogue: 0,0:44:57.16,0:44:59.13,Default,,0000,0000,0000,,We're probably gonna need some code inside\Nof this Dialogue: 0,0:44:59.13,0:45:01.47,Default,,0000,0000,0000,,block. And we run into a number, an argument Dialogue: 0,0:45:01.47,0:45:04.11,Default,,0000,0000,0000,,that we've been given that isn't numerically,\Nisn't a Dialogue: 0,0:45:04.11,0:45:10.16,Default,,0000,0000,0000,,numericalized varia- or, value. Something\Nthat we can coerce. Dialogue: 0,0:45:10.16,0:45:16.26,Default,,0000,0000,0000,,Then, we need to do something different. Dialogue: 0,0:45:16.26,0:45:23.26,Default,,0000,0000,0000,,So, we'll put a little guard in there. Because Dialogue: 0,0:45:25.96,0:45:32.15,Default,,0000,0000,0000,,we want to raise an exception, according to\NCarlos's Dialogue: 0,0:45:32.15,0:45:34.81,Default,,0000,0000,0000,,test. And. Dialogue: 0,0:45:34.81,0:45:38.85,Default,,0000,0000,0000,,C.S.: So the reason behind this is, we, we Dialogue: 0,0:45:38.85,0:45:41.94,Default,,0000,0000,0000,,realized that if we pass a valid string that Dialogue: 0,0:45:41.94,0:45:44.28,Default,,0000,0000,0000,,is able to be parsed to a number, say Dialogue: 0,0:45:44.28,0:45:45.53,Default,,0000,0000,0000,,one, in double quotes- Dialogue: 0,0:45:45.53,0:45:47.08,Default,,0000,0000,0000,,Or. So. Dialogue: 0,0:45:47.08,0:45:52.47,Default,,0000,0000,0000,,D.R.: Just take it. Just take it. Dialogue: 0,0:45:52.47,0:45:54.57,Default,,0000,0000,0000,,C.S.: So if you pass a string that is Dialogue: 0,0:45:54.57,0:45:57.43,Default,,0000,0000,0000,,able to be converted to an integer, right,\Nsay, Dialogue: 0,0:45:57.43,0:46:00.58,Default,,0000,0000,0000,,one in quotes, it's successfully converted\Ninto one integer. Dialogue: 0,0:46:00.58,0:46:02.83,Default,,0000,0000,0000,,But if we pass a string that's not able Dialogue: 0,0:46:02.83,0:46:04.57,Default,,0000,0000,0000,,to be converted to an integer, it's gonna\Nresolve Dialogue: 0,0:46:04.57,0:46:08.19,Default,,0000,0000,0000,,to zero. So, what we realize is that, the Dialogue: 0,0:46:08.19,0:46:13.17,Default,,0000,0000,0000,,valid argument would be if n dash to_i equals Dialogue: 0,0:46:13.17,0:46:17.12,Default,,0000,0000,0000,,zero, and at the same time, if the original Dialogue: 0,0:46:17.12,0:46:20.25,Default,,0000,0000,0000,,string was zero, then that's a valid one.\NOtherwise, Dialogue: 0,0:46:20.25,0:46:22.93,Default,,0000,0000,0000,,raise an error. So the only reason, the only Dialogue: 0,0:46:22.93,0:46:25.83,Default,,0000,0000,0000,,way that it's a valid conversion is if the Dialogue: 0,0:46:25.83,0:46:30.67,Default,,0000,0000,0000,,integer zero came from a string zero. Dialogue: 0,0:46:30.67,0:46:32.33,Default,,0000,0000,0000,,That's what that code means. Dialogue: 0,0:46:32.33,0:46:39.33,Default,,0000,0000,0000,,AUDIENCE: Is there a reason why you're using\Ntriple Dialogue: 0,0:46:41.65,0:46:42.69,Default,,0000,0000,0000,,equals? Dialogue: 0,0:46:42.69,0:46:49.69,Default,,0000,0000,0000,,D.R.: Because I'm a JavaScript guy, and my\Nbrain Dialogue: 0,0:46:52.01,0:46:54.70,Default,,0000,0000,0000,,is programmed to use triple equals any time\NI Dialogue: 0,0:46:54.70,0:46:55.57,Default,,0000,0000,0000,,compare to zero. I'm sure is something my\Nfingers Dialogue: 0,0:46:55.57,0:46:56.44,Default,,0000,0000,0000,,are trained to type. Oh, you're gonna type\Na Dialogue: 0,0:46:56.44,0:46:57.31,Default,,0000,0000,0000,,zero now, aren't you? Let me just throw another Dialogue: 0,0:46:57.31,0:46:57.69,Default,,0000,0000,0000,,equal sign in there. Dialogue: 0,0:46:57.69,0:46:58.51,Default,,0000,0000,0000,,So yeah. Like, like Carlos was saying. If\Nthe Dialogue: 0,0:46:58.51,0:47:00.96,Default,,0000,0000,0000,,number what I'm given converts to zero, the\Nnumber Dialogue: 0,0:47:00.96,0:47:03.06,Default,,0000,0000,0000,,that I'm given converts to zero but it isn't Dialogue: 0,0:47:03.06,0:47:05.91,Default,,0000,0000,0000,,actually string zero, then that would be one\Nof Dialogue: 0,0:47:05.91,0:47:08.54,Default,,0000,0000,0000,,those strings that coerces to zero for us.\NThank Dialogue: 0,0:47:08.54,0:47:09.75,Default,,0000,0000,0000,,you banana. Dialogue: 0,0:47:09.75,0:47:10.54,Default,,0000,0000,0000,,Yeah? Dialogue: 0,0:47:10.54,0:47:13.69,Default,,0000,0000,0000,,AUDIENCE: If you, if you coerce it to a Dialogue: 0,0:47:13.69,0:47:18.09,Default,,0000,0000,0000,,string that's the same as itself, as an alternative? Dialogue: 0,0:47:18.09,0:47:19.69,Default,,0000,0000,0000,,D.R.: Taking, what, sorry? Dialogue: 0,0:47:19.69,0:47:22.52,Default,,0000,0000,0000,,AUDIENCE: Take, take, take whatever comes\Nin, and coerce Dialogue: 0,0:47:22.52,0:47:24.47,Default,,0000,0000,0000,,it to string, and test whether it's the same Dialogue: 0,0:47:24.47,0:47:29.21,Default,,0000,0000,0000,,as itself. If it is, then it's a literal. Dialogue: 0,0:47:29.21,0:47:31.17,Default,,0000,0000,0000,,It's a, it's a string. Dialogue: 0,0:47:31.17,0:47:34.95,Default,,0000,0000,0000,,D.R.: So, same as that? Dialogue: 0,0:47:34.95,0:47:36.82,Default,,0000,0000,0000,,AUDIENCE: Well, you got. I don't mean in the Dialogue: 0,0:47:36.82,0:47:38.16,Default,,0000,0000,0000,,second bit. Yeah. Dialogue: 0,0:47:38.16,0:47:39.68,Default,,0000,0000,0000,,D.R.: Let's see. Dialogue: 0,0:47:39.68,0:47:42.22,Default,,0000,0000,0000,,C.S.: Doesn't look like it. Dialogue: 0,0:47:42.22,0:47:43.75,Default,,0000,0000,0000,,D.R.: Apparently not. Dialogue: 0,0:47:43.75,0:47:46.29,Default,,0000,0000,0000,,AUDIENCE: Valid strings are failing. Dialogue: 0,0:47:46.29,0:47:47.30,Default,,0000,0000,0000,,C.S.: Yeah. Dialogue: 0,0:47:47.30,0:47:54.30,Default,,0000,0000,0000,,D.R.: Right. Now valid strings are failing. Dialogue: 0,0:47:55.13,0:47:56.80,Default,,0000,0000,0000,,But that's the beauty, again, of the Dojo.\NIf Dialogue: 0,0:47:56.80,0:47:58.48,Default,,0000,0000,0000,,there's something that I want to experiment\Nwith, I'm, Dialogue: 0,0:47:58.48,0:48:01.35,Default,,0000,0000,0000,,I'm at green tests. I can try something else. Dialogue: 0,0:48:01.35,0:48:03.22,Default,,0000,0000,0000,,Just, just to see, how does Ruby behave this Dialogue: 0,0:48:03.22,0:48:03.87,Default,,0000,0000,0000,,way? Dialogue: 0,0:48:03.87,0:48:06.47,Default,,0000,0000,0000,,C.S.: Right. All right. Dialogue: 0,0:48:06.47,0:48:08.83,Default,,0000,0000,0000,,So, we're gonna take a little break. So you Dialogue: 0,0:48:08.83,0:48:09.44,Default,,0000,0000,0000,,all can. Dialogue: 0,0:48:09.44,0:48:11.70,Default,,0000,0000,0000,,D.R.: Yeah. Project Euler is a great- if,\Nif Dialogue: 0,0:48:11.70,0:48:15.99,Default,,0000,0000,0000,,you don't know about Project Euler, spelled\Ne-u-l-e-r, Euler. Dialogue: 0,0:48:15.99,0:48:22.99,Default,,0000,0000,0000,,Euler. Euler. Hello. ProjectEuler dot net\Nhas a ton Dialogue: 0,0:48:24.12,0:48:29.66,Default,,0000,0000,0000,,of, of computer science problems that seem\Ntrivial at Dialogue: 0,0:48:29.66,0:48:32.03,Default,,0000,0000,0000,,first, but if you implement them in the most Dialogue: 0,0:48:32.03,0:48:35.07,Default,,0000,0000,0000,,trivial manner possible, you'll do something\Nsilly like blow Dialogue: 0,0:48:35.07,0:48:37.41,Default,,0000,0000,0000,,out your recursion stack or take an hour and Dialogue: 0,0:48:37.41,0:48:39.73,Default,,0000,0000,0000,,a half to compute the result or something\Nlike Dialogue: 0,0:48:39.73,0:48:40.99,Default,,0000,0000,0000,,that. So you have to think about them a Dialogue: 0,0:48:40.99,0:48:41.69,Default,,0000,0000,0000,,little more. Dialogue: 0,0:48:41.69,0:48:44.73,Default,,0000,0000,0000,,But, you can do it in a test-driven style, Dialogue: 0,0:48:44.73,0:48:48.01,Default,,0000,0000,0000,,and, and once you get passing tests on your Dialogue: 0,0:48:48.01,0:48:52.33,Default,,0000,0000,0000,,hour and a half long solution, then optimize,\Nrefactor, Dialogue: 0,0:48:52.33,0:48:54.83,Default,,0000,0000,0000,,and get a more optimal solution. Figure, there's\Nlots Dialogue: 0,0:48:54.83,0:48:59.58,Default,,0000,0000,0000,,of prime number calculations inside of Project\NEuler. Euler. Dialogue: 0,0:48:59.58,0:49:02.49,Default,,0000,0000,0000,,Euler. You'll never forget that now. Dialogue: 0,0:49:02.49,0:49:05.87,Default,,0000,0000,0000,,Code Wars is another. That's, that website\Nlaunched recently. Dialogue: 0,0:49:05.87,0:49:08.21,Default,,0000,0000,0000,,CodeWars dot com. You can sign up for JavaScript, Dialogue: 0,0:49:08.21,0:49:11.60,Default,,0000,0000,0000,,CoffeeScript and Ruby, I think right now.\NThey've got Dialogue: 0,0:49:11.60,0:49:13.90,Default,,0000,0000,0000,,a bunch of Code Katas. They even call them Dialogue: 0,0:49:13.90,0:49:16.91,Default,,0000,0000,0000,,Code Katas. You get different belts starting\Nfrom 8kyu Dialogue: 0,0:49:16.91,0:49:20.02,Default,,0000,0000,0000,,and work your way up to Grand Master Black Dialogue: 0,0:49:20.02,0:49:24.88,Default,,0000,0000,0000,,Belt. CodeWars dot com. I, I recommend that\Nto Dialogue: 0,0:49:24.88,0:49:29.25,Default,,0000,0000,0000,,my students as well. And it's, again, emphasizing\Ntest-driven. Dialogue: 0,0:49:29.25,0:49:31.22,Default,,0000,0000,0000,,You totally don't have to do it test-driven,\Nbut Dialogue: 0,0:49:31.22,0:49:33.47,Default,,0000,0000,0000,,it's a great way to practice. Dialogue: 0,0:49:33.47,0:49:35.12,Default,,0000,0000,0000,,There are, there are books on the subject,\Nwhich Dialogue: 0,0:49:35.12,0:49:36.60,Default,,0000,0000,0000,,we'll talk about at the end of our presentation. Dialogue: 0,0:49:36.60,0:49:37.64,Default,,0000,0000,0000,,There's a great book by- Dialogue: 0,0:49:37.64,0:49:43.70,Default,,0000,0000,0000,,C.S.: Emily Clark, if I remember correctly. Dialogue: 0,0:49:43.70,0:49:48.90,Default,,0000,0000,0000,,D.R.: Navigata. Bam. Coding Dojo Handbook. Dialogue: 0,0:49:48.90,0:49:52.36,Default,,0000,0000,0000,,C.S.: Emily Bache. Yeah. Dialogue: 0,0:49:52.36,0:49:59.36,Default,,0000,0000,0000,,D.R.: Forward by Uncle Bob. Rob Martin. So,\Nthis Dialogue: 0,0:49:59.48,0:50:00.91,Default,,0000,0000,0000,,has a lot of Katas in it, a lot Dialogue: 0,0:50:00.91,0:50:04.63,Default,,0000,0000,0000,,of very standard Katas. What we found in running Dialogue: 0,0:50:04.63,0:50:07.74,Default,,0000,0000,0000,,the Coding Dojo for a great, for, for two Dialogue: 0,0:50:07.74,0:50:09.34,Default,,0000,0000,0000,,years, two plus years at that point, was that Dialogue: 0,0:50:09.34,0:50:12.14,Default,,0000,0000,0000,,you can recycle the same problems over and\Nover Dialogue: 0,0:50:12.14,0:50:14.65,Default,,0000,0000,0000,,again. Once you find a couple that are easy Dialogue: 0,0:50:14.65,0:50:17.69,Default,,0000,0000,0000,,to explain and get everyone to wrap their\Nheads Dialogue: 0,0:50:17.69,0:50:20.15,Default,,0000,0000,0000,,around, you use them over and over and over Dialogue: 0,0:50:20.15,0:50:22.11,Default,,0000,0000,0000,,again, and you try them in different languages.\NYou Dialogue: 0,0:50:22.11,0:50:24.39,Default,,0000,0000,0000,,try them with different constraints. You just\Ntry to Dialogue: 0,0:50:24.39,0:50:26.90,Default,,0000,0000,0000,,see if you can solve the dang problem. All Dialogue: 0,0:50:26.90,0:50:30.13,Default,,0000,0000,0000,,kinds of things come into your head in the Dialogue: 0,0:50:30.13,0:50:31.96,Default,,0000,0000,0000,,weeks in between when you do the Dojo, and Dialogue: 0,0:50:31.96,0:50:33.98,Default,,0000,0000,0000,,when you do the Dojo again. Dialogue: 0,0:50:33.98,0:50:36.43,Default,,0000,0000,0000,,Some of the common ones are like, Roman numberals- Dialogue: 0,0:50:36.43,0:50:41.06,Default,,0000,0000,0000,,Roman numeral conversions. Uncle Bob Martin's\Nfamous one was Dialogue: 0,0:50:41.06,0:50:43.35,Default,,0000,0000,0000,,the bowling game. We did that one time at Dialogue: 0,0:50:43.35,0:50:46.21,Default,,0000,0000,0000,,the Coding Dojo in Orlando. We tried to do Dialogue: 0,0:50:46.21,0:50:47.86,Default,,0000,0000,0000,,the bowling game. One time. And what we discovered Dialogue: 0,0:50:47.86,0:50:49.38,Default,,0000,0000,0000,,is that nerds actually do not know how to Dialogue: 0,0:50:49.38,0:50:50.61,Default,,0000,0000,0000,,score bowling at all. Dialogue: 0,0:50:50.61,0:50:54.77,Default,,0000,0000,0000,,It is, that knowledge is completely encapsulated\Nin computer Dialogue: 0,0:50:54.77,0:50:56.77,Default,,0000,0000,0000,,software now and no one has committed any\Nof Dialogue: 0,0:50:56.77,0:50:59.02,Default,,0000,0000,0000,,it to memory. And does not even understand\Nhow Dialogue: 0,0:50:59.02,0:51:02.21,Default,,0000,0000,0000,,that software runs anymore. We just know that,\Noccasionally, Dialogue: 0,0:51:02.21,0:51:06.82,Default,,0000,0000,0000,,turkeys come on the screen. And we have, only Dialogue: 0,0:51:06.82,0:51:10.70,Default,,0000,0000,0000,,if we have the numbers up, right. So. Dialogue: 0,0:51:10.70,0:51:12.06,Default,,0000,0000,0000,,Those are great resources for that. Dialogue: 0,0:51:12.06,0:51:13.08,Default,,0000,0000,0000,,C.S.: Take a break now? Dialogue: 0,0:51:13.08,0:51:15.33,Default,,0000,0000,0000,,D.R.: Yeah. Yeah. Let's take a break, and\Nwhen Dialogue: 0,0:51:15.33,0:51:18.49,Default,,0000,0000,0000,,we come back, we're gonna, we're gonna give\Neverybody Dialogue: 0,0:51:18.49,0:51:20.52,Default,,0000,0000,0000,,a post-it note, a different-color post-it\Nnote. This is Dialogue: 0,0:51:20.52,0:51:24.66,Default,,0000,0000,0000,,some logistics. You'll pair up, or, pair up.\NYou'll Dialogue: 0,0:51:24.66,0:51:26.41,Default,,0000,0000,0000,,group up into groups of three and we'll do Dialogue: 0,0:51:26.41,0:51:29.50,Default,,0000,0000,0000,,like a Code, Code Retreat-style Coding Dojo\Nwith the Dialogue: 0,0:51:29.50,0:51:31.88,Default,,0000,0000,0000,,entire group. We got a problem for you. We've Dialogue: 0,0:51:31.88,0:51:35.31,Default,,0000,0000,0000,,got some constraints for you. You can totally\Nuse Dialogue: 0,0:51:35.31,0:51:37.78,Default,,0000,0000,0000,,what you've, what you've learned just right\Nnow to Dialogue: 0,0:51:37.78,0:51:40.57,Default,,0000,0000,0000,,practice. We'll do that and we'll take another\Nbreak Dialogue: 0,0:51:40.57,0:51:42.50,Default,,0000,0000,0000,,and we'll do another Coding Dojo after that\Nwith Dialogue: 0,0:51:42.50,0:51:43.03,Default,,0000,0000,0000,,a different problem. Dialogue: 0,0:51:43.03,0:51:43.24,Default,,0000,0000,0000,,C.S.: Cool. Dialogue: 0,0:51:43.24,0:51:44.30,Default,,0000,0000,0000,,D.R.: Don't have to participate in all three.\NDon't Dialogue: 0,0:51:44.30,0:51:45.81,Default,,0000,0000,0000,,have to participate in any of them. Dialogue: 0,0:51:45.81,0:51:46.24,Default,,0000,0000,0000,,C.S.: Yup. Dialogue: 0,0:51:46.24,0:51:47.94,Default,,0000,0000,0000,,D.R.: If you don't really want to. But we Dialogue: 0,0:51:47.94,0:51:50.57,Default,,0000,0000,0000,,encourage you to, to come and, and play and Dialogue: 0,0:51:50.57,0:51:51.40,Default,,0000,0000,0000,,practice with us. Dialogue: 0,0:51:51.40,0:51:52.47,Default,,0000,0000,0000,,C.S.: All right. Fifteen minutes? Dialogue: 0,0:51:52.47,0:51:52.91,Default,,0000,0000,0000,,D.R.: Yup. Dialogue: 0,0:51:52.91,0:51:53.55,Default,,0000,0000,0000,,C.S.: Sounds good? Dialogue: 0,0:51:53.55,0:51:55.06,Default,,0000,0000,0000,,D.R.: We'll meet back in fifteen minutes. Dialogue: 0,0:51:55.06,0:51:55.93,Default,,0000,0000,0000,,C.S.: All right. Cool. Dialogue: 0,0:51:55.93,0:51:57.05,Default,,0000,0000,0000,,Before we start, I want to make sure that Dialogue: 0,0:51:57.05,0:52:00.65,Default,,0000,0000,0000,,everyone has Ruby installed. That is pretty\Nmuch the Dialogue: 0,0:52:00.65,0:52:04.40,Default,,0000,0000,0000,,only per-requisite, just to have Ruby, at\Nleast 1.9.3, Dialogue: 0,0:52:04.40,0:52:07.00,Default,,0000,0000,0000,,I want to say, which is the version that Dialogue: 0,0:52:07.00,0:52:07.49,Default,,0000,0000,0000,,comes with miniTest, right. No one- Dialogue: 0,0:52:07.49,0:52:09.66,Default,,0000,0000,0000,,how to run, write Ruby from the command line? Dialogue: 0,0:52:09.66,0:52:16.66,Default,,0000,0000,0000,,How far down the rabbit hole do we need Dialogue: 0,0:52:17.17,0:52:18.84,Default,,0000,0000,0000,,to go? Dialogue: 0,0:52:18.84,0:52:21.30,Default,,0000,0000,0000,,C.S.: So if you want to see what version Dialogue: 0,0:52:21.30,0:52:27.82,Default,,0000,0000,0000,,of Ruby you have, you run ruby dash dash Dialogue: 0,0:52:27.82,0:52:28.85,Default,,0000,0000,0000,,version. And- Dialogue: 0,0:52:28.85,0:52:35.63,Default,,0000,0000,0000,,D.R.: In a, in a window that you can- Dialogue: 0,0:52:35.63,0:52:36.35,Default,,0000,0000,0000,,C.S.: There you go. Ruby dash dash version.\NAnd Dialogue: 0,0:52:36.35,0:52:38.78,Default,,0000,0000,0000,,it should be, at least, 1.9.3. For this one, Dialogue: 0,0:52:38.78,0:52:40.88,Default,,0000,0000,0000,,I'm using 2 point 0, which is fine. You Dialogue: 0,0:52:40.88,0:52:42.21,Default,,0000,0000,0000,,don't have to be on 2 point 0, but Dialogue: 0,0:52:42.21,0:52:42.28,Default,,0000,0000,0000,,at least 1.9.3. Dialogue: 0,0:52:42.28,0:52:42.51,Default,,0000,0000,0000,,D.R.: And we'll show you that magic bash incantation Dialogue: 0,0:52:42.51,0:52:46.66,Default,,0000,0000,0000,,as well if you want to use that in Dialogue: 0,0:52:46.66,0:52:50.39,Default,,0000,0000,0000,,your, in your tests. Dialogue: 0,0:52:50.39,0:52:54.05,Default,,0000,0000,0000,,C.S.: Cool. So everyone has Ruby at least\N1.9.3 Dialogue: 0,0:52:54.05,0:52:57.25,Default,,0000,0000,0000,,and at least one text editor? Cool. Dialogue: 0,0:52:57.25,0:52:59.76,Default,,0000,0000,0000,,D.R.: Something emacs-flavored. Dialogue: 0,0:52:59.76,0:53:01.43,Default,,0000,0000,0000,,C.S.: Not. Dialogue: 0,0:53:01.43,0:53:06.38,Default,,0000,0000,0000,,Right. So the first problem, we want to group Dialogue: 0,0:53:06.38,0:53:10.76,Default,,0000,0000,0000,,into pairs of three, right. So, you might\Nhave Dialogue: 0,0:53:10.76,0:53:15.21,Default,,0000,0000,0000,,gotten a post-it from David or maybe got yourselves, Dialogue: 0,0:53:15.21,0:53:17.35,Default,,0000,0000,0000,,and what we want to do is, we want Dialogue: 0,0:53:17.35,0:53:19.01,Default,,0000,0000,0000,,to group together into groups of three, with\Npeople Dialogue: 0,0:53:19.01,0:53:21.84,Default,,0000,0000,0000,,with the same color post-its. So if you have Dialogue: 0,0:53:21.84,0:53:25.16,Default,,0000,0000,0000,,an orange post-it, you look for two other\Npeople Dialogue: 0,0:53:25.16,0:53:26.26,Default,,0000,0000,0000,,with that same color post-it. Dialogue: 0,0:53:26.26,0:53:27.76,Default,,0000,0000,0000,,D.R.: And that, if you have- Dialogue: 0,0:53:27.76,0:53:31.01,Default,,0000,0000,0000,,C.S.: Someone's gonna have to get up. Dialogue: 0,0:53:31.01,0:53:36.52,Default,,0000,0000,0000,,Going over the etiquettes real quick. Test-driven\Ndevelopment, as Dialogue: 0,0:53:36.52,0:53:39.03,Default,,0000,0000,0000,,you might have seen us, David and I, doing Dialogue: 0,0:53:39.03,0:53:43.06,Default,,0000,0000,0000,,here, is red-green-refactor, so. You write\Na failing test Dialogue: 0,0:53:43.06,0:53:47.52,Default,,0000,0000,0000,,before you write any production code. Giggles.\NYou make Dialogue: 0,0:53:47.52,0:53:50.22,Default,,0000,0000,0000,,that test pass. And if you need to, you Dialogue: 0,0:53:50.22,0:53:52.85,Default,,0000,0000,0000,,go back and you refactor, right. And then\Nyou Dialogue: 0,0:53:52.85,0:53:54.61,Default,,0000,0000,0000,,do that cycle. That's the cycle that you want Dialogue: 0,0:53:54.61,0:53:55.23,Default,,0000,0000,0000,,to follow. So. Dialogue: 0,0:53:55.23,0:53:57.07,Default,,0000,0000,0000,,D.R.: And just because you get to a green Dialogue: 0,0:53:57.07,0:53:59.11,Default,,0000,0000,0000,,cycle does not mean you have to refactor. Dialogue: 0,0:53:59.11,0:53:59.65,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:53:59.65,0:54:01.17,Default,,0000,0000,0000,,D.R.: But it's a good time to take a Dialogue: 0,0:54:01.17,0:54:03.99,Default,,0000,0000,0000,,break. Look, you know, look back at the code Dialogue: 0,0:54:03.99,0:54:05.76,Default,,0000,0000,0000,,as a pair, as a group, and say, should Dialogue: 0,0:54:05.76,0:54:06.05,Default,,0000,0000,0000,,we refactor? Dialogue: 0,0:54:06.05,0:54:06.39,Default,,0000,0000,0000,,C.S.: Yup. Dialogue: 0,0:54:06.39,0:54:08.65,Default,,0000,0000,0000,,D.R.: Is there something we can make simpler?\NIs Dialogue: 0,0:54:08.65,0:54:10.57,Default,,0000,0000,0000,,there something we were copying and pasting?\NIs there Dialogue: 0,0:54:10.57,0:54:12.37,Default,,0000,0000,0000,,a different way we could do this? Is there Dialogue: 0,0:54:12.37,0:54:14.79,Default,,0000,0000,0000,,another test we should add? Figure, take,\Ntake your Dialogue: 0,0:54:14.79,0:54:16.47,Default,,0000,0000,0000,,break. Figure out what you're gonna do next. Dialogue: 0,0:54:16.47,0:54:18.11,Default,,0000,0000,0000,,C.S.: Right. And we're gonna do the ping pong Dialogue: 0,0:54:18.11,0:54:20.81,Default,,0000,0000,0000,,pairing, right. So just like David and I did, Dialogue: 0,0:54:20.81,0:54:22.81,Default,,0000,0000,0000,,you write a failing test. You pass it along Dialogue: 0,0:54:22.81,0:54:24.85,Default,,0000,0000,0000,,to your co-pilot. So you have three people.\NMost Dialogue: 0,0:54:24.85,0:54:26.49,Default,,0000,0000,0000,,of you have three people. So you're gonna\Nhave, Dialogue: 0,0:54:26.49,0:54:28.94,Default,,0000,0000,0000,,start with a pilot and a co-pilot, and then Dialogue: 0,0:54:28.94,0:54:31.36,Default,,0000,0000,0000,,the third person is gonna be the audience,\Nright. Dialogue: 0,0:54:31.36,0:54:33.90,Default,,0000,0000,0000,,And what we recommend is that the audience\Ndoes Dialogue: 0,0:54:33.90,0:54:37.01,Default,,0000,0000,0000,,not talk on red. What that means is that, Dialogue: 0,0:54:37.01,0:54:39.99,Default,,0000,0000,0000,,whenever there's a failing test, you let the\Npair Dialogue: 0,0:54:39.99,0:54:42.73,Default,,0000,0000,0000,,figure out what the solution is, right. So\Nonly Dialogue: 0,0:54:42.73,0:54:46.01,Default,,0000,0000,0000,,the driver and the co-pilot are part of trying Dialogue: 0,0:54:46.01,0:54:48.07,Default,,0000,0000,0000,,to figure out how to make that one test Dialogue: 0,0:54:48.07,0:54:48.36,Default,,0000,0000,0000,,pass. Dialogue: 0,0:54:48.36,0:54:50.34,Default,,0000,0000,0000,,D.R.: But don't think that you're stuck on\NAlcatraz Dialogue: 0,0:54:50.34,0:54:54.26,Default,,0000,0000,0000,,or something. If you're a pair and, you may Dialogue: 0,0:54:54.26,0:54:56.51,Default,,0000,0000,0000,,be really new to Ruby, or maybe just new Dialogue: 0,0:54:56.51,0:54:58.50,Default,,0000,0000,0000,,to test-driven development and you're like,\NI don't know Dialogue: 0,0:54:58.50,0:55:00.13,Default,,0000,0000,0000,,what to type here. Do you know what to Dialogue: 0,0:55:00.13,0:55:03.04,Default,,0000,0000,0000,,type here? I don't know what to type here. Dialogue: 0,0:55:03.04,0:55:06.80,Default,,0000,0000,0000,,Please ask your audience first, and if none\Nof Dialogue: 0,0:55:06.80,0:55:08.78,Default,,0000,0000,0000,,the three of you know what you're doing next Dialogue: 0,0:55:08.78,0:55:10.62,Default,,0000,0000,0000,,or what you need to do next, raise your Dialogue: 0,0:55:10.62,0:55:12.60,Default,,0000,0000,0000,,hand. We've got some helpers that'll be walking\Naround. Dialogue: 0,0:55:12.60,0:55:13.01,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:55:13.01,0:55:13.62,Default,,0000,0000,0000,,D.R.: Helping out. Dialogue: 0,0:55:13.62,0:55:14.23,Default,,0000,0000,0000,,C.S.: And- yeah. Dialogue: 0,0:55:14.23,0:55:15.45,Default,,0000,0000,0000,,D.R.: We'll be walking around too. Dialogue: 0,0:55:15.45,0:55:18.38,Default,,0000,0000,0000,,C.S.: And, and the internet is not super cool, Dialogue: 0,0:55:18.38,0:55:21.69,Default,,0000,0000,0000,,but it's also good to look up. And, I Dialogue: 0,0:55:21.69,0:55:23.72,Default,,0000,0000,0000,,mean, internet's not reliable here, right.\NBut you're more Dialogue: 0,0:55:23.72,0:55:27.41,Default,,0000,0000,0000,,than free to look up documentation and references\Nand, Dialogue: 0,0:55:27.41,0:55:29.99,Default,,0000,0000,0000,,you know, ways to use the API and different Dialogue: 0,0:55:29.99,0:55:32.33,Default,,0000,0000,0000,,assertions that you can use. This is an open Dialogue: 0,0:55:32.33,0:55:33.10,Default,,0000,0000,0000,,book test. Dialogue: 0,0:55:33.10,0:55:35.34,Default,,0000,0000,0000,,D.R.: Yeah. And another thing to keep in mind Dialogue: 0,0:55:35.34,0:55:38.78,Default,,0000,0000,0000,,is IRB is open game as well. If you Dialogue: 0,0:55:38.78,0:55:40.83,Default,,0000,0000,0000,,are like, like, like you saw with us, when Dialogue: 0,0:55:40.83,0:55:42.25,Default,,0000,0000,0000,,we were doing the banana test- Dialogue: 0,0:55:42.25,0:55:42.75,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:55:42.75,0:55:45.02,Default,,0000,0000,0000,,D.R.: We wrote a test to describe, to describe, Dialogue: 0,0:55:45.02,0:55:47.12,Default,,0000,0000,0000,,to assert what we thought the value of banana Dialogue: 0,0:55:47.12,0:55:49.10,Default,,0000,0000,0000,,would be when we passed it to integer. You're Dialogue: 0,0:55:49.10,0:55:51.46,Default,,0000,0000,0000,,more than welcome to just close down your\Neditor Dialogue: 0,0:55:51.46,0:55:55.39,Default,,0000,0000,0000,,or bring up IRB in whatever fashion you want Dialogue: 0,0:55:55.39,0:55:58.30,Default,,0000,0000,0000,,to. And, what is banana.to_i? Oh, it's zero.\NThat's Dialogue: 0,0:55:58.30,0:56:00.84,Default,,0000,0000,0000,,weird, but, you know. Whatever. Dialogue: 0,0:56:00.84,0:56:04.69,Default,,0000,0000,0000,,So, like, Kaikay was saying, don't talk, the\Naudience Dialogue: 0,0:56:04.69,0:56:06.50,Default,,0000,0000,0000,,shouldn't, whoever the audience member is,\Nif you have Dialogue: 0,0:56:06.50,0:56:09.63,Default,,0000,0000,0000,,one or two people, don't talk on red. If Dialogue: 0,0:56:09.63,0:56:12.20,Default,,0000,0000,0000,,you're not coding, keep quiet unless you're\Npart of Dialogue: 0,0:56:12.20,0:56:15.24,Default,,0000,0000,0000,,the pair, right. And it's time to switch. Dialogue: 0,0:56:15.24,0:56:16.76,Default,,0000,0000,0000,,If you have an idea, if you have something Dialogue: 0,0:56:16.76,0:56:18.66,Default,,0000,0000,0000,,- I think it should do this or I Dialogue: 0,0:56:18.66,0:56:20.72,Default,,0000,0000,0000,,think it should do that - rather than trying Dialogue: 0,0:56:20.72,0:56:22.36,Default,,0000,0000,0000,,to describe too much of it in English, I Dialogue: 0,0:56:22.36,0:56:24.36,Default,,0000,0000,0000,,mean, it might be helpful to, to talk about Dialogue: 0,0:56:24.36,0:56:26.41,Default,,0000,0000,0000,,it a little bit in English, show your work Dialogue: 0,0:56:26.41,0:56:28.35,Default,,0000,0000,0000,,in code. Show your idea in code. Just write Dialogue: 0,0:56:28.35,0:56:30.69,Default,,0000,0000,0000,,an assert statement that does what you think\Nit Dialogue: 0,0:56:30.69,0:56:32.19,Default,,0000,0000,0000,,needs to do. Ask the code a question. Dialogue: 0,0:56:32.19,0:56:34.03,Default,,0000,0000,0000,,C.S.: And this is not a code golf, right. Dialogue: 0,0:56:34.03,0:56:37.25,Default,,0000,0000,0000,,We're not here to show off, right, some Perl Dialogue: 0,0:56:37.25,0:56:39.82,Default,,0000,0000,0000,,black magic that you inherited from a previous\Njob. Dialogue: 0,0:56:39.82,0:56:42.55,Default,,0000,0000,0000,,So make sure that we're, whatever you write,\Nit's Dialogue: 0,0:56:42.55,0:56:45.16,Default,,0000,0000,0000,,explicit enough so that everyone in your group\Nunderstands, Dialogue: 0,0:56:45.16,0:56:47.06,Default,,0000,0000,0000,,right. So if you need to write a little Dialogue: 0,0:56:47.06,0:56:48.60,Default,,0000,0000,0000,,bit more. If you need to break out do Dialogue: 0,0:56:48.60,0:56:50.79,Default,,0000,0000,0000,,end from a curly brace, do a do end. Dialogue: 0,0:56:50.79,0:56:51.63,Default,,0000,0000,0000,,So do that. Dialogue: 0,0:56:51.63,0:56:54.32,Default,,0000,0000,0000,,D.R.: Right. And, as the audience, this is\Nlike, Dialogue: 0,0:56:54.32,0:56:56.92,Default,,0000,0000,0000,,the one exception to the rule. If you see Dialogue: 0,0:56:56.92,0:57:00.93,Default,,0000,0000,0000,,the pair deviating from red-green-refactor,\Nlike they start writing Dialogue: 0,0:57:00.93,0:57:04.23,Default,,0000,0000,0000,,production code before they write a test,\Nyou get Dialogue: 0,0:57:04.23,0:57:06.99,Default,,0000,0000,0000,,to say, you know, eh, or test, or if Dialogue: 0,0:57:06.99,0:57:09.27,Default,,0000,0000,0000,,you see them sit on, they, they've written\Nsome Dialogue: 0,0:57:09.27,0:57:11.46,Default,,0000,0000,0000,,code and they haven't run the test for awhile, Dialogue: 0,0:57:11.46,0:57:15.50,Default,,0000,0000,0000,,eh. Give them the buzzer. Survey says. And\Nif Dialogue: 0,0:57:15.50,0:57:17.40,Default,,0000,0000,0000,,you see somebody starting to use voodoo where,\Nwhether Dialogue: 0,0:57:17.41,0:57:20.23,Default,,0000,0000,0000,,or not you're part of the pair, or they Dialogue: 0,0:57:20.23,0:57:22.96,Default,,0000,0000,0000,,just write something and you're like, what\Nis that? Dialogue: 0,0:57:22.96,0:57:26.30,Default,,0000,0000,0000,,Raise your hand and say no voodoo, or call Dialogue: 0,0:57:26.30,0:57:29.00,Default,,0000,0000,0000,,voodoo on them. Call molligan. Tell them to\Ndo Dialogue: 0,0:57:29.00,0:57:29.58,Default,,0000,0000,0000,,it over. Dialogue: 0,0:57:29.58,0:57:30.87,Default,,0000,0000,0000,,C.S.: And that should be enough. Dialogue: 0,0:57:30.87,0:57:33.19,Default,,0000,0000,0000,,So you guys are in groups. You've selected\None Dialogue: 0,0:57:33.19,0:57:36.70,Default,,0000,0000,0000,,machine to work off of. And, please delete\Nall Dialogue: 0,0:57:36.70,0:57:38.62,Default,,0000,0000,0000,,the code that you had previously. Just make\Nsure Dialogue: 0,0:57:38.62,0:57:40.64,Default,,0000,0000,0000,,that you start from a blank slate. You're\Nlooking Dialogue: 0,0:57:40.64,0:57:45.72,Default,,0000,0000,0000,,at a blank canvas. Blank text editor. Everyone\Ngood Dialogue: 0,0:57:45.72,0:57:46.53,Default,,0000,0000,0000,,to start? Dialogue: 0,0:57:46.53,0:57:49.05,Default,,0000,0000,0000,,All right. So here's the problem that you're\Ngonna Dialogue: 0,0:57:49.05,0:57:50.09,Default,,0000,0000,0000,,do. Dialogue: 0,0:57:50.09,0:57:55.09,Default,,0000,0000,0000,,Boom. A calculator. It's gonna have one operation,\Nwhich Dialogue: 0,0:57:55.09,0:57:57.49,Default,,0000,0000,0000,,is gonna be addition. It should be able to Dialogue: 0,0:57:57.49,0:58:01.16,Default,,0000,0000,0000,,take a variable number of arguments, but,\Nwe're gonna Dialogue: 0,0:58:01.16,0:58:03.28,Default,,0000,0000,0000,,add in a constraint. You're not allowed to\Nuse Dialogue: 0,0:58:03.28,0:58:06.15,Default,,0000,0000,0000,,inject or, for that matter, reduce. Dialogue: 0,0:58:06.15,0:58:10.98,Default,,0000,0000,0000,,D.R.: This somewhat limits the playing field. Dialogue: 0,0:58:11.02,0:58:13.70,Default,,0000,0000,0000,,C.S.: Right. So that is the plan of action. And if- Dialogue: 0,0:58:13.86,0:58:15.68,Default,,0000,0000,0000,,D.R.: Any questions about the problem? Right? Dialogue: 0,0:58:17.64,0:58:18.14,Default,,0000,0000,0000,,C.S.: Cool? Dialogue: 0,0:58:18.14,0:58:19.88,Default,,0000,0000,0000,,D.R.: Everybody, everybody grasps the gist\Nof it? If Dialogue: 0,0:58:19.88,0:58:21.76,Default,,0000,0000,0000,,you guys get done with this before we get Dialogue: 0,0:58:21.76,0:58:23.90,Default,,0000,0000,0000,,done with the overall Dojo, feel free to do Dialogue: 0,0:58:23.90,0:58:26.60,Default,,0000,0000,0000,,what Kaikay and I did by expanding the problem. Dialogue: 0,0:58:26.60,0:58:28.84,Default,,0000,0000,0000,,What if we gave it strings? Or what if Dialogue: 0,0:58:28.84,0:58:31.88,Default,,0000,0000,0000,,we gave it, you know, bananas. Or what if Dialogue: 0,0:58:31.88,0:58:33.48,Default,,0000,0000,0000,,we threw an object at it? Dialogue: 0,0:58:33.48,0:58:34.20,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:58:34.20,0:58:35.20,Default,,0000,0000,0000,,D.R.: Or whatever, you know. Dialogue: 0,0:58:35.20,0:58:36.48,Default,,0000,0000,0000,,AUDIENCE: Can you clarify inject? Dialogue: 0,0:58:36.48,0:58:40.94,Default,,0000,0000,0000,,D.R.: So, we were gonna use numbers dot inject. Dialogue: 0,0:58:40.94,0:58:42.24,Default,,0000,0000,0000,,We were gonna use array dot inject. Dialogue: 0,0:58:42.24,0:58:45.04,Default,,0000,0000,0000,,But as we pointed out the audience, we can also use Dialogue: 0,0:58:45.04,0:58:46.98,Default,,0000,0000,0000,,array dot reduce, which I'm much more familiar\Nwith Dialogue: 0,0:58:46.98,0:58:50.10,Default,,0000,0000,0000,,since I come from JavaScript. So, don't use\Ninject. Dialogue: 0,0:58:50.10,0:58:53.36,Default,,0000,0000,0000,,Don't use the reduce methods. There is a third Dialogue: 0,0:58:53.36,0:58:58.56,Default,,0000,0000,0000,,option available to you. If you wanted to\Nlook Dialogue: 0,0:58:58.56,0:58:59.51,Default,,0000,0000,0000,,at each- Dialogue: 0,0:58:59.51,0:59:00.72,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,0:59:00.72,0:59:02.54,Default,,0000,0000,0000,,D.R.: Element in- Dialogue: 0,0:59:02.54,0:59:04.97,Default,,0000,0000,0000,,C.S.: -in an array. Dialogue: 0,0:59:04.97,0:59:07.39,Default,,0000,0000,0000,,D.R.: Just. Just saying. Dialogue: 0,0:59:07.39,0:59:11.95,Default,,0000,0000,0000,,C.S.: Cool. And we're gonna use three minute\Nrotation Dialogue: 0,0:59:11.95,0:59:14.99,Default,,0000,0000,0000,,time outs. So let's bring it up here. Dialogue: 0,0:59:14.99,0:59:19.99,Default,,0000,0000,0000,,AUDIENCE: [chatter] Dialogue: 0,0:59:20.70,0:59:21.56,Default,,0000,0000,0000,,C.S.: Oh no. Dialogue: 0,0:59:21.56,0:59:22.38,Default,,0000,0000,0000,,D.R.: Oh, you've got it. You can just stick Dialogue: 0,0:59:22.38,0:59:23.00,Default,,0000,0000,0000,,it over there. Dialogue: 0,0:59:23.00,0:59:27.60,Default,,0000,0000,0000,,C.S.: All right. So, let's do. Simple timer. Dialogue: 0,0:59:27.60,0:59:32.06,Default,,0000,0000,0000,,AUDIENCE: [chatter] Dialogue: 0,0:59:33.76,0:59:36.02,Default,,0000,0000,0000,,D.R.: Pop that on the side window there. The Dialogue: 0,0:59:36.02,0:59:36.56,Default,,0000,0000,0000,,other window. Dialogue: 0,0:59:37.32,0:59:42.58,Default,,0000,0000,0000,,C.S.: Yup. All right. So. So if you need, Dialogue: 0,0:59:43.13,0:59:45.77,Default,,0000,0000,0000,,or. Do we show, like, half of it and Dialogue: 0,0:59:45.77,0:59:46.84,Default,,0000,0000,0000,,half of that? Dialogue: 0,0:59:46.84,0:59:48.64,Default,,0000,0000,0000,,D.R.: Yeah. Yeah. Do the, do the presentation\Nagain. Dialogue: 0,0:59:48.64,0:59:49.14,Default,,0000,0000,0000,,C.S.: This. Dialogue: 0,0:59:49.14,0:59:50.54,Default,,0000,0000,0000,,D.R.: Yeah. Let's do that. Dialogue: 0,0:59:53.12,0:59:54.96,Default,,0000,0000,0000,,C.S.: Well, but how do we show both at Dialogue: 0,0:59:54.96,0:59:55.52,Default,,0000,0000,0000,,the same time? Dialogue: 0,0:59:57.43,0:59:58.29,Default,,0000,0000,0000,,D.R.: Something bizarre. Dialogue: 0,0:59:58.29,0:59:59.11,Default,,0000,0000,0000,,C.S.: It's called moom. Dialogue: 0,0:59:59.11,0:59:59.71,Default,,0000,0000,0000,,AUDIENCE: Moom. Dialogue: 0,0:59:59.72,1:00:00.54,Default,,0000,0000,0000,,C.S.: Yeah. Dialogue: 0,1:00:00.54,1:00:01.28,Default,,0000,0000,0000,,AUDIENCE: Thank you. Dialogue: 0,1:00:01.68,1:00:04.06,Default,,0000,0000,0000,,D.R.: I use optimal layout, because it's basically\Nthe Dialogue: 0,1:00:04.06,1:00:05.18,Default,,0000,0000,0000,,same thing. Dialogue: 0,1:00:05.50,1:00:08.24,Default,,0000,0000,0000,,C.S.: So if you need a start, your initial Dialogue: 0,1:00:08.25,1:00:11.06,Default,,0000,0000,0000,,code, kind of a cheat sheet. This is what Dialogue: 0,1:00:11.06,1:00:13.89,Default,,0000,0000,0000,,we used to start. So requiring minitest up\Nat Dialogue: 0,1:00:13.89,1:00:18.01,Default,,0000,0000,0000,,the top. Starting off with your test gaze.\NAnd Dialogue: 0,1:00:18.01,1:00:19.71,Default,,0000,0000,0000,,then writing the first test. If you want to Dialogue: 0,1:00:19.71,1:00:22.03,Default,,0000,0000,0000,,set up like the auto run thing, is down Dialogue: 0,1:00:22.03,1:00:24.79,Default,,0000,0000,0000,,here at the bottom. Dialogue: 0,1:00:24.79,1:00:29.25,Default,,0000,0000,0000,,Remember. Ping pong. Write a failing test.\NPass it Dialogue: 0,1:00:29.25,1:00:30.84,Default,,0000,0000,0000,,along to your co-pilot. Dialogue: 0,1:00:30.84,1:00:36.79,Default,,0000,0000,0000,,D.R.: So then to do the timer, put the Dialogue: 0,1:00:36.79,1:00:40.76,Default,,0000,0000,0000,,timer up on the right screen. Dialogue: 0,1:00:40.76,1:00:44.73,Default,,0000,0000,0000,,C.S.: Full size? Close that down. Dialogue: 0,1:00:44.73,1:00:50.68,Default,,0000,0000,0000,,D.R.: You actually have to reduce the size\Nof Dialogue: 0,1:00:50.68,1:00:52.00,Default,,0000,0000,0000,,the font. Dialogue: 0,1:00:52.00,1:00:53.32,Default,,0000,0000,0000,,C.S.: Yeah. Dialogue: 0,1:00:53.32,1:00:54.65,Default,,0000,0000,0000,,D.R.: Awesome. Dialogue: 0,1:00:54.65,1:00:56.77,Default,,0000,0000,0000,,C.S.: All right. Dialogue: 0,1:00:56.77,1:01:00.15,Default,,0000,0000,0000,,D.R.: So we're gonna give you three minutes\Nto Dialogue: 0,1:01:00.15,1:01:02.61,Default,,0000,0000,0000,,go as a pair. Oh. We'll give you three Dialogue: 0,1:01:02.61,1:01:05.65,Default,,0000,0000,0000,,minutes as a pair, right. As the current pair. Dialogue: 0,1:01:05.65,1:01:07.52,Default,,0000,0000,0000,,And then when the timer goes off, switch.\NAnd Dialogue: 0,1:01:07.52,1:01:09.53,Default,,0000,0000,0000,,we'll do the same thing, and after that, we'll Dialogue: 0,1:01:09.53,1:01:12.94,Default,,0000,0000,0000,,take, we'll do a little half time. Dialogue: 0,1:01:12.94,1:01:16.41,Default,,0000,0000,0000,,AUDIENCE: [chatter] Dialogue: 0,1:01:16.41,1:01:23.41,Default,,0000,0000,0000,,C.S.: All right. Let's stop for here. So,\Nstop Dialogue: 0,1:01:23.98,1:01:27.36,Default,,0000,0000,0000,,exactly where you are. All right. And now,\Nit's Dialogue: 0,1:01:27.36,1:01:29.89,Default,,0000,0000,0000,,time for us to do a little retrospective on Dialogue: 0,1:01:29.89,1:01:33.64,Default,,0000,0000,0000,,what we just did. On this round, right. So, Dialogue: 0,1:01:33.64,1:01:36.49,Default,,0000,0000,0000,,do we have enough pens here? Dialogue: 0,1:01:36.49,1:01:38.62,Default,,0000,0000,0000,,D.R.: We might. Dialogue: 0,1:01:38.62,1:01:40.96,Default,,0000,0000,0000,,C.S.: We at least have enough- Dialogue: 0,1:01:40.96,1:01:43.12,Default,,0000,0000,0000,,D.R.: Near enough. Enough pens per group. Dialogue: 0,1:01:43.12,1:01:46.58,Default,,0000,0000,0000,,So, just like an Agile retrospective, we're\Ngonna ask Dialogue: 0,1:01:46.58,1:01:49.98,Default,,0000,0000,0000,,each other just three question. What did we\Ndo Dialogue: 0,1:01:49.98,1:01:51.91,Default,,0000,0000,0000,,well, that we would like to do the next Dialogue: 0,1:01:51.91,1:01:54.40,Default,,0000,0000,0000,,time we do this exercise? What would we like Dialogue: 0,1:01:54.40,1:01:57.42,Default,,0000,0000,0000,,to improve for the next time? So what did Dialogue: 0,1:01:57.42,1:01:59.11,Default,,0000,0000,0000,,we do well that we want to repeat? What Dialogue: 0,1:01:59.11,1:02:00.62,Default,,0000,0000,0000,,did we do maybe not so well, maybe we'd Dialogue: 0,1:02:00.62,1:02:02.97,Default,,0000,0000,0000,,like, maybe we'd like to improve for next\Ntime. Dialogue: 0,1:02:02.97,1:02:04.47,Default,,0000,0000,0000,,And did we meet our goals and why? And, Dialogue: 0,1:02:04.47,1:02:06.77,Default,,0000,0000,0000,,again, our stated goals are not, did we solve Dialogue: 0,1:02:06.77,1:02:07.73,Default,,0000,0000,0000,,the problem? Dialogue: 0,1:02:07.73,1:02:10.03,Default,,0000,0000,0000,,That really wasn't ever an issue. That wasn't\Nreally Dialogue: 0,1:02:10.03,1:02:13.60,Default,,0000,0000,0000,,any, I mean we, we can continue inventing\Ndifferent Dialogue: 0,1:02:13.60,1:02:16.05,Default,,0000,0000,0000,,edge-cases to test this problem against. We\Ncan continue Dialogue: 0,1:02:16.05,1:02:19.54,Default,,0000,0000,0000,,asking questions of this problem. Even this\Nsimple problem, Dialogue: 0,1:02:19.54,1:02:21.60,Default,,0000,0000,0000,,for a very long time. So it's never really Dialogue: 0,1:02:21.60,1:02:23.70,Default,,0000,0000,0000,,about, did we solve the problem? No, the world Dialogue: 0,1:02:23.70,1:02:27.21,Default,,0000,0000,0000,,does not need another adder. Dialogue: 0,1:02:27.21,1:02:29.67,Default,,0000,0000,0000,,And most of the problems that we pick are Dialogue: 0,1:02:29.67,1:02:33.43,Default,,0000,0000,0000,,gonna be like that. But did we learn something? Dialogue: 0,1:02:33.43,1:02:36.12,Default,,0000,0000,0000,,Did we find out something new about Ruby or Dialogue: 0,1:02:36.12,1:02:38.42,Default,,0000,0000,0000,,about the people that we work with? Did we Dialogue: 0,1:02:38.42,1:02:40.82,Default,,0000,0000,0000,,practice our skills? Do we feel like we have Dialogue: 0,1:02:40.82,1:02:43.75,Default,,0000,0000,0000,,gained some skill or knowledge because of\Nthis exercise? Dialogue: 0,1:02:43.75,1:02:46.25,Default,,0000,0000,0000,,And did we have fun? Dialogue: 0,1:02:46.25,1:02:48.94,Default,,0000,0000,0000,,So. We can just, we can start with the. Dialogue: 0,1:02:48.94,1:02:51.68,Default,,0000,0000,0000,,Just give you guys another three minutes to\Nfigure Dialogue: 0,1:02:51.68,1:02:51.92,Default,,0000,0000,0000,,out- Dialogue: 0,1:02:51.92,1:02:52.41,Default,,0000,0000,0000,,C.S.: Yeah. Dialogue: 0,1:02:52.41,1:02:55.10,Default,,0000,0000,0000,,D.R.: Just ask yours- each other those three\Nquestions. Dialogue: 0,1:02:55.10,1:02:56.45,Default,,0000,0000,0000,,Did we, what did we do well that we Dialogue: 0,1:02:56.45,1:02:58.48,Default,,0000,0000,0000,,want to do for the next one? What did Dialogue: 0,1:02:58.48,1:03:00.33,Default,,0000,0000,0000,,we do maybe not so well that we would Dialogue: 0,1:03:00.33,1:03:03.00,Default,,0000,0000,0000,,like to improve for the next one? And did Dialogue: 0,1:03:03.00,1:03:05.22,Default,,0000,0000,0000,,we meet our goals, and why or why not? Dialogue: 0,1:03:05.22,1:03:07.67,Default,,0000,0000,0000,,We'll give you guys another timer for that. Dialogue: 0,1:03:07.67,1:03:14.67,Default,,0000,0000,0000,,C.S.: Just write it down on the post-it note Dialogue: 0,1:03:15.92,1:03:17.32,Default,,0000,0000,0000,,we gave you, and then we can. Dialogue: 0,1:03:17.32,1:03:17.72,Default,,0000,0000,0000,,AUDIENCE: [chatter] Dialogue: 0,1:03:17.72,1:03:21.16,Default,,0000,0000,0000,,C.S.: All right. Cool. Stop exactly where\Nyou are. Dialogue: 0,1:03:21.16,1:03:25.45,Default,,0000,0000,0000,,Go back to your editor. Delete everything.\NAnd get Dialogue: 0,1:03:25.45,1:03:29.90,Default,,0000,0000,0000,,ready for the next problem. Again, same group.\NSame Dialogue: 0,1:03:29.90,1:03:32.33,Default,,0000,0000,0000,,three minute rotation. But now we're gonna\Ndo a Dialogue: 0,1:03:32.33,1:03:34.11,Default,,0000,0000,0000,,different problem, right. Dialogue: 0,1:03:34.11,1:03:37.45,Default,,0000,0000,0000,,Still on the calculator realm. Still gonna\Nbe in Dialogue: 0,1:03:37.45,1:03:41.21,Default,,0000,0000,0000,,addition. But now your calc- your new calculator,\Nthat Dialogue: 0,1:03:41.21,1:03:43.03,Default,,0000,0000,0000,,you're gonna start from scratch, is gonna\Nneed to Dialogue: 0,1:03:43.03,1:03:48.24,Default,,0000,0000,0000,,take strings as arguments. As an example,\Nyou're gonna Dialogue: 0,1:03:48.24,1:03:52.22,Default,,0000,0000,0000,,add one as a string, slash two, and it's Dialogue: 0,1:03:52.22,1:03:56.51,Default,,0000,0000,0000,,gonna need to return the integer three. Dialogue: 0,1:03:56.51,1:03:59.19,Default,,0000,0000,0000,,AUDIENCE: The integer or the string? Dialogue: 0,1:03:59.19,1:03:59.22,Default,,0000,0000,0000,,D.R.: The integer. Dialogue: 0,1:03:59.22,1:04:00.04,Default,,0000,0000,0000,,C.S.: The integer. To make it- Dialogue: 0,1:04:00.04,1:04:04.14,Default,,0000,0000,0000,,D.R.: Stop wherever you want to stop. Dialogue: 0,1:04:04.14,1:04:09.41,Default,,0000,0000,0000,,I, I believe there was an earlier presentation\Non Dialogue: 0,1:04:09.41,1:04:10.58,Default,,0000,0000,0000,,just enough. Dialogue: 0,1:04:10.58,1:04:11.75,Default,,0000,0000,0000,,AUDIENCE: [chatter] Dialogue: 0,1:04:11.75,1:04:12.93,Default,,0000,0000,0000,,C.S.: Cool. Dialogue: 0,1:04:12.93,1:04:17.47,Default,,0000,0000,0000,,D.R.: And you can choose to you, you can Dialogue: 0,1:04:17.47,1:04:20.67,Default,,0000,0000,0000,,choose that last constraint that we offered.\NThe don't Dialogue: 0,1:04:20.67,1:04:24.39,Default,,0000,0000,0000,,use inject. You can, and, take it or leave Dialogue: 0,1:04:24.39,1:04:27.77,Default,,0000,0000,0000,,it, right. Doing the calc add with strings\Nmight Dialogue: 0,1:04:27.77,1:04:28.35,Default,,0000,0000,0000,,be- Dialogue: 0,1:04:28.35,1:04:30.51,Default,,0000,0000,0000,,C.S.: More than a big problem to solve. Dialogue: 0,1:04:30.51,1:04:32.76,Default,,0000,0000,0000,,D.R.: Right. So, if you want to use inject Dialogue: 0,1:04:32.76,1:04:33.57,Default,,0000,0000,0000,,or reduce or yo mama, whatever. It doesn't\Nmatter. Dialogue: 0,1:04:33.57,1:04:34.45,Default,,0000,0000,0000,,The only, the only requirement we will have\Nis, Dialogue: 0,1:04:34.45,1:04:35.33,Default,,0000,0000,0000,,you have to take, you have to accept strings, Dialogue: 0,1:04:35.33,1:04:36.20,Default,,0000,0000,0000,,like, one, two, three, four, in, in words,\Nt-h, Dialogue: 0,1:04:36.20,1:04:38.84,Default,,0000,0000,0000,,you know, r-e-e. You go up to ten. You Dialogue: 0,1:04:38.84,1:04:42.30,Default,,0000,0000,0000,,go up to one-hundred. I don't care. How far Dialogue: 0,1:04:42.30,1:04:49.11,Default,,0000,0000,0000,,you want to go. Cause you, there may be Dialogue: 0,1:04:49.11,1:04:52.07,Default,,0000,0000,0000,,some typing involved. Dialogue: 0,1:04:52.07,1:04:54.05,Default,,0000,0000,0000,,C.S.: Right. Dialogue: 0,1:04:54.05,1:05:00.10,Default,,0000,0000,0000,,AUDIENCE: You still want it to return an integer Dialogue: 0,1:05:00.10,1:05:01.66,Default,,0000,0000,0000,,or a string? Dialogue: 0,1:05:01.66,1:05:03.03,Default,,0000,0000,0000,,D.R.: It should return an integer. Dialogue: 0,1:05:03.03,1:05:03.74,Default,,0000,0000,0000,,AUDIENCE: [indecipherable] - or should you\Nforget integers? Dialogue: 0,1:05:03.74,1:05:06.10,Default,,0000,0000,0000,,C.S.: Forget. Array delete what you had, and\Nthen Dialogue: 0,1:05:06.10,1:05:10.17,Default,,0000,0000,0000,,start from scratch, right. Dialogue: 0,1:05:10.17,1:05:17.17,Default,,0000,0000,0000,,D.R.: And really, start from scratch. Even\Nback to Dialogue: 0,1:05:24.53,1:05:25.17,Default,,0000,0000,0000,,the boiler plate that we gave you guys. Dialogue: 0,1:05:25.17,1:05:25.36,Default,,0000,0000,0000,,AUDIENCE: [chatter] Dialogue: 0,1:05:25.36,1:05:25.92,Default,,0000,0000,0000,,C.S.: All right everybody. Pencils down. Dialogue: 0,1:05:25.92,1:05:26.29,Default,,0000,0000,0000,,D.R.: No more coding. Dialogue: 0,1:05:26.29,1:05:29.44,Default,,0000,0000,0000,,C.S.: And just like we did before. Quick retrospective. Dialogue: 0,1:05:29.44,1:05:32.12,Default,,0000,0000,0000,,Write down things that worked well for this\Nround. Dialogue: 0,1:05:32.12,1:05:39.12,Default,,0000,0000,0000,,Things that could have been better and need\Nimprovement Dialogue: 0,1:05:39.65,1:05:40.00,Default,,0000,0000,0000,,for upcoming rounds. Dialogue: 0,1:05:40.00,1:05:41.81,Default,,0000,0000,0000,,D.R.: And also as a process, as a whole. Dialogue: 0,1:05:41.81,1:05:45.09,Default,,0000,0000,0000,,Like, what did you guys like about the whole Dialogue: 0,1:05:45.09,1:05:47.99,Default,,0000,0000,0000,,process? What did you guys, what would you\Nguys Dialogue: 0,1:05:47.99,1:05:50.00,Default,,0000,0000,0000,,improve about this workshop if you were to\Ngo Dialogue: 0,1:05:50.00,1:05:52.67,Default,,0000,0000,0000,,to it again? And did you- did we meet Dialogue: 0,1:05:52.67,1:05:55.54,Default,,0000,0000,0000,,our goals, and why or why not? So we'll Dialogue: 0,1:05:55.54,1:05:56.92,Default,,0000,0000,0000,,give you a couple minutes to do that real Dialogue: 0,1:05:56.92,1:05:59.81,Default,,0000,0000,0000,,quick as a group. No more coding. I will Dialogue: 0,1:05:59.81,1:06:01.93,Default,,0000,0000,0000,,come by and delete your files. Dialogue: 0,1:06:01.93,1:06:06.20,Default,,0000,0000,0000,,So, did we learn something? Everybody learn\Nsomething? Feel Dialogue: 0,1:06:06.20,1:06:10.34,Default,,0000,0000,0000,,like you pulled something your way? Did we\Npractice? Dialogue: 0,1:06:10.34,1:06:14.45,Default,,0000,0000,0000,,Do you feel like you've practiced some? Did\Nwe Dialogue: 0,1:06:14.45,1:06:19.30,Default,,0000,0000,0000,,solve the problem? Some? Solved some of the\Nproblem, Dialogue: 0,1:06:19.30,1:06:22.52,Default,,0000,0000,0000,,right. Ish. Solved-ish the problem. Dialogue: 0,1:06:22.52,1:06:23.61,Default,,0000,0000,0000,,Did we have fun? Dialogue: 0,1:06:23.61,1:06:24.69,Default,,0000,0000,0000,,AUDIENCE: Yeah. Yes. Yeah. Dialogue: 0,1:06:24.69,1:06:25.23,Default,,0000,0000,0000,,D.R.: Awesome. Dialogue: 0,1:06:25.23,1:06:25.77,Default,,0000,0000,0000,,C.S.: Cool. Dialogue: 0,1:06:25.77,1:06:27.72,Default,,0000,0000,0000,,D.R.: So, if you want to know more about Dialogue: 0,1:06:27.72,1:06:31.67,Default,,0000,0000,0000,,the Coding Dojo, this is Kaikay's new favorite\Nbook. Dialogue: 0,1:06:31.67,1:06:35.63,Default,,0000,0000,0000,,Coding Dojo Handbook. I'm totally picking\Nup a copy. Dialogue: 0,1:06:35.63,1:06:37.63,Default,,0000,0000,0000,,There's way more resources out there. There\Nare local Dialogue: 0,1:06:37.63,1:06:39.31,Default,,0000,0000,0000,,meet up groups. You should take this to your Dialogue: 0,1:06:39.31,1:06:42.33,Default,,0000,0000,0000,,user group. We started a whole group around\NCoding Dialogue: 0,1:06:42.33,1:06:45.78,Default,,0000,0000,0000,,Dojo in, in Orlando. But we also, because\NI Dialogue: 0,1:06:45.78,1:06:47.73,Default,,0000,0000,0000,,ran the PHP group and I ran the Python Dialogue: 0,1:06:47.73,1:06:49.05,Default,,0000,0000,0000,,group at the time, we also used it for Dialogue: 0,1:06:49.05,1:06:51.55,Default,,0000,0000,0000,,the Python group and the PHP group. We'll\Nprobably Dialogue: 0,1:06:51.55,1:06:54.16,Default,,0000,0000,0000,,do it again at node. We've done it at Dialogue: 0,1:06:54.16,1:06:57.58,Default,,0000,0000,0000,,Ruby. We've done it all the user groups around. Dialogue: 0,1:06:57.58,1:06:58.58,Default,,0000,0000,0000,,If you want to know, if you want to Dialogue: 0,1:06:58.58,1:07:00.54,Default,,0000,0000,0000,,get some starting points for that, I wrote\Na Dialogue: 0,1:07:00.54,1:07:03.72,Default,,0000,0000,0000,,blog post on getting start, getting past all\Nthe Dialogue: 0,1:07:03.72,1:07:06.87,Default,,0000,0000,0000,,Yak shaving of setting up the automated tests\Nrunning Dialogue: 0,1:07:06.87,1:07:09.13,Default,,0000,0000,0000,,in the background and the boilerplate for\Neach one Dialogue: 0,1:07:09.13,1:07:11.15,Default,,0000,0000,0000,,of the, for each one of the different languages Dialogue: 0,1:07:11.15,1:07:12.10,Default,,0000,0000,0000,,you want to try. Dialogue: 0,1:07:12.10,1:07:14.63,Default,,0000,0000,0000,,That's in the Orlando Dojo reporepo on, on\NGitHub. Dialogue: 0,1:07:14.63,1:07:17.37,Default,,0000,0000,0000,,It's, or the Orlando Dojo organization. Dialogue: 0,1:07:17.37,1:07:22.09,Default,,0000,0000,0000,,C.S.: Talking about meet ups. The best way\Nto Dialogue: 0,1:07:22.09,1:07:25.27,Default,,0000,0000,0000,,actually experience more of this is to do\Nit Dialogue: 0,1:07:25.27,1:07:29.34,Default,,0000,0000,0000,,in practice, right. So. So go ahead to meet Dialogue: 0,1:07:29.34,1:07:31.97,Default,,0000,0000,0000,,up dot com and look for nearby Coding Dojo Dialogue: 0,1:07:31.97,1:07:36.40,Default,,0000,0000,0000,,meet ups. There's plenty of them out there,\Nand Dialogue: 0,1:07:36.40,1:07:39.12,Default,,0000,0000,0000,,if you don't find one, more than welcome to Dialogue: 0,1:07:39.12,1:07:41.99,Default,,0000,0000,0000,,create one yourself. All you need is a friend Dialogue: 0,1:07:41.99,1:07:45.32,Default,,0000,0000,0000,,who you can pair with every week or so, Dialogue: 0,1:07:45.32,1:07:47.11,Default,,0000,0000,0000,,and then, if you just put it out there, Dialogue: 0,1:07:47.11,1:07:50.35,Default,,0000,0000,0000,,put it online that you guys are meeting every Dialogue: 0,1:07:50.35,1:07:52.92,Default,,0000,0000,0000,,week at this specific place at this specific\Ntime, Dialogue: 0,1:07:52.92,1:07:54.36,Default,,0000,0000,0000,,people will show up. Believe me. Dialogue: 0,1:07:54.36,1:07:56.13,Default,,0000,0000,0000,,D.R.: Right. Just be consistent. Dialogue: 0,1:07:56.13,1:07:59.50,Default,,0000,0000,0000,,C.S.: Yeah. Just be consistent. And, I think\Nthat's Dialogue: 0,1:07:59.50,1:08:01.48,Default,,0000,0000,0000,,it for today. If you guys want to talk Dialogue: 0,1:08:01.48,1:08:02.88,Default,,0000,0000,0000,,more about this and that-