chantastic.fm

64: Chris Toomey on TypeScript, GraphQL, and Product Thinking

Episode 64 · September 19, 2019 · 00:52:54

Hosted by chantastic · With Chris Toomey

Sponsored by Linode and G2i

Download MP3 · Jump to transcript

This week we sit down with Chris Toomey and address all the holy wars:
Elm vs React, TypeScript vs JavaScript, product vs development, and even VS Code vs Vim.

This is a pragmatic look at how type systems can improve the way you build and talk about product.
In the right hands — these tools can make teamwork a dream.
But in the wrong hands, well...
Let's just listen close and make sure your hands are the right ones.

Featuring

Links

Sponsors

Linode

Instantly deploy and manage an SSD server in the Linode Cloud, with your choice of Linux distro, resources and location. linode.com/react

G2i

G2i is a hiring platform for remote developers devoted exclusively to React and React Native. We vet, you get hired. g2i.co

Transcript

[00:00:00] Michael Chan: This is React Podcast. I'm Chantastic. This week on React Podcast, we try to find just how many holy wars we can fit into one episode. My guest this week is Chris Toomey, and we talk about Elm versus React, TypeScript versus JavaScript, product versus development, and even VS Code versus Vim. I think the only thing that we didn't talk about is MobX versus Redux. Now, this episode on a whole is a pragmatic look at how type systems can improve the way that you build and talk about product. In the right hands, these tools can make teamwork a dream. But in the wrong hands, well, let's just listen close and make sure that our hands are the right ones. Before we jump in, thanks to 2 great sponsors, G2i and Linode. Do you need proficient React talent fast? Have you had trouble finding qualified developers that can hit the ground running? Truth is, hiring is an expensive process. Just finding candidates can slow your team's productivity to a grinding halt. And there's a huge gap between resume and React proficiency. You could roll the dice, test your hiring abilities, and put your goals at risk, or you could hire G2i to find the perfect developer for you right now. G2i finds the best React and React Native talent available and determines in which ways they are the strongest. Engineers have been vetted through React-specific code reviews and technical interviews. And when you work with G2i, those scores and notes are provided to you upfront, saving you time and energy and keeping your team focused on building the product, not finding a needle in a haystack. Let G2i solve your hiring problem for you. Visit g2i.co today and find a developer handpicked for your team and application stack, ready to go. G2i. We vet, you hire. It's that simple. Develop a server in the Linode Cloud in minutes. Offering cloud computing plans for every workload, from simple web hosting to CPU-intensive needs like video encoding, machine learning, Linode offers a balance of power and price for every customer. Linode has 10 data centers worldwide. When you're in the business of delivering content to users, you know how important it is that you have that content on a server as close to your users as possible. Linode helps you do that. They just added 2 new data centers in Toronto and Mumbai. Combine that with native SSD storage, a 40 gigabit network, and the industry's fastest processors, they can help you serve your customers as fast as possible. Visit linode.com/react to get a $20 credit. That's L-I-N-O-D-E dot com slash react, and the promo code REACT2019 will automatically be applied. Just run off and get yourself a $20 piece of cloud. Now, into the show. Chris Toomey, welcome to React Podcast.

[00:03:10] Chris Toomey: Thank you so much for having me. I'm super excited to have you.

[00:03:13] Michael Chan: I have wanted to get you on the show all year, and I wanted to go out and visit you and sit and talk with you in person, 'cause we've never met uh before this month.

[00:03:22] Chris Toomey: It's true.

[00:03:22] Michael Chan: And and uh yeah, so I wanted to get you on the show. I have loved your work for a really long time. You've done some amazing things uh working at Thought Bubble, which is a uh digital consultancy for uh mobile web development and uh design. And uh you've been able to do some amazing projects there that have really taught me a ton. And I wanted to get you on. Uh you did Uppcase, which uh was a a a course platform where you're teaching people about tmux, Vim, uh ActiveRecord and Rails, and some JavaScript stuff. I learned a ton from you there. Uh during that time, you talked about product on the Giant Robots podcast, and now you're talking about development on the Bike Shed. Did I miss anything? What what what else are you doing? What are you doing right now that you're just super excited about?

[00:04:08] Chris Toomey: Uh, it's interesting because that's everything that you just listed are things that I'm uh extremely fond of and and happy to have been involved in. But the core work that I do here at Thoughtbot is as a product consultant. I'm a developer uh working with our clients, helping to build things and bring digital products to life. Um, so it's yeah, the vast majority of the time that I've spent has been uh more on like working with clients and actually writing code. Um, so yeah, other things, but not as uh readily available on the internet, I guess.

[00:04:35] Michael Chan: Yeah, well, that's one thing that I've really loved about Thoughtbot and your work is that it really introduced me to a different idea of consultancy. I've I've always thought about like agency and it's just like you you don't think about quality, you just push out as fast as possible, or at least a lot of agencies, right? You get the contract, you do the work, and then it's gone. Um, but I I feel like I've learned a lot through Thoughtbot and your work and the podcasts about partnering with a team, like coming alongside of a team and either improving what's there or helping them get a really great start. And you've you've thought a lot um about code quality in terms of how it it it protects the life of that product and sets it up for success. So, do you have, in your kind of, I guess, 6 years of doing this, where you've you've had some some training material that's come out of that or on just the podcast, do you have like favorite episodes or like favorite moments or favorite courses where you felt like this is this is the jam, this is like the some of the best that I've ever done?

[00:05:37] Chris Toomey: Uh interesting. Um so, I like that you highlight the quality aspect because that is a really strong part of the voice that we collectively have here at Thoughtbot. We care deeply about that. That's one of our core values. Um but I would actually almost put that as a secondary consideration and more so I focus on the the approach that Thoughtbot has to building products and to figuring out what the right thing to build is and to making sure that we're not just siloing ourselves off as a product team and writing code because at times that can be a lot of fun. But if we're writing the wrong code, then uh it's not in service of anyone and and that becomes a problem. So, so much of our work is about figuring out the process and the tactics to deliver uh useful features to end users, things that will actually uh impact their their day-to-day life, their workflows, um you know hopefully get them to buy or or stay on with a product or whatever that end measure of utility is. But um there's actually one episode of The Bike Shed that probably stands out the most to me, which— uh the current incarnation of the show is myself and a co-host, uh Steph Vackeri, and we've been together co-hosting it now for a few months, I'd say. Um but she actually came on as a guest a while back, and uh this was— I was sort of touring around and chatting with my uh fellow Thoughtbotters, and Steph came on and we had a conversation that was decidedly less technical, but it ended up talking about a lot of process and things like, if you have technical debt cards in your backlog, is that a good idea or is that a bad idea? What about story points and estimation and deadlines and Scrum and Agile and workflow and all of those, sort of that intersection between product management and development and how we have those conversations. And I remember listening to that episode to write the show notes and I was like sort of cheering on as I was listening, which is weird to have that sort of uh removed view of a thing. But that episode I think encapsulates a lot lot of the work and thinking in a not strictly technical way, uh in in probably the best that I've seen.

[00:07:36] Michael Chan: Nice. Yeah, well, that's one thing that I just I love about I I love about your shows is that it feels like you're always working uh and you're always iterating on your process and and your thinking. And um that's one thing that's so great about listening to The Byte Shed is is that you're just talking about like the the the process of working. And you're talking about code, you're talking about technical things. And you know, for anyone who is interested in uh kind of the whys of GraphQL. And uh hearing Chris always want to use GraphQL. That is a great- a great show. Because you'll be like, oh, okay, like I hadn't really thought about that benefit of like why GraphQL. And we'll we'll talk about that in a second. Um but what are some of the- what are some of the big product revelations that you've had over the the last handful of years? I know that one thing that is challenging for people is- I don't know. I I kind of think of this- I'm gonna go on a little bit of a tangent. To define the question a little bit, but-

[00:08:29] Chris Toomey: Go for it. Yeah.

[00:08:30] Michael Chan: I think about two types of debt, right? There's there's debt that you take on knowingly to help you kind of like get a boost. But then there's also this other type of debt, which is a little bit more like consumer debt, which is like, I want to use X regardless of how it fits into the the product or the platform. How do you make some of those decisions? How do you go into a product and and suss out what is best for the platform regardless of your favorite technology at the time?

[00:08:58] Chris Toomey: Sure. Well, I think it always starts with talking to users, with actually having that feedback loop uh as short and as closed as possible. Um, so, a thing that I believe pretty strongly is in not having developers, you know, hidden away or siloed, but bringing them as close to that process as possible. Uh, and it's interesting, like we haven't mentioned the word React yet uh in the podcast, but I think React is actually such a perfect encapsulation of a lot of these ideas. And it came out of Facebook, which is an organization that is sort of fanatically focused on product product at the end of the day. And hearing engineers from the company talk about it, it's like, okay, I see how React as uh as a technology came out of that organization and why it fits so well into this mold. Uh but to come back to the the base question, um I think keeping that feedback loop as uh tight as possible. Um one of the things that I I like to encourage is having all of the developers see the sales demo of the products, uh or ride along with customer support or get. Get into a place of empathy with the end user so that they understand I'm not putting a button on a page because a Trello card tells me to. I'm putting a button on a page to facilitate this workflow that a user has, to make their life better or easier in a certain way, which again serves, you know, the whole goal of the company and and everything like that. So, I'm not sure uh if that actually answered the question, but that's uh that's in the space of my thoughts and happy to dig into any portion of that.

[00:10:20] Michael Chan: Do you feel like uh Thoughtboters have a natural intuition about about product? I know that sometimes there's these these big walls set up between product people and development or design. Uh do you feel like you try to integrate as much as you can people into that process, like across the company?

[00:10:38] Chris Toomey: Oh, yes, absolutely. Every um every designer and developer at Thoughtbot, and that's basically the core of the team here, are designers and developers uh working with our clients every single day. And Every designer or developer is expected to also be a consultant. That is as much, if not more so, the focus. And so we want to all be comfortable having those sort of conversations, um thinking in terms of, you know, user needs and how do we produce a first version of something as quickly as possible, ideally without sacrificing on quality. But say, let's what if we were to reduce the feature set down to absolute bare bones, get that minimum viable products, and then get that out in front of users and get real feedback, not our best guess, not our intuition. About what would be useful, we can use that to like make that minimum viable product, but let's have the rubber hit the road and actually put the code in front of people. Yeah. And so I think like minimum viable product is one of the things that that has become a buzzword or buzz phrase or um something that comes up a lot in conversation, but people have certain ideas about what that means or what it doesn't mean. Similarly, Agile, uh either with a capital A or a lowercase a or Scrum or any of the variants therein, It's funny, at one point there was something on the internet that we came across that was describing Thoughtbot as dogmatically agile in a very negative way. And everyone at Thoughtbot was like, really? Huh, that doesn't sound like us. We're pretty pretty minimal in our process and the way that we approach it. Um, but we believe that there are certain processes that bring about better results for everyone involved. And so it's basically a constant game of seeking those out, sharing those back with the teams that we're working with, and more broadly, as much as possible with the community. And then, yeah, making real software that people use and uh are happy to use.

[00:12:24] Michael Chan: Do you feel like that style is um a a challenge or an affront to new people on the team? Or has uh the content creation that you've done via the blog and um podcasts, has that kind of created a self-selecting audience of people who would want to work at Thoughtbot and like a certain style of thinking about products?

[00:12:45] Chris Toomey: Uh, yes, there's definitely— um, we've been very clear about the ways that we work over the years, and that's incredibly- it's actually really interesting when I'll talk to someone during the interview process and they'll enumerate all of the different um Thoughtbot things that they've uh used or or read or watched throughout the years. And I try to not be too biased there where I'm like, oh, cool, you love us. That's great. That's- but it is interesting because if you put a ton of your beliefs and values out there in the world and then someone comes along and says, I love all of this, you've probably got a pretty good match there.

[00:13:18] Michael Chan: Yeah.

[00:13:19] Chris Toomey: It's absolutely not a requirement. We have plenty of folks who've joined the team who actually weren't that familiar with Thoughtbot beforehand, uh but it definitely is a sign that like, oh, we've okay, so we're probably syncing on some of these ideas and and that's good. Uh and then the language that people use as they're they're coming into the process and are they talking much more about code and language uh like languages and frameworks and technologies or are they talking more about building products somewhat agnostic from whichever technologies we are. We obviously have our preferred technologies, but at the end of the day, the focus is on making things that people can use. So, if that's the language that they're using, then that definitely starts to uh hint that we're probably gonna have a good match here.

[00:14:00] Michael Chan: Yeah, yeah. Well, I love that. Has has have those products that you've made, like Upcase and the podcast, have they they come out of- I'm kind of like tripping over my words right now, but uh there's this kind of idea from uh Basecamp where they say you should, you know, I don't remember what the exact wording is, but like once you've identified something that's kind of like a byproduct of your work, you should package it up and try to, you know, sell that or or put it out into the world as well. Has that been kind of the the guiding principle of some of these, you know, like Upcase and the bike shed that you've been doing?

[00:14:32] Chris Toomey: It definitely has. Um, I think the the general idea of um sharing and transparency and uh giving back to the community uh are all so core to Thoughtbot. Thoughtbot is a company that exists very much on purpose, and that's probably the thing that I love most about it. Like every company has a mission statement or a set of values, but I've never actually worked at a company that like referenced them on a daily or weekly basis and actually really held themselves accountable to it and even revised and iterated on them over time. As they were like, you know what, this one, we had the best of intentions when we said this, but it actually doesn't produce the outcomes that we want. And um so sharing and and um giving back is is a very core part of that. Uh and then it also has great utility for us because we're better known in the community. It helps with hiring, it helps with demonstrating that we know what we're talking about when we need to come into an organization and try and build trust as quickly as possible. Yeah. Um because it's it's always interesting as a consultant coming in and sometimes there could be an adversarial relationship with the existing team um in cases where we're coming into a team, but the vast majority of experiences I've had folks are very happy to have an additional point of view and one that- we also try and be pretty positive in our work. So, I think that combination of things has really helped us sort of across that spectrum.

[00:15:50] Michael Chan: With so many new developers coming into the market, obviously there's a great need. How important do you think being able to think, you know, macro and micro about product and code is going to be for for developers over the next like, you know, 3, 5 years as they continue to develop their career?

[00:16:09] Chris Toomey: I'm a firm believer, at least in the world of product and application code, but I think probably more generally, uh the game of coding is fundamentally one of trying to talk to two different audiences. You need to convince a computer to do the thing that you want it to do, uh but arguably that's the easy part. And the hard part is capturing subtle business requirements in code that both works for the machine but also communicates to the future readers of that code. Most likely yourself, uh or quite likely yourself, but then also anyone else on the team. And so communication is sort of the core element there. You're simultaneously trying to communicate to two different audiences, and they're not mutually exclusive, but they're sometimes sort of a forced fit. The thing that tricks the computer into doing the thing that you want can be very hard for a human to read and actually interpret. They're like, oh, users have multiple profiles. I I get it now. And so, yeah, communication is is the core of all of that. And then that's assuming that you have a perfect understanding of the problem. Now you're just mapping it in. But then there's also the part of getting to an understanding of what is it that we actually want to do here? How do we want to constrain the system to behave? And that requires furthermore communication. So, um, I think, yeah, communication throughout and and focusing on that as a like core skill set or area that you're working on is definitely something that I would encourage for basically anyone coming into this industry or still, you know, years into this industry.

[00:17:37] Michael Chan: Sure. Yeah, I love that idea of you being kind of in the middle. You're a liaison between humans and uh the the computer. Uh because so often it's like people want to just just be the computer and they get angry at the humans or they just want they they want to solve the human need and they like get angry at the computers. And like this idea that you can kind of like live in both worlds comfortably is is something that I see in some of my my favorite developers, to be able to think about product and then think about code and like have the code be uh submissive, I guess, to the uh to to the product needs. And uh on that vein, it seems to me like when I first uh found you and Thoughtbot, it was it was a lot of Rails. There was it was pretty heavy on Rails. Um but now I'm seeing more and more in uh in the front-end space, in React, in GraphQL, all that Has that been like an intentional transition or has that just been kind of a shift in the industry that's led you to some of those technologies?

[00:18:36] Chris Toomey: I think it's a little bit of both. Aspects of it are definitely the world is changing, the world is shifting, and more and more we're seeing dynamic client-side applications and that's becoming table stakes. So, we're having to adapt to that a little bit. The aspects that I would say have been purposeful are us trying to choose specific technologies within that space. So rather than working in any front-end framework, we want to have a purposeful, founded opinion about which ones we like to work in and how we've been most effective, and then ideally communicate that back and, you know, share that with folks along the way. And so, like you said, that that has ended up being React. I would say I'm personally a huge proponent of GraphQL to the point that some of my colleagues have started to laugh at me whenever I mention it. But whatever. I believe in it, and I'm happy to chat about why. Um, we're also pushing pretty hard on strongly typed functional languages. Um, so things like Elm or TypeScript are um a big focus of ours and trying to move more development into that. And I think similar to some of the work that we did historically in the Rails community with testing, uh that's always been this absolutely um core idea and thing that people really associate with Thoughtbot. Uh similarly with types and with type systems, we want to try and help make that a little easier. So there's definitely some resistance, uh particularly in the JavaScript community. There's a lot of, you know, we want to be free and and move as comfortably as possible, but we see significant benefits in the strong type systems. So we want to try and help that conversation and help folks find a way to do that that's still productive, that's still um enjoyable, frankly, and expressive and and all of those things that um many folks so strongly align with. The idea of JavaScript at this point.

[00:20:21] Michael Chan: Let's uh let's dive into to types and TypeScript then. There's so many things-

[00:20:25] Chris Toomey: Sure.

[00:20:25] Michael Chan: There's so many things that I would love to chat with you about. But let's let's hammer on that one for a little bit. Um you have a great talk on on TypeScript and React. Um I believe that it's called— uh let's see, Bringing Simplicity and Correctness to the client to a client near you.

[00:20:40] Chris Toomey: That one's actually more about GraphQL, GraphQL and React. Um there's a different talk that I have about TypeScript and React. But uh I can definitely share it. Oh

[00:20:48] Michael Chan: yeah, it's just TypeScript and React.

[00:20:50] Chris Toomey: I think it's that. Yeah, it was a local meetup and so I didn't get too fancy with the name, whereas the other one was at a conference and so I got a little fancier with the name.

[00:20:57] Michael Chan: Well, it is absolutely great if you're looking for an intro to React and TypeScript. Um, but you have— uh you had a really interesting um thought, I think, and a lot of times we think about type systems as just preventing bugs, but you had listed a handful of ways like docs, um static errors versus runtime errors. Refactoring safety, automated pairing, um all of these is like benefits of using a type system. And I was curious, how have people, uh I guess, experienced those benefits or become excited about those benefits, specifically moving from uh languages like Ruby that um have have been designed to be unrestrictive and expressive intentionally?

[00:21:39] Chris Toomey: Uh sure. Um so, my um development arc, if you will, started from a very dynamic place. I worked in Python for a while and then I moved to Ruby and then I've spent a lot of time in JavaScript. And it's only more recently that I've been spending time in these functional languages. And it's interesting that for the first many years I was very happy in the dynamic languages and I I didn't feel any pain. And then when I started to spend time in the the functional and strongly typed languages and I started to see the sort of feedback that the system can give you, the sort of correctness that it can help you towards, uh when I come back to dynamic code, I'm like, oh man, This- I really wish it could have told me the answer to this because it was a very knowable thing. There was some error that I had typed in. It's very hard for me as a human to read this code and understand that the shape is ever so slightly off. I need an array of objects, not an array of integers. I need, you know, I need to pass just the right sort of things here. And that's something that the computer is incredibly good at, and I am terrible at. Uh, we- I think I'm not I'm not alone in this, but um. So, my experience has been feeling that utility, feeling the feedback loop of actual errors right there in my editor. And not errors that are annoying like an ESLint rule that's yelling at you about something that you don't actually care about and that doesn't affect day-to-day. But actual, like, you have made a typo here. This is not good. You don't want to do that. And finding that out right as you're working is so, so impactful. And then further, the thing that has been the core of my focus around strong type systems is the ability to change the system. So requirements are always evolving. The way that users are interacting with the software is always changing. And so my job is constantly- even I think of the addition of new features as still a form of changing, because often you can't just like plop new code next to the existing code. Right. You have to massage it in there and connect it to the pieces that exist. So everything is sort of refactoring. I'm misusing the term, but I'm gonna run with it because I like the analogy. And the way that a system that is watching your code and watching as you work can help you through that process. The amount of thinking that I can offload to the compiler and then I can just focus on the bit that I'm interested in, which is, you know, starting wherever the change makes sense to me and then following the compiler errors until they stop. And then I'm done. And there's a calm that comes with that. If I need to do a wide sweeping refactoring in a Ruby project at this point, there's a little bit of trepidation. And it varies depending on how complex and messy the code is. Codebase is, but even the best of Rails codebases, I still need to hold a lot in my head, um or really trust my tests. That's another thing that we sort of offloaded this thinking into tests. But what if the tests were just there for you? Which is sort of what a type system ends up being.

[00:24:20] Michael Chan: Yeah, this is something that I have found really interesting about this this discussion. And I loved that you you talk about it in terms of like automatic pairing and you know refactoring safety and all those kind of things. Because From, you know, even if you're just a been a long-term JavaScript developer, not, you know, from a different language like Ruby, you you get these benefits and they're kind of like hidden to you. You've you've been experiencing some of these pains. And I feel like Ruby, more than any other community, has gone deep into solving them with human solutions. So you have, you know, like Solid, you have pairing so that, you know, people can be that extra set of eyes so you don't make those like little mistakes or. Or the bigger mistakes. Or maybe they know more about the system so that when you think you can make this isolated change, they're like, oh, no, no, no, there's actually 10 other places that this code is going to need to change. And like you mentioned, tests. Um, and it feels like once you get, you know, interfaces and and and types, that kind of whole class of like human things that you really need to do kind of dissolves a lot. Maybe not all the way. But it goes away quite a bit. Have you found that you've been able to, with these tools that are in strongly typed languages, been able to reduce some of those kind of other systems?

[00:25:41] Chris Toomey: Definitely to varying degrees. So to to touch on a few of them, um pairing is something that I still absolutely love. And uh I I think of the compiler as like a pair that's always with me, but I still think of pairing as a a practice that is good for thinking about and communicating and having another human to work through the domain modeling or the thinking of a problem as opposed to the, you know, mechanical entering that into the the code. Um but tests are definitely something that uh when I have a type system that I really trust, I will ratchet those back. And so with TypeScript, I'll still want a good number of tests to go along with it because TypeScript is uh more permissive type system. But if I'm working in Elm, I have very few unit-level tests. I still end up having some uh high-level integration tests just to make sure all the pieces are connected. Together from the UI through the API, all the, you know, all of the different pieces. But testing that an individual piece of code works, uh turns out Elm's actually way better at that than I am. Um and I have- my goal is always, I try and think about things not in terms of the like moral correctness or you should do this because it is correct and good. And I think about it again in terms of utility. And so- The way that I think about tests or other things like that is how comfortable do I feel deploying this change?

[00:26:58] Michael Chan: Yeah.

[00:26:59] Chris Toomey: And on- there have been plenty of Rails apps that I've worked on where we have sufficient test coverage that I feel comfortable deploying almost any change when the build is green. Uh and I also can go in and I can refactor, I can change things. And when a test breaks, that test is giving me very meaningful feedback that I can follow and then fix the system. Um similarly, types do an incredibly good job of that. Depending, so like Elm, you can't get around it. Uh whereas TypeScript, you definitely can. And actually, that's an interesting aside, but my uh one of my recommendations that I've been saying more and more firmly as I go further on and and talk to more people about this is going to TypeScript from JavaScript is not something that I would recommend. I would recommend actually circling around through Elm and coming back to TypeScript, or at least thinking like trying not to think of TypeScript as just a JavaScript with types, but thinking of it as a more permissive Elm. Interesting. And I found that Elm helps with the thinking and the modeling and understanding a type system and really working with that and having a conversation with the type system.

[00:28:02] Michael Chan: Do you have a- if you're gonna make that recommendation, do you have like a good first product that uh is like a good experience to kind of like get your feet wet with Elm if you've never had any experience with it?

[00:28:13] Chris Toomey: I think the Pragmatic Studio, Pragmatic Programmers have a really great course that uh provides that like from zero to Elm and helps you get up and running. And then I I will say Elm is actually an incredibly impressive project in terms of the very purposeful way it's been built out and the errors and the feedback that you'll get. And so the compiler, when it fails to compile, will give you this like very human, hey, hey friend, uh seems like you put a string here, but I think you meant a number. Uh you can fix it by going— it's uh it's written as if it's a friend watching alongside you. And they've been very purposeful in sort of the language that they brought into- language in terms of the words that they're using, brought into the language of Elm, and things that they will say and won't say. And so I find Elm is actually just an incredible thing that's really shaped my thinking as well. Yeah. That's where functional stuff and types started to make sense to me. And then even the Ruby code that I'm making, that I'm writing with no type system whatsoever, is still informed by the way that I wrote the Elm code and the things that I learned there.

[00:29:12] Michael Chan: Well, I want to get to different languages in just a second, but I had one kind of like wrap-up thing that I wanted to say. It feels like in your summary of what type languages provide you over some of the other ones is is that in your conversations, in your tests, in those in those levels of things, uh you're able to think about them a little bit closer to product. Um and I think you specifically said like the domain of the application as opposed to like Oh, you missed a semicolon. Oh, you should probably do it this way, write it this way instead of the other way. And you can kind of assume correctness, you know, if you're you're you're actually leaning on the type system, and then have those higher level conversations that, you know, appeal to the domain, appeal to the product. And I really I really love that that like it doesn't dissolve everything, but it kind of brings you, gets your mind in in those two spaces that you want to be a little bit a little bit better.

[00:30:04] Chris Toomey: Yep, absolutely.

[00:30:05] Michael Chan: So, you mentioned TypeScript and React versus Elm. And something that I wanted to ask is, you know, if something like Elm exists and the language is typed by default, what is the benefit of, you know, marrying TypeScript and React?

[00:30:23] Chris Toomey: Why not just go to Elm?

[00:30:24] Michael Chan: Yes.

[00:30:25] Chris Toomey: To get to the question. Yeah. Uh, it's an interesting one. There are actually some thought-botters that have, I would say, uh that more uh pointed viewpoint than I do. Uh at the end of the day, it comes down to, uh I think, pragmatism and actually being able to take a team of developers and build a product and get it out there. Um there is a a learning curve to any of these technologies. And uh like I said, I I recommend everyone learn Elm as sort of a way to better understand TypeScript. But there's such an ecosystem out there of things in the JavaScript world and in the React landscape that TypeScript does frankly an amazing job of meeting JavaScript where it is, meeting uh frameworks like React and similar tooling where it is, and helping to elevate that and to give a little more safety and a type system and compiler errors and all those nice things. Uh but it still it coexists with that ecosystem that there is just so much written in, uh versus having to sort of burn it all down and and rewrite it in Elm. Um I Elm is a fantastic language and I have uh wonderful time writing in it, but Uh, I don't know that I see the world where everyone is writing only Elm in the future. Uh, and frankly, from my point of view, having to come in as a consultant, it can be a harder sell, whereas I can gradually get people onto the TypeScript train. Uh, TypeScript actually has built into it the idea of different levels of strictness and being able to gradually migrate into it, whereas Elm would be a full rewrite. And so there are just some practical limitations, um, that at the end of the day, uh, React and TypeScript are a great second option, I would say.

[00:32:01] Michael Chan: Do you have areas where if you're if you're if you're transporting a JavaScript codebase with React to a TypeScript one, do you have kind of a standard process for areas that you think it's it's a best fit in a minimal way and then adding from there?

[00:32:15] Chris Toomey: Hmm. That's a good question. Data structure transformation code.

[00:32:19] Michael Chan: Okay.

[00:32:20] Chris Toomey: That tends to be a great place because it's relatively clear uh even to developers that are newer to working with the type system how to how to model that into the type system, how to say what's going on here? What's the domain concept? Well, we have some data that we need to shape and remap and filter and, you know, do all of those sort of things. So, that type of code I think is a great place to get started with it. Mm-hmm. But frankly, one of the really nice things is any JavaScript file is a valid TypeScript file. You can just rename from .js to .tsx or whatever it needs to be if you want to have JSX going on in there. But just the rename alone is both valid and actually does get you a little bit of like, oh, TypeScript will start paying a little closer attention at that point. So, you can do it literally on a single file basis and just by changing the extension and then start to like gradually lean into it and and add more and um you know pull on things like that. I think perhaps the API boundary is another one that stands out because that's an area where uh historically you just kind of have something coming in. Yeah. And it's nice to be able to describe what that something is and to provide a little more clarity around that boundary. So, it's not as um sort of invented and assumed, but to actually document and make a little bit more explicit that transition point.

[00:33:37] Michael Chan: I know that you are a longtime Vim lover, but I've seen in your videos that when you're working with TypeScript, you're using VS Code, which are both produced by Microsoft. Kind of makes sense. Um, is that- does that follow you into your your work life, or is that just for the demos?

[00:33:54] Chris Toomey: Uh, this is uh this is a real honest question. You're uh holding my feet to the fire on this one. Um. It does not follow me into my actual work with TypeScript. I am still desperately clinging to Vim because I care about it so deeply. Uh, it's an unfortunate reality that I think VS Code is probably the best text- not text editor, but the best editor overall that I have seen at any point. The language server is the thing that's powering all of that TypeScript goodness behind the scenes. And then other languages like Scala has invested heavily in building out a similar sort of integration and TypeScript- or sorry, VS Code right now is just by far the best front end for that. But they've built it in a way that is really beautiful and decoupled where the editor knows about the editor side of things and then each language has a language server, a separate process that runs that semantically understands the language in a deep, useful way and then can talk to the editor. And so, because of that, I'm just really hopeful that Vim will figure it out. Unfortunately, it's still a bit of a kludge and I like at this point as I'm working with my colleagues and they're like, oh, I see that you're still using Vim, so I should use Vim for TypeScript. I'm like, uh, no, you should probably you should probably use VS Code unless you are broken like me. Uh, or a different way to put it is deeply committed to the ideals of Vim. Uh, VS Code has a Vim mode, but it's sort of uncanny valley and not quite— uh, my hands get caught constantly. I'm just like, oh, that's not quite how I expect that to work. Uh, and I've invested so much in sort of thinking in Vim. Uh, I actually have a whole talk about that that is one of my favorite. Oh, cool. Talks that I've given just in terms of I I I love that subject matter so much. I love what Vim is and uh and yeah, I can't give it up. I'm hoping it will get better, but for right now, I wouldn't necessarily recommend it for other people.

[00:35:38] Michael Chan: Right. It's really hard. It's a hard world for people who have invested as much in Vim as you because there are some really great uh emulators out there that will get you all of the basics. But none of the advanced stuff that you've invested years into. And so, yeah, that that muscle memory is just is just is just hard. And it's it's sad to let that go.

[00:36:01] Chris Toomey: Yep.

[00:36:02] Michael Chan: I I I was um less vigilant and I was like, I whatever I'll do without, I'm I'm going to- especially with uh CodeSandbox now, like in the browser and like, you know, for for classes and just like quick demos and stuff. I was just like, it's so I'm getting a little code-

[00:36:18] Chris Toomey: Yeah, no, you made the right choice. I just, I can't. I tried. I keep trying even. I keep being like, you know what, VS Code, it's just, it's so much good there. And then I try it, I'm like, nope, sorry. This is a thing where I care about workflow, I think, more than other people. And I don't think it's necessarily a good thing. It's borderline hobby or uh it's one of those like, some people really care that their monitor is very clean and does not have a single fingerprint on it. Yeah. I care a little bit about that. Definitely care some. I'll clean it from time to time if someone's poked it. Why do people poke screens, by the way? Non-touchscreens. Great question.

[00:36:50] Michael Chan: Depth perception issues, maybe?

[00:36:52] Chris Toomey: I don't know. Uh, but so, for some people that matters a lot. That matters less for me, but the ergonomics of my developer tooling matters just a ton. To the point that it's kind of annoying. I wish I could turn it off, but here we are.

[00:37:03] Michael Chan: Are there promising projects in in the Vim space? I know that there's a couple of forks of Vim. Uh, are there any promising ones in terms of uh taking advantage of those language servers and and doing that work?

[00:37:16] Chris Toomey: I think NeoVim, which is probably the the um most popular sort of fork of Vim, they're working on an implementation that would be native to make all of this work better. Okay. Um there's another one called OniVim, I think, that similarly will probably get more direct integration. Um it's one of those things like it it actually doesn't make sense to me why it is um not better yet. Because the whole point of the way VS Code built everything out was to be decoupled and to make it so that every other editor can also benefit from the wonderful things that were going on. And so, I'm not really sure- like it shouldn't actually take a fork of Vim to make this happen. And yet- Sure. There are a number of projects and people seem to be putting in significant effort. And I don't think there's any fundamental reason that this doesn't work better than it does. It just- I don't know. It just hasn't happened yet. So, here we are.

[00:38:05] Michael Chan: Well, I want to make sure that we get to talk at least a little bit about GraphQL before this episode's over. Because I know you- I know you love it.

[00:38:13] Chris Toomey: I do.

[00:38:13] Michael Chan: You have a talk where you talk about- you have this term, the fracturing of clients. And you you you build up that this is kind of the case of like why we need tools like GraphQL. Um, could you could you explain that a little bit more? Uh, tell me what the fracturing of clients is and like why that's leading to uh tools like GraphQL.

[00:38:32] Chris Toomey: Sure. Um, so, as uh the applications and the platforms that we're building have gotten more and more complicated over the years, we're seeing different clients like an iOS mobile client and an Android mobile client, and then there's the web app. Uh, but then a lot of the clients that I've worked with have even had a bigger splitting where they'll also have an admin backend, which now they've they've built as a separate app and it's just hitting the same API. And uh, so we end up with sort of 3 is kind of a minimum number of clients or front ends or interfaces, if you want to call it that. Uh, but that number actually scales pretty aggressively. And so if you look at a company like Airbnb, I could see them having sort of 3 fundamental user sets between the people who are have something to rent, the people who want to rent something, and then their admin team. Uh and then maybe there's even another one. And then each of those might want an iOS app, an Android app, and uh and a web app. And so, as you have that, we get this— um yeah, the fracturing across each of them and needing to reimplement the same logic across all of them. And then fundamentally what you run into is the API that's backing that is just gonna struggle. And so Facebook uh did the the Facebook thing and they thought about it really hard and they threw out all the best practices and then they came up with something that at first glance seems heretical. Uh and then as you poke at it more, you're like, oh, actually this makes a lot of sense. This uh there there's some good stuff here.

[00:39:58] Michael Chan: So one thing that I I really liked is in a recent episode of The Bike Shed, um uh I'm not exactly sure, but I will link it in our show notes. Uh you were talking about the experience of working with GraphQL. And you were in, I think, a Python app. And it didn't have- GraphQL was not part of the process. And so, you you were using REST. And you you said something that kind of resonated with me. This idea of like designing an API versus just exposing new types. Mm-hmm. And how that allows you to effectively decouple from from the backend. Whereas you have to work in this REST app, you had to work very tightly with the backend developer. Um, tell me a little bit more about that experience and how that's freed you up to kind of like decouple yourself from your teammates and um just do- I guess get further without having to uh interrupt someone else.

[00:40:50] Chris Toomey: Right. Um, so, fundamentally, uh and there was a wonderful episode I think 2 back on this podcast with Eve Porcello talking about GraphQL generally. Um, so, that's a great foundation if folks are less familiar with it as as a technology, but uh with GraphQL, you have one API endpoint, you have one graph. And so, your all of your queries come into that. And what ends up happening is instead of having uh different endpoints for each of the different resources, you just have that one spot that you enter. And then as a client developer, I can query into the available data as much as I want. So- Mm. You know, if we're thinking of Facebook, uh I can look up a friend and I can see the events that they're going to, and I can see each of the people that are going to that. And all of that in one query. So, the person who's building out that API backend doesn't need to think about, well, do they need this extra data when they query it? Do I want to, you know, inline this other data? Um, actually, the GitHub uh REST API is a perfect example where for the repository, so they're, you know, describing this is the name of the repository and the URL and this is the language. They've inlined the owner. So, who is the person who created this? Oh. And all of the data, like I think there's 15 or so fields about the user who created that repository that's inlined into every one of uh the responses for a repository. And it's so interesting because that that was a purposeful choice they had to make. And every single request now that gets a repository is burdened by that extra data, even though they may not need it. But there's also stuff where that owner field doesn't actually have everything I need about the user. And so, the the app that I built in the conference talk, um it ended up running into that where I was getting all of this extra data, but it turned out I needed another thing about the user that was not present in there. And so, via the REST API, there was just this explosion of uh requests that I would need to make in order to build out this um this user interface that I wanted. And I think that's that's one of the things that really caught me about GraphQL is when we're thinking about product, we're not thinking about the different resources or the different- Right. —how we're thinking, what's the database table or anything like that. We're thinking about the workflow that a user wants to have. And often that's going to span multiple different um pieces of data within the system. That's almost a given on any page these days. And GraphQL just meets that exactly where it is. Uh it's actual- as far as I understand it, the origin story was to build the newsfeed for Facebook mobile. Mm-hmm. And so they realized that like we've got all this interconnected data and we really want that team to be able to move more quickly without needing lots of backend changes. And so they built this thing, GraphQL, where that team can just query for whichever pieces of data they need. Certainly constrained within a certain subset and actually really well-defined with a type system. There's other wonderful things that fall out of that. But fundamentally, that team was now able to just go off and say like, oh, you know what, let's get another field, let's add another thing, let's get an associated resource. And for that associated resource, we just want these fields and be able to iterate over and over without needing to have that conversation. That all said, the one of the other things that's really interesting to me is with a GraphQL API, you still will have conversations with the, you know, the front end and the back end team meeting But because there's only the one graph, because you're you're not building API endpoints that serve data for you know describing a resource, you're actually describing your platform as a whole. Those conversations, when you do meet up, they tend to be much more foundational. They they tend to be like, what's true about our products? And I love those conversations. We're not we're not talking about how to serialize JSON anymore or should we sideload or not sideload, or should we include this? Is the overhead of this field worth it, or would another request here- And we actually don't need to care about performance quite as much either, because when you take what used to be 10 API requests and boil it down to 1, even if that 1 takes twice as long or 3 times as long, you're still better off just as the like base case. So the the nature of the conversations are, A, you're able to not have a lot of them, and that's kind of wonderful. But the conversations that you do have are much more meaningful, much more impactful. Uh, whenever I think of adding something to a GraphQL API, I think of it as an investment as opposed to the sort of one-off change to serve this page that needs a thing. You are investing in the the formal description of your platform via this API. Uh, that's cool. I like that.

[00:45:12] Michael Chan: Yeah, yeah. Now, the adding experience is great. But what has your experience been with the modifying a field, modifying a type. How has that been as as the application uh needs change, as product needs change?

[00:45:27] Chris Toomey: Uh that's as the story again, in my mind, is actually fantastic because with GraphQL, you can add as many fields as you want, uh say to any type or any associations or anything like that. The addition of new fields is essentially free. You can you can do that, especially if you build that out on the backend in a lazy way such that the computation or the query lookup or whatever it is will only happen if someone requests that field. Mm-hmm. It means that you can keep building this out and not affect existing clients. So whereas with a REST API, if you add a new field, every consumer of that endpoint now has the burden of those extra bytes of this extra field that they didn't necessarily expect. But with GraphQL, you only get what you ask for. And so therefore I can expose another field. I can add on repository, I can connect it to the user and then for user I can say, oh, we also need to add their location. That's a new thing. I can add that into the types definition within GraphQL and not affect any existing client. But now moving forward, any client that wants to is able to pull that additional data. Uh, occasionally we'll figure out that we modeled something not uh in a perfect way. And so what's interesting there is, again, with REST, you have no ability to know who's using what. You know which endpoints are hit, but you don't know what fields within that. So, you kind of have to operate on the conservative estimate that every field is used. And therefore, that's why you see V1, V2, V3. Mm-hmm. But with GraphQL, you actually can tell who's using which fields because they have to ask for them. They have to explicitly say, I would like the name field on a user. So, you know, these 10 clients are using the name field. And so, you can explicitly deprecate a field, and that's a way to communicate out to people sort of automatically, but then you actually know which clients are doing it. You might be able to reach out to them if they're internal teams and say like, hey, you folks need to migrate off that field. We deprecated it. Like, seriously, please, in the next sprint, move off of that field. We gave you a new field. So, I think the story is fantastic, frankly.

[00:47:24] Michael Chan: Interesting. So, it it it changes it from this global like, hey, we've we've remodeled the API. It's going from V1 to V2 or, you know, V3 or whatever. To, hey, we moved to this field and you need to kind of like get on board with that, with that move by X date. But it's less like a big- a whole big move and more like, hey, this this this one thing changed.

[00:47:46] Chris Toomey: My understanding is Facebook's GraphQL API, which they've been doing this longer than anyone as far as I understand it, uh serves thousands of different clients. So all the different versions of iOS and Android apps that are still out there and haven't been updated, different web apps, the ads manager is a different application. There's lots of different facets of that same fundamental data at the core of Facebook's platform. And it is all served by one GraphQL endpoint. Everybody shares the same view of the world and they continue to support all of those moving forward. So, there are old versions of, say, Android apps that will just possibly never update, but they don't want to break. They want to keep that thing working and they're able to by virtue of, you know, some of these features of GraphQL.

[00:48:29] Michael Chan: That's amazing. Well, we are uh quickly approaching an hour and I just love talking to you. I could talk to you all day. But I just want to give you a couple minutes. Um, how can people find you, find your great work online?

[00:48:41] Chris Toomey: Sure. Uh, well, I'm Chris Toomey, uh, C-H-R-I-S-T-O-O-M-E-Y on Twitter. Um, I have a blog, which is ctoomey.com. Um, I host the Bike Shed, which is @_bikeshed on Twitter. And then we have Upcase, which is uh still around, although it's free now, which is even better than how it was before. Uh, so we have lots of content around um workflow, Vim, tmux, Git. Uh, I talked a lot about those things on there, but we also have a lot around testing, Rails fundamentals, uh just clean code and organization and all sorts of different topics. Uh years of content built up on there. And again, all free and available. So, uh between all of those, I think that that's most of what I have out there in the world.

[00:49:23] Michael Chan: Awesome. Well, I cannot recommend uh the Upcase content enough. I found it was it was transformative for me. There were some things that I just never understood until I went through some of your your courses. So, like even things Things like uh like grep and uh like tmux, like I never under- like could see the value uh or had enough mental space to get there. And you just have such a clear way of of walking through like the why and kind of getting to the how. And uh and I love it. So, I recommend if you're looking for workflow improvements, definitely go there. And uh there's such a a great amount of content. And the bike shed is amazing. I mean, I could gush over over the stuff you produce all day.

[00:50:05] Chris Toomey: Well, thank you.

[00:50:08] Michael Chan: Do you have any, I guess, like kind of final recommendations for people who are who want to get into any of the things that we talked about today?

[00:50:15] Chris Toomey: Yeah, I think uh coming back to my recommendation, uh learn Elm if you want to learn TypeScript. Uh and also learn TypeScript. It's good. Uh and spend some time with GraphQL. It's by far the best first experience for any developer tool Just like opening up GraphiQL and poking at an API and suddenly realizing that you deeply understand this tool that you've never heard anything about before is a magical transformative experience. So, give that a shot. And then from there, my experience is everyone who tries it is just like, oh, okay, obviously this is the way we build APIs now. So, let's do that.

[00:50:45] Michael Chan: Awesome. Well, we will link all of those in the show notes. We will link uh your talks that we mentioned, which are also excellent introductions to TypeScript GraphQL. And React and how they all work together. Uh Chris, thank you so much for being on the show today.

[00:50:59] Chris Toomey: Thank you very much for having me.

[00:51:00] Michael Chan: Thanks, Chris, for sharing your pragmatism and enthusiasm with us. I really appreciate your insights. Get links to Chris's terrific talks in today's show notes at reactpodcast.com/64. Thanks to our 2 amazing sponsors, Linode and G2i. Get your ideas off your local machine and into production with Linode. They've helped me build several of my businesses and I'm so grateful. Visit linode.com/react today and get a $20 credit. That's L-I-N-O-D-E.com/react and get a promo code automatically applied. Gets you $20. Now, if you're not looking for servers, but you are looking for a qualified, proficient React or React Native developer, that's where you go to G2i. Don't waste any more time trying to find the perfect developer when they're ready and waiting for you at G2i. Visit g2i.co today and find developers that are already experts in your stack. Find your next developer at g2i.co. This episode of React Podcast was edited by Mikael Delport. It was produced by Mikael Delport and Sarah Jackson. You can find React Podcast on A network to help designers and developers level up. Visit spec.fm to find other shows that will take you further in your career. Help us out by reviewing this show on iTunes. Your reviews help the show grow and help us ensure great guests and awesome content week to week. To join the discussion, visit reactpodcast.com/chat or follow us on Twitter @reactpodcast. I'm @Chantastic. To stay out of the discussion but get updates, visit reactpodcast.com/news and sign up for emails. Thanks so much for giving us your attention. We'll be in your ears again next week.