102: Eve and Alex on Learning React
Featuring
- Eve Porcello — Twitter, GitHub, Website
- Alex Banks — Twitter, GitHub, Website
- chantastic — Twitter, GitHub, Website
Links
- Learning React, 2nd Edition
- Moon Highway - professional web development trainings
- 30 Day Free Trial for O’Reilly
- GraphQL is for Everyone monthly webinars
Sponsors
Infinite Red
In over your head with a React or React Native app? Infinite Red can help. They're React Native core contributors who've been designing, building and shipping apps for over 10 years. reactpodcast.infinite.red
TestCafe
TestCafe is a free, open-source Node.js tool for end-to-end web testing in JavaScript or TypeScript, with no WebDriver required. testcafe.io
Transcript
[00:00:00] Michael Chan: This is React Podcast. I'm Chantastic. Yves Boursello and Alex Banks stop in to drop learning React knowledge for noob, novice, and knowledgeable React developers alike. We talk about how learning React has changed over the years, the patterns and practices that have stood the test of time, and why streaming is still the next big thing. First, thanks to Infinite Red and TestCafe for making this episode happen. Having access to developers that know React inside and out and know the direction the library is headed can take your development and team dynamics to new heights. If you don't have that, you should find it. And I recommend Infinite Red. Infinite Red has been designing, building, and shipping apps for 10 years, and they want to bring that expertise to your apps, products, and services. Infinite Red has a sweet deal right now where you get $750 for referring a new project. Get expert help from Infinite Red by visiting reactpodcast.infinite.red. End-to-end testing doesn't have to be painful and expensive. In fact, the harder it is, the less you'll do it, and the more your customers will suffer. The good news is that end-to-end testing can be quick and painless with TestCafe. TestCafe gives you everything you need to gain the confidence that your web app works as expected for every user on every deploy. Free, open source, and simple to set up, TestCafe allows you to write tests in JavaScript or TypeScript and run them across all major browsers: Chrome, Firefox, Opera, Safari, and Microsoft Edge. Setup is actually an area where where most end-to-end testing tools struggle. It can be a real hassle to wrangle all the browser drivers needed. TestCafe doesn't require a WebDriver or any additional software. After a short install, you're ready to test. TestCafe is free, open source, so it costs you nothing to try. Install it today by visiting testcafe.io and enjoy testing. Eve and Alex, welcome to React Podcast.
[00:02:21] Eve Porcello: Thanks for having us. Hey, we're excited to be
[00:02:23] Michael Chan: here. It's so good to have you. You know, I I have— I don't think I've ever had like an actual couple on this show. Like we've had people who work together, um maybe don't even like each other, but And maybe you fit both of those categories, but-
[00:02:37] Eve Porcello: Depends on the day.
[00:02:39] Michael Chan: I'm really excited to have you both on and to get both of your perspective on uh the amazing work that you've been doing. Um the big thing we want to talk about today is the uh the second version of your book, Learning React. And uh before we start, for anyone who's not familiar with the book, uh could you just give us a high-level overview of kind of what the book covers, who it's targeted for, and um what they can expect to learn from it?
[00:03:06] Eve Porcello: Yeah, I think so. Version 1 of Learning React, it's an O'Reilly book that came out in 2017. And hot off the presses about a week ago or so, we have version 2. So this is a basically a book for anybody who has either never touched React before or who um might have learned it a while back and wants to learn everything new in React. There's a lot of change that's happened in React itself and the ecosystem. So It felt like it was time to upgrade things and time to really um put everything in one place as far as how to get started as a React developer in 2020.
[00:03:48] Michael Chan: Awesome. Now, does it- I I I'm wondering, like, I I have never produced something that like actually lives on a shelf or like lives in a physical space, right? And so I'm kind of curious, like, as the as the years and months kind of like went on, did you get a lot of like external pressure from the people who were buying your book to be like, hey, like What's the story with with all this stuff? 'Cause it seems like maybe like these things are deprecated or like different or like what's what's going on?
[00:04:15] Alex Banks: Yeah, writing this stuff down on paper and printing it, it's yeah, it's not the smartest thing. Like there's a reason that you haven't done it. Um, you know, like we we write to that. We've actually gotten a little bit better about that because there's some stuff that's so foundational and so core that it doesn't matter. So we always tell people to like read it anyways, but I know what it's like to like want to follow along with exact Yeah. And you type npm install or start and the screen looks slightly different. Um, you know, so sometimes if you have the old copy, there's still a lot of great stuff in there and you can sort of push through with that, but you have to be a little bit more creative. But most all of our stuff usually still works. Um, the older versions. And we also update it. So we update stuff to print, like if something really big happened, uh, we will do that. But we try to keep the stuff as universal as possible.
[00:05:04] Michael Chan: Oh, wow. Wow.
[00:05:05] Alex Banks: That's awesome. Yeah.
[00:05:06] Michael Chan: Yeah. Well, I want to talk, I want to talk about kind of what some of those things were that like stood the test of time. Um, but I think before we go into that, like, let's, I want to push into like, like what it's like writing a book. Cause, cause I know there's a lot of work behind the scenes and, and I've not done it. And, um, I know that now that you have, now you have the kind of the the wisdom of, you know, writing the book, but then also writing a second book around the same stuff. Um, so what is it, what are some of the things that surprised you about the process of writing and also rewriting?
[00:05:40] Alex Banks: The first thing that surprised me is that they let us write a book because like the whole, the whole thing sort of came from like just sort of putting it out there. It was like, we wanna write a book. You know, like I read a lot of tech books, just like life goal, I wanna write a book one day. And then, you know, like the opportunities started to present themselves, this path of being able to write a book started to unfold. And then all of a sudden we were writing a book. And we were like, we had no, like no one vetted us on the fact that we've never really written that much stuff down before since college. And it was a long time ago for me. So it was, yeah, it was a learning experience. And we definitely took a lot longer with the first one because of that. But what we decided to do was like, we teach classes all the time in the classroom. So we're just like, just write down what you say. So if like the class starts at 9 in the morning, we skip the whole introduce yourself part. You know, but whatever the first thing we say, so we just kind of pick picture ourselves in the classroom teaching and we write like that. And then like everything happened. And then it was like, well, we teach all the time, so we have so many materials. Once you found that voice, it was really easy to write.
[00:06:45] Michael Chan: Awesome. Awesome. Now, what was what was it like kind of going from no book writing experience to now like working with a publisher, working with an editor? I mean, obviously O'Reilly, you know, is is a very popular, you know, book publishing company. So, uh You know, if you had to come up to speed pretty quickly, um, what did that what did that feel like as you were going through the first time?
[00:07:08] Eve Porcello: Yeah, I feel like we had no clue what we were doing the first time around at all. The tools that we were using to uh put the book together have come a long way from version 1 to today also. So we were able to use GitHub for this latest edition. We were able to have Markdown documents that had all of the code and it was nicely formatted and prettier. Showed up on the scene to hook us up with some code formatting, which didn't exist in the first one. This was only, I guess, 3 years ago, but it really feels like, I don't know, we we were we were out there just building a book with like hammer and nails, like trying to chip away at something. But I feel like, yeah, the tooling around putting together a book has changed a lot uh for O'Reilly authors in the last 3 years. So-
[00:07:59] Michael Chan: Nice.
[00:08:00] Eve Porcello: We were able to kind of really move a lot more quickly with that stuff in the most recent edition.
[00:08:06] Michael Chan: I have heard that that's one of the most frustrating things about writing a book, like kind of over the last, you know, in the same time span that you've been writing, is is that, you know, we write a lot of prose by virtue of like blogging or READMEs or, you know, educational material, whatever. And we're so accustomed to Markdown and all of the tools that exist, it just felt so antiquated and like, like, I just want to give you the raw text and then you figure it out type of thing, right? Like, I don't want to have to deal with all this nonsense.
[00:08:35] Eve Porcello: Yeah, it was essentially just like a content management system, a WYSIWYG, if you will, for like putting together a book. And it was like every day I would make some mistake that would get into a conflict and the formatting was all wrong. And I was like, this is never really gonna be a book, I don't think, at this point, because it's gonna take forever to get it straight.
[00:08:56] Alex Banks: It was our fault because we didn't know what we were doing. Oh yeah. And they have, so they have this like writing WYSIWYG tool and you're literally like editing source code, like editing HTML source in a text area, you know, and we put up with that for way longer than we should have. And then we figured out like, yeah, you can use AsciiDoc, but you can also just use Markdown. And like, you know, so that was like, we we incorporated that the second time around, the second time we got to write a book. So.
[00:09:21] Michael Chan: Sometimes it can be really hard to do a book with multiple authors. Uh, so how do you manage that in, in your in in learning React? Because sometimes it's kind of hard to like have like a shifting voice. Like, what does that look like as far as the content in the book?
[00:09:36] Alex Banks: We do everything together, like everything together. So it's like, it's always kind of our voice, you know? So it's easy to keep it like that one voice. I don't think it's like, you know, back and forth. We read each other's writing, we correct we correct each other's writing. So like Eve will rewrite paragraphs that I have and I'll do so. So it kind of keeps it You know, the similar flow. I wonder though if people could pick out where we do have different voices, because I could definitely pick out like your style of jokes in the book, Eve. Like immediately, it's like, I know you wrote that. Because sometimes we'll- sometimes we'll write stuff and then we'll try to act like, oh, we we couldn't have written that. We weren't the ones who wrote that, you know, but then there's a telltale joke or something in there to make it seem like- to identify the writer. So I do wonder about that. But most of our stuff, if you really- it kind of sounds the same anyways, because we're both kind of on, you know, at least the overall connectivity of the message and the process of like setting up a code example and then explaining it, you know.
[00:10:34] Michael Chan: Yeah, I love that. I love that. So tell me a little bit about what has changed. Obviously a lot has changed in React over the last, uh, I guess, 3 years, and you were probably writing it for about a year before it came out. What are some of the things- you know, you mentioned there's a lot of principles that haven't changed, but what are some of the things that have changed that really kind of changed the, I guess, structure of the book, changed the direction of the book, like how you actually write the code that you're working through?
[00:11:01] Eve Porcello: I would say hooks played a pretty big part in changing things up. So, as soon as hooks were announced, people started sending us messages like, are there hooks in this book? And we were like, no, there aren't. But uh, but we eventually saw that that was going to change really a lot about React. So, um, we went through the book and updated everything to the new syntax, and we really kind of dig deep on how you use functions to uh represent your user interface. Um, what's similar though is the functional programming techniques that are really part of um React's kind of core design. So that's been really fun to see how- there's a chapter on functional programming, and I'll call Alex wrote that chapter top to bottom, and it's one of the things that I think is really awesome about the book. Um, and it didn't change at all. It's all about like, what are- what in JavaScript can we use to um really write awesome React code before we even learn anything about React? So a lot of things like immutability and data structures and data transformation and asynchronous JavaScript and things that you're gonna run into pretty immediately. When you start to work on a React project. Um, all of that stuff gets introduced kind of first before we jump into all of that new stuff.
[00:12:33] Alex Banks: Yeah, I think one of the biggest changes is people know React. When we wrote the first version, people were like, what is this? Like, um, so what we did when we wrote the book was we wanted to have one place that you could learn everything you needed to do to get started on the job as a React developer. So that means like we were thinking about the people who are new to code and might want to start applying for React jobs. But we were also thinking about those people who applied for the React job already, you know, and might be on the plane to the new place, like, what's React, you know? And from teaching and from teaching a lot of Java developers over the years, we know that everybody says they know JavaScript. Right. It's like, yeah, I know JavaScript. So we're like, okay, so the first thing a React developer needs is really a solid foundation in new JavaScript, a solid foundation in ES6 and what functions are, um, and like the functional programming techniques. But then we show you how to trans- translate everything, like how to go from a hash to an array or an array to a hash or an organized array to hash, doing all of these. And once, like, if you're a programmer and you were like, yeah, I know React, I know JavaScript, you've done those things in other languages, so they ring true. If you're new to it, you're- it's explained for the first time. So you don't- maybe you don't necessarily know about prototypical JavaScript, but we're teaching you the functional- the functions and stuff that you need to know to be able to do the book. So it starts off as that. And then the rest of it is just like everything you need to know from found- from the foundation, because we really believe in this. This is really- this has been what I think has helped our teaching career more than anything, is true expertise is actually found in the fundamentals. It's not found in all the other stuff. Like if you- we think about this in other sports, like if you think about skiers, right? Like, sure, they could go do the backflip and hit the halfpipe. But watch them ski in and out of that. They're perfect. It's flawless. Yeah. If you think about chefs, like, sure, you can go grab every ingredient and mix it in a pot and it's good. But if you go to like the Cordon Bleu or you get a real chef, they just have chicken, leeks, and potatoes, and they make those flavors come out. Their techniques and their fundamentals are so flawless that it gives you the foundation to go for all the other harder stuff and also to know why you're doing it. So I think a lot of training is really focused on Oh, we want to show all the harder stuff. And we've been focused on, we want you guys to execute the fundamentals perfectly. You know, we're like, like, we're like some sort of coach that like wants everything to be completely flawless before you move on to server-side rendering or something like that. And and that's that's where our focus in this really comes from. But that also helps you if you're on your way to your first React job. Totally. And you're a little nervous about what you have to do. Because maybe like when you get to that job, maybe everybody is you know, they they don't expect you to necessarily know all of the complex stuff. But if you get to that first React job and you can't like add components or use state proficiently, everybody's gonna be like, wait a minute, who hired this person? You know, so it's like really focus on that stuff because that will get you through, you know?
[00:15:30] Michael Chan: Yeah, oh, absolutely. It's it's interesting. I actually just did an interview with um with Egghead. They were kind of like just trying to figure out like the state of the industry and and whatnot. And I don't think it's published anywhere, but um they asked like, you know, what does it take to be like a really great React developer? And I was like, it just takes the same stuff that it takes to be like a really great developer, right? Like if if you know what, you know, delegation looks like and dependency injection and like functional patterns, like you just apply them to your React code, right? And like you you see that like, uh what is it like render props and like higher-order components, they're not special Reacty things. They're just like you taking your functional programming and applying it to the component model.
[00:16:11] Alex Banks: Yeah.
[00:16:12] Michael Chan: So, what are some of the things that have um really stood the test of time? So, you mentioned that the the chapter on functional programming has has effectively stayed the same. Um, but like as it applies to React, what are some of the things that really didn't change, um, even though hooks came in and kind of changed the way that we we write a lot of this code?
[00:16:31] Eve Porcello: Yeah, I would say props and state are handled differently, but the main concepts still Things like React Router, we have included that. And uh everything just kind of got a freshen up. Nothing- like a lot of the introductory content for a chapter is the same. We're still talking about the same stuff. For example, a testing chapter. It's a good idea to write tests is uh always going to be- That's the theme. That's the theme. But maybe the tools and techniques, it's not Enzyme as much anymore. It might be React Testing Library. But kind of the, I don't know, the same approach exists, but I think with hooks, we're leaning in deeper to these functional paradigms and really being more pure about, I don't know, what what React really wants to be. So we're able to not throw everything out, but the code looks a little bit different to get to the same result.
[00:17:33] Alex Banks: Yeah, I'd say everywhere in the book too, we change the new pattern is to check for the thing and then to return null in a function. You know, where we used to like do more if-else stuff, or like, like uh, inline if, you know, like the question marks. So that was really neat. Like basically we went through and cleaned up most of the book except for the core, like the core 3 or 4 chapters in the middle. We literally highlight everything, delete it, and rewrote them. But like we cleaned up all of the- the other code stayed the same. We just upgraded it to our new patterns and upgraded the versions. And then sometimes when you upgrade stuff to a new pattern, you have to talk about it a little differently.
[00:18:08] Michael Chan: Sure.
[00:18:09] Alex Banks: But the one- like a good example of this is like the webpack. We teach a pure React chapter, right? So there's a chapter where you don't do any webpack. You're literally typing out just raw JavaScript React for this chapter to understand how it works. So the need for that isn't as important as it used to be. That's weird, you know? Sure, yeah, absolutely. Like the need for webpack. We teach webpack because you want to know what's going on under the hood, but the need for that isn't as high. So we struggled with like, wow, I hope this part of the book doesn't turn people off. Because it's kind of early, you know.
[00:18:39] Michael Chan: Yeah. Well, that is so interesting, right? Because, you know, 4 years ago, it's like you really did have to know that stuff if you wanted to set up an app. But but now, I mean, because it's more mature, like likely you're working in an app that's already had that set up by the company you're working at. Or, you know, there's 7 different distributions of like React application build systems that are gonna get you you know, kind of off the ground running in a, in a really like nice kind of ergonomic, well-documented way that doesn't require you like jumping headlong into a webpack config.
[00:19:15] Eve Porcello: Yeah, that's pretty tough to throw at people so early. And it's nice to kind of just realize where we are now, where we don't have to make everybody learn that first. So it's pretty awesome.
[00:19:26] Michael Chan: I feel like maybe that was like one of the, the really early cases for hate against React is that it, in order to do it the way that the documentation was showing you, you did have to set up a build step. And back then it was kind of like, what? Like, I don't have to do that for my JavaScript. Like, I don't have to write JavaScript in the browser. Like, I'm good.
[00:19:46] Alex Banks: Yeah, yeah, yeah. That's exactly how I felt. I was like, I don't even want to do this because like you could just code. But see, I, I didn't like it for the first 2 hours and then, then I loved it. Right. Because I worked I worked pretty heavily with like XML and those things back in the day, and this is what we wanted. Like this is what we wanted to do. People will tell you, oh, it had all these other purposes, but realistically, we wanted to create our own named components, send them some state, and have users interact with them and have us share them and stuff like that. So when I saw, I was like, oh wow, JSX and React has sort of succeeded at what we really wanted from that. We didn't really need it as a data format. We needed it as as like a component tool, you know?
[00:20:25] Michael Chan: Yeah. Now, this is kind of loosely related, but I'm curious, um, as you've been teaching, what have you seen in in with regards to like TypeScript? Because I feel like, you know, these this compile step kind of opened the door to more advanced compilation, right? And it kind of— it it helps people not immediately turn down the idea that you're going to you know, compile something, right? And it made it, it very, it normalized it. Cause it's like, oh, I'm just compiling it from something that you really want, this nicer syntax to like a, to older thing. Right. And then it's kind of like, oh, well, I'm already doing this. So like, are there not other benefits that I could get from like using a TypeScript or a Flow? Um, how has that showed up as you educate React developers today?
[00:21:10] Eve Porcello: It comes up a lot, right? I think that we do cover it in the book a little bit, but we decided that it kind of belongs later in the book as more of a nice feature for those who want it and not something that could deter people. Just like Webpack showed up and that deterred some people from React, we don't want TypeScript to be front and center and have that deter people from React too. So I think because everything is such an ecosystem now with like all these different things that you can choose from, we're- we try to get to the core of what is actually in React itself before we start to throw on extra stuff. And that's why we do get into libraries and extras later in the book. But maybe people are like, chapter- it's a 12-chapter book, chapter 9, that's enough book for me. I don't need all these extra libraries. Yeah. But um hopefully they get what they need out of the beginning parts, but they don't have to.
[00:22:13] Alex Banks: Yeah, our whole technique to teaching is isolation too. So it's like, separating things and being like, as isolated as possible. That's what this does. And then that's what this does. And now let's see what happens if we put a few of these concepts together to like build something. And I know there's another teaching route, which I I love too, which is like, let's just do it all, right? This is what a real project is like. Let's just start and come from this angle. We're more like, let's do the hours of just isolations and and messing around with these things before we get there. So one of our issues with teaching TypeScript is too many people are learning JavaScript at the same time. And then they get this code that's TypeScript and JavaScript and it's back and it's forth. And so like we don't put it in our material because we want the people to learn the JavaScript first. And um TypeScript's great. It's a great step. It's a great thing to do to your code, but it does make it hard when people don't know where like webpack ends and JavaScript begins and React ends. And then there's TypeScript too, you know, it's just like. I don't- I haven't really found for ourselves and for myself to be very successful at teaching that because you just say, well, like, that's TypeScript and that's different and stuff, and everybody's like, what? You know, but like, once you get the hang of JavaScript, once you get the hang of JavaScript functions, it doesn't take very long. It then is, I think, easier to show, okay, now you can say what types these functions are gonna return and what types they take, and we can make sure that they fit, you know. So that's how we look at that. That's why it's not introduced till later.
[00:23:35] Michael Chan: Yeah. Well, I really love that. Cause, you know, in this, there's been a lot of work to make TypeScript, um, what are they, incrementally adoptable, right? Which is really nice. And we've, we've had the benefit of being able to do this in a lot of places too. It's like a lot of people are really scared when they see full-blown TypeScript, right? Like it can be very overwhelming, but like if you just change, you know, if you just start using it for your prop types, Well, like you're just kind of like switching out like one thing for another and that's great. Right. And it's like, you can kind of incrementally step into this, this like typing thing, which is, which is awesome. So I think it's a really good approach that you take to kind of like introduce it as like an augmentation of the thing that you're learning.
[00:24:14] Alex Banks: Yeah. That's the TypeScript fundamentals, right? So all you need to do is get you started with that and it doesn't overwhelm people, right? Because you just get them started and then they kind of are hooked. See, people will like. Once they get hooked on something, they'll learn the other stuff on their own. They'll be like, oh wow, did you see you could do this and that? You know what I'm saying? So you have to just get 'em started without overwhelming 'em, you know?
[00:24:36] Michael Chan: Yep. Yep. Absolutely. Um, so I have a question about how you are handling classes. Um, 'cause I know that that's kind of like a been a big transition and I'm curious, like, do you like kind of talk through them as like parallel tracks throughout the material or? Or um do you kind of take that similar approach where you talk about like the functions and then like have like say like, hey, here's this other thing as well that, you know, you could see in the wild or you might need to use in these cases?
[00:25:04] Eve Porcello: I feel like we labored over this, right, Alex? Like deciding whether to or not to do this. But ultimately we decided to um just teach functions, teach functions as the way to create components. We have little boxes, little sidebars that have classes in them. And like this is how you do the same thing with the class. But if again, just like you can skip over chapter 10, if it's too late in the book, you can skip over that box if you don't see it. But ultimately, there will be people who are coming into React projects where classes still exist. We didn't just like wave a wand and erase them from the universe. So. Uh hopefully that will be good material for people to know what they are, but we want to not be teaching people things at the same time, ideally. So, um, you- we don't want to teach you classes, have you unlearn them, then teach you functions, because then the book will be even longer and uh people will be more confused.
[00:26:08] Alex Banks: It's that overwhelming factor too. Remember, like, you have to learn it in a week, and thank God there's a book that's gonna show you it in a week.
[00:26:13] Michael Chan: Yes.
[00:26:14] Alex Banks: So should we show you the old stuff? You know, and also like the whole idea- this is where it was really hard- is the idea of the component lifecycle and how so many of us learned hooks by being like, well, how would you do this thing I did in the component lifecycle with a hook, right? That's how I learned them. And so that made it made the most sense to teach them that way. But it's like, that's really teaching to other React developers and not people who are new to it. Um, it would be really weird to like have to teach something that's that's deprecated. Imagine in the future teaching something that's deprecated so you could take that step to get to the thing that's there.
[00:26:47] Michael Chan: Yeah.
[00:26:48] Alex Banks: Um, so it was wild because we we did, we wrote the chapter like that, and then we were like halfway through it, it didn't feel right, and we were like, this this isn't the way to teach this, you know? And we were like literally back at the drawing board, and we were like, well, how do you teach this if you've never heard of the lifecycle.
[00:27:04] Michael Chan: Well, it's a particularly tricky time for for all, you know, React education because the docs still primarily focus on the class implementation. And I know that that's been a big source of- and I know they're working on it. And so, and I know it's a lot, a huge undertaking, especially since it's translated to so many languages, et cetera, et cetera. And so I don't want to diminish the the work that has to happen from the React team. But But that that has been a really challenging thing. I think it's it's left a lot of people confused as to which thing is actually is actually the new thing. Because if you're coming to React and you see, you know, books and educational materials teaching it one way, but then the docs are the other way, well, how could the other resources be the newer thing and the docs be the old thing? And we are in like a really weird time kind of like community-wise where you have to be like, well, I guess you have to trust us.
[00:27:57] Alex Banks: Well, we needed that. That's how we needed to learn React. Like if we didn't have the docs comparing it to the old way, we wouldn't have learned it. And if we read what we wrote in the docs, we'd be like, this is such a big change. I don't have time for this right now. So it's like, we needed that to take the incremental step, but we really thought about what it's like for people to come to this that have no experience with that and take on a different approach to teaching the same thing. But like, yeah, it is funny, but it wouldn't have worked for us. We would have been like, this is too much.
[00:28:27] Michael Chan: Is there anything that you are happy to have a chance to take out of the book?
[00:28:33] Alex Banks: Ooh, that's a good question.
[00:28:35] Eve Porcello: I feel like we've said this 12 times at this point, but front-loading that webpack stuff was nice to remove. I feel like- ooh, I have some. Uh, factories and some of the weird DOM creation stuff that was there.
[00:28:52] Michael Chan: Oh, yeah.
[00:28:54] Eve Porcello: Also, we had this like uh React DOM diffing sample with these smiley faces and we thought it was so cool because it was like the virtual DOM's gonna come save your life. And then as soon as that was in the book, all the browsers updated and the sample broke and it looked really, really, it looked like we didn't know what we were talking about. They just updated the way they did their paint.
[00:29:15] Michael Chan: Oh no.
[00:29:15] Eve Porcello: Yeah. So the paint changed.
[00:29:17] Alex Banks: That's what they currently have in books too.
[00:29:18] Eve Porcello: True. But let's not talk about that. But it was nice. It was nice to pull the, that extra stuff out and, uh, yeah, just upgrade it. What about you, Alex?
[00:29:30] Alex Banks: I'd just say the class stuff, like, because we, the classes we hit so hard, we started that in those early introduction to JavaScript chapters. So it was like literally delete all of this stuff on the prototype and inheritance and classes and extending classes. And then it was fun. We'll see a lot of the stuff we took out, we had to completely replace. So it was kind of fun to be like, oh yeah, we're not doing any of this lifecycle stuff. You know, we took the higher-order components and stuff out too. And we do talk about those a little bit. But like, um, not as not at the extent that we did in the the last book. But so, a lot of the stuff, once we gutted it, which was nice, it was like we were at a blank chapter and had to write entirely new stuff. So-
[00:30:07] Eve Porcello: Not a not the best place to be. But ultimately the right place to be for the quality of the book.
[00:30:14] Michael Chan: So, before Hooks, there were a lot of competing ideas on how you would handle composition. And there was, you know, higher-order components. And uh you know render props. Um how have how has that kind of coalesced in in the book? Like do you just cover um do you just cover uh the hooks? Or are there cases where you say these are patterns that are useful in you know X, Y, and Z situations?
[00:30:38] Alex Banks: Yeah, I say we do. I mean we we cover— we kind of we follow the the same app that we've built. So we cover the state hooks first. Like kind of like useState. We cut Like, we kind of COVID the ones that you need to take the next step to build the app. And then like, there's really two chapters on hooks. And one is kind of about the state hooks and how to use useReducer and context and stuff like that. And the other one covers all the others, like when you would use useMemo and all of those things. Um, and like how we can use that within our apps. And I don't think- I think we might have missed- we might have took out the stuff on useImperativeHandle because it was like- I don't know about this sample.
[00:31:15] Michael Chan: Read the docs. Read the docs. You're good.
[00:31:18] Eve Porcello: Here's a link. Like, we'll come back to this at some point. Sure.
[00:31:24] Alex Banks: Yeah, we had a great sample and we changed it. We changed the sample and we were like, why wouldn't you just do it like this though? There was no use imperative. We were like, I don't know.
[00:31:34] Eve Porcello: But we do cover some of those other patterns a little bit later in the book. As Alex said, we kind of go through building an application. So, as the functionality becomes more complex, we build, uh, I guess all the tools become more complex too. So, we use uh higher-order components and render props and things like that just to demo a few different things. So.
[00:31:57] Michael Chan: I know that I have kind of like my line. And maybe this is probably not— uh, I don't know. I I feel like maybe people would want me to ask. But do you have a line, I guess, or like some something that like takes over in your head when you think like, okay, like I actually need a render prop for this, for this thing. Is there like a, like a heuristic that you have that that like triggers when you see certain code?
[00:32:20] Alex Banks: You know, it was interesting because I was like, do we need these? That was a huge question that I had to ask when writing this book. Like, do we need higher order components and do we need render props? And I found, yes, we need render props. We might not need higher-order components, but yes, we do need render props. Um, and specifically when the component needs to do some stuff and pass something back. And you just run into cases where you need that. Like, um, I don't know, like just like all of the list components are a great example of that. In order to do like windowing and all of those things, you need the information to be passed to a specific component. And there's no other way to do that other than a function. I'm more of a fan of the pattern of like actually making them props. So actually saying like renderItem or something like that, as opposed to putting it in the children. Um, because I feel like when we were teaching that, that was like a hard uh thing for people who were new to everything, just just because of the syntax. Um, but yeah, we teach them, we use them, we actually make a list, like a list component, and then we show people how to use the virtualized list component, because we don't take it that far. But like we we do go over render props, because I think they're absolutely
[00:33:28] Michael Chan: I think that's the perfect example for when to use them. And that's that's the thing that like always clicks for me, too. And it's kind of funny because that's the oldest example. Like like that was the React Native thing that kind of kicked render props off. Is they had this kind of like weird syntax for— uh what is it— like delegating that. So you could like render each item and like have full control over the rendering. And that became like this whole render props movement. And it's funny that we're kind of like just back to like that one case being the like the real prime case for that.
[00:33:58] Alex Banks: Yeah. You know, and it's interesting because there's a way to even get around that case in the in the code that I'm writing now, because I know hooks. So if you know hooks, you can expose a component and a hook to deal with that component. And so that's another way to share this stuff, but then that's two things, right? Because then you have the component and now you have a hook that's like, use the component. And then that hook passes you the functions that you might need to interact with that component. Specifically, I just built a modal that just needs this exact same thing. And the choice was render props. Or this other pattern that I put into play. But that asks a lot of people to know hooks too and to use the hook too and to use the hook and the component together. Whereas if you actually just make one component and say, put your render component here, it's it's easier.
[00:34:41] Michael Chan: Yeah, yeah, yeah, yeah, yeah. It's nice and isolated. There's- I mean, I feel like render props for for lists is just such- like the it all comes together just really nicely and it all feels like really tight. So, I'd love to know a little bit about how you came to work together. Um, obviously, you're you're married and you— I I know that in the past you share a love of like comedy and all of that, like all those good things. I I've seen you at events together hosting in like pirate costumes and like all kinds of stuff. So, um, how did how did this like working relationship around code in your marriage all come to be?
[00:35:24] Eve Porcello: Well, uh, I met Alex at 10 PM at night at Second City in Chicago when we were at auditions for a sketch comedy group. So, um, that is definitely where our relationship is based. Um, 2006, a very long time ago. Um, and at that time, I didn't know the first thing about code, um, and I over time got jobs that were kind of more tech-oriented, working as a project manager and then a UX designer and things like that. And Alex always wanted to take our working relationship from comedy into a working relationship in tech, which I always felt like for whatever reason was a horrible idea. So I was like, I'm not working with you. I have to go commute. An hour and a half to work, this is better. Because I'm very stubborn and I, I think I know best, um, until I looked back at things. But yeah, I thought that was the best idea at the time. I learned a lot about, um, about web development projects, but ultimately there was a point in my project management career where it was like, I need to learn how to code. And then there's this programmer at my house who's like, I told you, you should come work with me. You're, you do good at this stuff. So. So yeah, just over time, I was worn down by this process and uh I started to learn to code and Alex has really, I don't know, supported my career throughout this time to um to just work together.
[00:37:02] Alex Banks: There's been crying.
[00:37:03] Eve Porcello: There's been a lot of crying. There's been there's been a lot of fighting, a lot of crying, but ultimately our company's been in business for 8 years and we Wow. Teach and work together and everything goes well. I mean, there is still fighting and crying, of course, but-
[00:37:21] Alex Banks: Yeah.
[00:37:21] Eve Porcello: And that will continue, but yeah.
[00:37:24] Alex Banks: It's so funny. We like, we like to think that we're kind of like George Costanza's parents sometimes. Like we just yell at each other like, why are you using a- you know, like, just use a hook! Don't use a- you know. And uh, it's really funny. Um, you know, you left out one really important, crucial key to this, which is uh Eve was finishing up DePaul when she was in this comedy group. And I had a company that was called the Alex Banks Development Company, ABDC. And we were building-
[00:37:54] Eve Porcello: Like the Michael Scott Paper Company.
[00:37:56] Alex Banks: So that's why we're successful, right? It's Eve. So when it came time to name a second company, we didn't call it the Alex and Eve Development Company or like that, you know. But she said, yeah, it's like the Michael Scott Paper Company. And that's like pretty much what was going on. But I had people working with us, and then Eve was like, hey, I have this class, I need to do an internship somewhere. And I was like, I got a business, you can do an internship at my company. And it was supposed to be sort of a joke, and she was gonna be allowed to slack and, and do everything. But she actually, she actually did a lot of great work. And in particular, she was really good at, um, just like testing things and you know, the ability to navigate apps and stuff. And I was like, that's all you need. Like, that's the base skill for like programming and stuff. So ever since then, I was like, you should learn to code and we should work together because I I knew you'd be great at it. You know, like I just knew that you had what it took. And then you would like do so much stuff where you would test my stuff and you'd be like, this doesn't work. You got to do better. You know, like all of that. So there was like the whole like quality line of that. And uh she did, she went off and did her own thing. And refused to do it. And I yelled the whole time because I was like, "Learn to code, we can make money!" Like, you know, because she was going off and doing- like, she's like, "No, I want to be in the humanities." Like, you know, which is like, it was great, but it was like, come on. So then she ended up in tech. She ended up getting all these jobs in tech, and then she ended up doing software specifications and all of this stuff. And then it was like, she would come home and ask, like, "Can the developers do this? They say they can't." And I'd be like, "Absolutely they can." You know, and she needed to like learn why and stuff. And then it's been great. So what- What really started it is when we moved to Tahoe because there's not- there's not a whole lot of other jobs here. So we really took it seriously and it's been the best thing ever because honestly, um, we really complete each other when it comes to that. One of the reasons that Moon Highway has been around so long is because of Eve. You know, Alex Banks' development company did not stay around that long. So she's been really good with business decisions and marketing and then she's like this gift of teaching just like popped up, you know. Yeah. So it's like So it's like, I I knew it, I knew it. I didn't know that it was gonna be this good, you know? Like, so.
[00:40:04] Michael Chan: That's awesome. Well, I know you you you you touch on this idea that I think is super important, and and I didn't really think we'd talk about this, but I think some of the best developers are people who came from product or kind of have like an interest in like humanities or like the human element of it, or like have that That way of communicating, you know, that gets people's attention, right? Which is which is a very like like something you have to work through in in comedy is like, you know, kind of getting and keeping people's attention. And I feel like this is something that's really fascinating and I I love about, you know, the style that that y'all are presenting is that it feels very personal. Um but then also like having that that sense of product really does make you a better developer. I know I'm all over the place like with this, but like I think I guess what I'm trying to say is like some of my favorite developers are people who didn't ever identify as being wanting to be a web developer, right? But it's through that kind of like humanity that they understand things like even better than like someone who's really just kind of like looking at it from a code perspective ever could. And you know, you can kind of make those decisions of like, this sounds unreasonable that like a developer is not able to do this. And it's like, yeah, no, it is unreasonable. Like it's just code. We just gotta do what the humans need. Like- So I'm curious, like, you know, what do you have- what would you say to someone who is in kind of a similar spot where they have been toying with the idea of getting into tech, but have maybe not felt like aligned with it, like personally? Um, like what was kind of the thing that really made it fun for you? And like, how were you able to bring your personality to this kind of, you know, possibly stale type of uh industry.
[00:41:53] Alex Banks: I think, I I think too, like so many people look at this like this is the one, like this is the biggest choice of your life. Like this is what you're gonna be doing. Like, are you ready to commit to tech? Are you ready? Are you ready to be sending pull requests at like 12 o'clock on Sundays? Because this is your life now. You know, like I think that's kind of the biggest thing that gets in the way of anything. I've been in tech my whole life. I learned to program as a kid. Um, I was computer science in college, but I've always been trying to get out of tech, you know, like I went to Chicago and spent 8 years acting and tech was awesome because it supported all that, you know, I had the flexibility to go to stuff during the day and auditions and if something came up, you know, and all this at the same time I was building companies. It was fun, you know what I'm saying? But it wasn't the number one thing. And then it's like we've done that with other businesses and other industries and now we've gotten to this point in our lives where it's like, well, we've created all this flexibility So the number one thing is like really like skiing and mountain biking and stuff like that, and you just build the tech around to fit that, you know. So, but the value in that, the real value in not looking at it like it's the one thing that you're gonna do, is that you actually get creativity from the other things that you do and inspiration, and that's what inspires your tech. So we- I talked about this earlier, which is, which is kind of funny. In improv, you can stay in Chicago and you can do improv comedy all the time. But what happens is, is things start to get flat because you become a copy of a copy of a copy. Like, all you know about the world is from improv shows that you've seen, and you go to improv shows and improv classes and do that all the time, and then you just act like these characters that you see. Whereas if you actually get out in the world and do something other than improv, you have all of this real-world experience to pull from and bring it back into improv. And tech is the exact same way. Like, every app idea that we have revolves around being a user in the world, you know, like having some other hobby or having some other passion that you're like, you know what, I can make this passion more efficient because I know how to program too. Like, it's those are the things that I think are important. So tech brings stuff to to the other part of our lives, but the other part of our lives has always inspired tech.
[00:43:56] Eve Porcello: And I also think that we always talk about, joke about how when we tell people what we do for work, they're like, oh, I can't do that. You must be really good at math. And I'm always like, no, I'm definitely not good at math. Good at math at all. Um, and then they're like, well, you must have gone to computer science, uh, university for computer science. And I was like, no, I haven't done that either. But I feel like there are so many different roles in technology because technology is obviously- this is such a boring statement, but technology is a big part of our lives. I don't know if you guys knew that. But, um, I think that Because there are so many different roles that you can take on at a tech company, you can find your place no matter what your background is. So for me, that's empathizing with people who might not think of themselves as developers, who might not see themselves in groups of people who are- this has changed over time, but um I don't know, stereotypes of who developers are. I never really saw myself in those uh shoes, but Now I feel like because I can empathize with people who are going through that process of feeling like, oh, I don't know if this is for me, I should probably go back and work at the- I don't know, I should work at the ticket office at a comedy theater or whatever. Um, I feel like I have a different insight into how people are learning. And then I also want to- it's important to do your job well, but it's This stuff isn't that important ultimately. Like, deciding between higher-order components and render props, like, who cares? Um, I think that's a really fun conversation to have. I think it's a really fun, um, like, hobby to have. It's going to potentially make you better at your job. But at the same time, you shouldn't feel like, oh, these people say render props are better and I'm not as good as them because I don't understand why. You know? So. I feel like I feel like there's a lot of gatekeeping that goes on. And I like to think of my like personal brand as like a goofball clown who is just trying to have fun and make people have a little more fun learning things. And hopefully that will make them stay, you know?
[00:46:27] Alex Banks: Yeah, we don't we don't know anything. We act like we know so much stuff, like, but it's really like we just Google stuff. We're like kids, right? That are just constantly checking up on their parents. So it's like you hear this term and then you like, we go Google it and we figure it out and then we know it forever, right? It's like we took the time to figure out what render props are and now we're like, well, what do you think? Render props are higher-order components. And then other people hear that and they're like, oh my God, they must know calculus. Like, you know, it's like, it is like, no, just go, you can go Google these things. That's the, that's why going to meetups and stuff and listening to stuff is so important because you just write down the things that you don't know. And then look them up. And then the next time you know what it is, unless it's something like totally hard, like, and we're there too. Like, I think that what we all underplay in this when it comes to gatekeeping is how much we don't know all the time. And like, we don't know stuff all the time. Like, and then everything changes, so we don't know everything again, you know, just like-
[00:47:18] Eve Porcello: Yeah. And circling back on that, the book, like things we said you have to do and are the best practice in version 1 of the React book. Guess what? 3 years later, wildly different. And so I would love to, I would love to say that these things always stay the same, but the, the thing, as Alex said, you need to be able to constantly do is just Google it, try to figure it out and be curious about how to learn the newest thing. 'Cause it's definitely changing all the time.
[00:47:51] Michael Chan: I think that's really strong advice to kind of, kind of wind down on. Um, but one thing I really like to ask people, you know, at the end of every episode is, you know, with the best practices and the technology and everything changing so rapidly, what are things that you're really excited about for like the near-term future? So like maybe like 3 to 5 years, like what are the things that you think are just really going to change the way that we develop by the time that uh Learning React version 3 comes out?
[00:48:21] Alex Banks: So I I always think that real-time applications are underplayed and they're really coming up more and more and there's more tools to support that. But I think like subscription-based applications, WebSockets, TCP sockets, like any anything that you can do in real time is like way underplayed on the web because we have the technology to support it and we're just not using it enough. So I think we're gonna see more and more and more of that.
[00:48:44] Eve Porcello: Yeah, I think so too. I you kind of stole my idea, but um that's your idea to be fair. But um I think we're interested in kind of the stream interface for GraphQL and how GraphQL plugs into React. And how that affects Suspense. And I'm just explaining how our books are gonna change. Our GraphQL and React books will change in the future, I guess. But I'm really interested to see how, as we have more and more asynchronous applications, how are we gonna handle data loading in our apps? Because it feels like that story isn't done being told quite yet. GraphQL. So, yeah. GraphQL, of course. But I mean, like Uh, how exactly is what I'm most interested in.
[00:49:32] Alex Banks: And you know, you bring up another good point because it's really streaming in general. I'm telling people who aren't in tech to get into streaming. So like, you know, my photographer friends, I'm like, oh yeah, you need to learn this software and do this. And just like, why you should be streaming weddings. Like everybody wants their wedding stream. Not everybody can come. People want to see them get married and like you can put a price tag on that. Like, um, so I tell people like whatever business you're in across the board, try and figure out like what Twitch and YouTube is doing for like
[00:49:56] Michael Chan: That's interesting.
[00:49:57] Alex Banks: More real-time stuff, actually.
[00:49:58] Eve Porcello: Always back to that.
[00:50:01] Michael Chan: Awesome. Well, hey, thanks so much for your time. I want to give you an opportunity to tell people about— like you mentioned, uh you have Learning GraphQL as well. Um if people want to like get um either of your books or find out even more about the trainings and education that you do, where do they where do they find that? And where do they find you on the internet?
[00:50:20] Eve Porcello: You can go to moonhighway.com for a list of— a list— a website that tells you a list. List of all of our—
[00:50:28] Michael Chan: A render prop?
[00:50:29] Eve Porcello: A render prop, higher-order component list, um, a virtualized list of all of the things that we're working on. So, um, that is corporate training, that is video courses and books. I also made a little short link. So, if you go to bit.ly/learningreact, you can get a 30-day trial for O'Reilly's website to read the book for free. So, they told me I could say that. Um, but you can No credit card required. You can sign up for that. And I think you could read the book in 30 days and uh uh ghost O'Reilly at that point. But or you can support us and buy the book on Amazon if you'd like to, um because we'd love to get it into more people's hands.
[00:51:12] Alex Banks: They have other books. They have other books. The you know the other thing I was gonna say is we're doing a lot of stuff in the GraphQL space. But one thing I definitely want to get out there is we teach a free GraphQL class every Wow. So it's called GraphQL is for Everyone, and the idea is is everyone can learn GraphQL. You don't need to be a software engineer. You can be a business administrator, a project manager, any type of stakeholder. If your company uses it, it's a great class to take. Um and when I started in web development, like everybody knew how to check the database. Everybody knew how to use Access and stuff like that. So we're trying to get everybody on board with GraphQL to make it easier for teams to work together with their engineers.
[00:51:48] Eve Porcello: And the next one of those is on August 4th, and it's the first Tuesday of the month every month.
[00:51:53] Michael Chan: Awesome. I love it. Y'all are doing so much. I love seeing a, uh, like a a marriage and a business partnership work out like this so well that you can kind of like complement each other and um kind of support each other's strengths and do these like really amazing, um, you know, trainings and books. You got a lot going on. Um, so I just continue to wish you the best for this launch. I hope that many people right now will go and buy your— buy your book and support your efforts and uh learn about React along the way.
[00:52:24] Eve Porcello: Thanks so much for having us.
[00:52:25] Alex Banks: Thank you so much. This was fun.
[00:52:27] Michael Chan: Thanks for being here. This has been episode 102 of React Podcast with Eve Porcello, Alex Banks, and Chantastic. For links, visit reactpodcast.com/102. Thanks to our sponsors, Infinite Red and TestCatch. If you're looking for an intuitive, easy-to-use, and automated testing tool, give TestCafe Open Source Edition a try. It's free to use, setup is painless, and you don't have to install cumbersome web drivers for the supported browsers. Experience TestCafe today, download your copy by visiting testcafe.io, and enjoy testing. If you have a project that's gone off the rails, and need expert help, get Infinite Red on your side. They've been designing, building, and shipping apps for 10 years and want to bring their expertise to your apps, products, and services. They have a deal right now where you get $750 for referring 8 new projects. Get expert help from Infinite Red at reactpodcast.infinite.red. If you like this show, there's a fast, free way to demonstrate your support. Leave us a review on iTunes. It's the best way for you to let me know what you think we're doing right and what we can improve. 2 to 3 minutes of your time helps us make the best show we possibly can. As always, links and show notes for all episodes are available at reactpodcast.com. This episode was edited by Mikael Delport. It was produced by Mikael Delport and Sarah Jackson at Spek, a network to help you level up in design and development. Check out spec.fm for other shows that are sure to fast-track your career. I'm your friend, Chantastic. Thanks for listening. We'll be in your ears again next week.
chantastic.fm