Weāre back with another spicy YepNope debate! This time, Amelia and KBall are arguing that thereās real value to (continue) using React in 2022, while Amal and special guest (and author of the post which stemmed the whole debate) Josh Collinsworth argue that Reactās time leading innovation has passed. Of course, the stance each panelist is taking is assigned ahead of time. Is that how they really feel? Tune in and find out!
Featuring
Sponsors
Square ā Develop on the platform that sellers trust. There is a massive opportunity for developers to support Square sellers by building apps for todayās business needs. Learn more at changelog.com/square to dive into the docs, APIs, SDKs and to create your Square Developer account ā tell them Changelog sent you.
DEX: Sort the Madness ā Join our friends at Sentry for their upcoming developer experience conference called DEX: Sort the Madness. This event will be in-person in San Francisco AND virtual on September 28. This is a free conference by developers for developers where youāll sort through the madness and look at ways to improve workflow productivity. Learn more and register
Fly.io ā Deploy your apps and databases close to your users. In minutes you can run your Ruby, Go, Node, Deno, Python, or Elixir app (and databases!) all over the world. No ops required. Learn more at fly.io/changelog and check out the speedrun in their docs.
Sourcegraph ā Transform your code into a queryable database to create customizable visual dashboards in seconds. Sourcegraph recently launched Code Insights ā now you can track what really matters to you and your team in your codebase. See how other teams are using this awesome feature at about.sourcegraph.com/code-insights
Notes & Links
Chapters
Chapter Number | Chapter Start Time | Chapter Title | Chapter Duration |
1 | 00:00 | Opener | 00:29 |
2 | 00:29 | Sponsor: Square | 00:44 |
3 | 01:13 | Intro | 00:50 |
4 | 02:03 | A hoy hoy! | 02:05 |
5 | 04:07 | The setup | 03:56 |
6 | 08:03 | Josh's opener | 02:07 |
7 | 10:10 | KBall's opener | 02:39 |
8 | 12:50 | Amal's opener | 02:15 |
9 | 15:04 | Amelia's opener | 01:53 |
10 | 16:57 | A (musical) Remix | 01:25 |
11 | 18:22 | Sponsor: Sentry | 02:34 |
12 | 21:12 | Speaking of hot takes... | 01:10 |
13 | 22:22 | KBall calls out | 01:11 |
14 | 23:33 | Amal rebuts | 02:31 |
15 | 26:04 | Amelia responds | 02:10 |
16 | 28:14 | Josh drops hot takes | 04:14 |
17 | 32:28 | A new debate erupts | 05:26 |
18 | 37:54 | Closing statements | 03:19 |
19 | 41:22 | Sponsor: Fly.io | 01:54 |
20 | 43:17 | Sponsor: Sourcegraph | 01:18 |
21 | 44:47 | Let's get real | 02:28 |
22 | 47:15 | TypeScript talk (why?!) | 06:22 |
23 | 53:37 | The framework hype cycle | 01:36 |
24 | 55:12 | The framework org structure | 04:40 |
25 | 59:52 | How could React save itself? | 01:34 |
26 | 1:01:26 | A bye bye! | 00:28 |
27 | 1:01:54 | Outro | 01:07 |
Transcript
Play the audio to listen along while you enjoy the transcript. š§
Hoy-hoy, internet friends. Itās me, Nick, on your favorite podcast, JS Party. Weāre here with another very exciting Yep/Nope debate episode. With me today is Amelia Wattenberger. Amelia, whatās up?
Hey-hey! Nothingā¦
How are you doing?
Iām good. How are you doing
Iām doing fantastic. Iām not part of this debate, so I get to reserve my thoughts, until the end, I guessā¦ So thatās great. And also joining is Amal. Amal, howās it going?
Hi, Nick. Very excited to be here, and I hope to not make too many enemiesā¦ This is just a TV show. Thatās not a TV show, itās like a podcast, but I stillā¦ You know, weāre actors, everybody, soā¦
Yeah. Sometimes actors have to play parts that they ā that isnāt their character.
Right, right.
Well, weāre glad youāre hereā¦ And also, Kball. Kball, howās it going
Nope. Nope, nope, nope, nope, nopeā¦
I think we know which team youāre gonna be onā¦ Team Nopeā¦ And we have a special guest this week, and kind of the man behind the premise of the entire debate, and that is Josh Collinsworth. Josh, howās it going?
Itās good. And let me just take this opportunity to say āYep.ā [laughter]
Now I know what team youāre on. Josh, why donāt you tell us a little bit about yourself
Sure. Iām a senior frontend developer at Shopify currently. Iāve been doing development for a few years now. Before that I was a graphic designer, and people told me āYou should learn codeā, and Iām a people-pleaser, so I didā¦ But really, I actually ā I just really like it. And in my spare time I enjoy technical writing and blogging. Iāve written some for CSS-Tricks and a few other publications.
Recently, I wrote a post about React, that was just a collection of some thoughts I had at the time, and I definitely didnāt expect to get any kind of popular, but itās kind of prompted us all to be here today, in a wayā¦ So this will be interesting, and I too am hoping not to make too many enemies after today.
[04:05] [laughs] Well, yes, it is a very interesting article. I was very excited to read it. Itās called āThe self-fulfilling prophecy of React.ā Weāll have a link to that in the show notes. So that is kind of the premise that we have here. For those of you that are new to this format of episode, what this is - itās a debate episode; we call it Yep/Nope. Kind of based on the Alex Sexton Yep/Nope kind of feature detection library for JavaScriptā¦ And the premise of todayās show is going to be āIs React only great at being popular?ā
Debating that very loaded premise, weāre going to have team Yep, which is going to be Josh and Amal, and then debating against that is going to be team Nope, Amelia and Kball. And Iām just in the middle, moderating thisā¦ My first time moderating, so I immediately loseā¦
Nick is on the fence. Thatās what you are, youāre on the fence. You get to be Switzerland, you know?
Exactly.
You get to be everybodyās friend.
Iām coming out of this employable.
And also everybodyās government, you know?
And possibly everybodyās enemy? [laughter]
Yeahā¦ Also, did you say this was Alex Sexton was the inspiration behind this? Because I got to work with him for a little while. I didnāt realize that.
Yeah, just the name, the Yep/Nope from his feature detectionā¦
Yeah, such a small worldā¦ Thatās cool.
Yeah. So the format of this is going to be Iāll be the moderator, Iāll be enforcing some time constraints, and each of you will have two minutes to make your case in this first segment. Weāll start with ladies first, and weāll go ā Iāll give you two minutes, and Iāll start a clock. And then when itās over, I will play this sound. [wut?] I will probably play it a couple of times, because it is very easy to talk over poor b0neskull as a buzzerā¦ That will be the buzzer. Youāll have two minutes to make your case, and then weāll move on to the next person, and weāll kind of go through everyone there, and then we will come back in the second round for some more rapid-fire rounds. And then, of course, at the end - weāve all been assigned viewpoints on this, and so that doesnāt necessarily reflect where weāre atā¦ So in the third segment we are going to talk about what we really feel about React in generalā¦ So stay tuned for that. Donāt dislike us from just the first two segments.
Yes. If you only listen to the first bit, you might hate some of us. But like every engineering question, thereās probably nuance.
If you give it till the end, you might just hate all of us.
Yeah, thatās true. And Iāll take that, okay? If by the end of this show you still hate everyone, then you know what - thereās nothing we can do.
We did our jobs.
Weāve done our jobs, right. [laughter] Also, Nick, who gets to go first? Iām glad that you said āLadies first.ā
I did.
I was like āWaitā¦ Thatās awesome. But that means I have to potentially go firstā¦ā Iām just hoping ā can I punt this to Amelia?
Okayā¦
Because Iām thinking, you know, Amelia, Amalā¦ You know, her name is longer than mineā¦
Youāre the positive premise. I think you should go first, and lay it out there.
Oh, goshā¦ No, I think that youāre the status quo, and so you should go first.
I was also thinking, can āLadies firstā be āLadies choose who goes first?ā [laughs]
Oh, I like that, yeah.
You know what - sure. We can do that.
Yeah. I choose Josh to go first, then Kball. Thanksā¦ Good job, Amelia.
[laughs] I like that.
Josh, it is your article, so if you are prepared, I will put two minutes on the clockā¦
Okay.
And you can start.
Alright. This feels like it should be easy, because basically all Iām doing is summarizing the article that I wrote.
[laughs] Yeah, you cheated. Dang it! Well, actually, is there like a soundboard? Are we gonna have ā you know how the boxing matches have that āDung-dung!ā Is there gonna be a dung-dung?
I have a Wut. [wut?]
Okay. But is there like a start, like ā okay, itās fine. Iām gonna stay quiet now. Iāll let you press the buttons.
Alright. Yeah, Iāll make some sounds up as we go, and Iām sure Jerod can fix it in post. [beep]
[08:02] So weāve kind of reached this point in tech where React is more or less the default choice for any given project. Itās reached that critical mass where it feels like the safe default for everythingā¦ But thereās any number of criteria, from performance, to bundle size, to onboarding, to just complexity, dev experienceā¦ All of these things are areas in which React doesnāt really win on its own, generally speaking, in which there are better options. And when you kind of zoom out and look at the big picture, you kind of realize React is pretty mediocre at just about every given category, and the only category it really excels in is just being the thing. Just being the popular thing. The one that we all know, and the one that people hire for, because itās what they teach, because itās what they hire for.
So whether itās performance, React is not coming out on top. Bundle size - probably not. It is certainly far more complex to use, it has a lot more gotchas to learn than the other frameworks doā¦ Some people point to the unopinionated nature of it as a benefit, and thatās a little more subjective, I guess. For me, that leads to a lot of fragmentation, and spending a lot of time looking for a solution, when I just wish āMan, there should just be a solution. It should just be handled for me already. I shouldnāt be spending my afternoon looking at ten different libraries and reading comments on the internet. Donāt make me read comments on the internet to choose things. I donāt like doing that. I do enough shopping onlineā¦ā
So I guess thatās kind of my summary of where Iām coming from with all this. Weāve crowned a winner, but the winner doesnāt actually win at anything.
{wut?] Perfect. I played the sound three seconds early. That was a perfect opening statement, so nice job, Josh. Alright, now, on team Nope - thatās Amelia and Kball. Amelia, would you like to pick which one of you goes first?
Yeah, Iād love to. I feel like Kball is a really solid opening act for us.
Sounds good. Kball, take it away. [beep]
Alright, so weāre gonna talk about a little bit of this, but Iām gonna talk about one of the things thatās downstream of popularity. When you are popular, you have to handle all the different cases. So you cannot necessarily focus on one thing to the exclusion of others. You highlighted all these different categories you might be considering as a point; and if all I care about was absolute performance, Iām gonna ship static HTML. The problem is that only works so far. It works for a few problems, and each of the frameworks that youāre talking about may excel on one dimension. But when youāre building an application to sell, youāre gonna have to take into account all those different dimensions.
So I would posit that being above average - which I think calling React mediocre on these factors is really pretty pitiful. They may not be the top on very many of these factors, but they are above average for your choices along every factor that youāre going to have to consider as a developer. And for that reason, when Iām looking at the future and trying to preserve my options, they are a top choice.
I would like to highlight a couple of thingsā¦ In your article you looked at State of JS survey. I also looked at the Stack Overflow survey, and I would note that React has an 84% satisfaction, which is higher than Vue, almost two times higher than Angular, not far behind Svelte, with way more usage. Like, two times more usage to almost 25 times more usage across these. So if React were only being used because everyone is doing it, youād expect with 80% of people in the survey you reference using it, it would be getting way lower scores.
Now, Iām gonna highlight a couple particular features. So hooks are one. Hooks are genuinely great. And sure, most frameworks now have hooks, or hook-like features; I love the Composition API in Vue, donāt get me wrongā¦ But letās be honest, none of that would have happened without the React team paving the way. Hooks was still first, and the implementation in React is still pretty amazing.
[12:04] Thereās also the factor of stability guarantees. So other than possibly Ember, whichā¦ [wut?] What?! Iām like a third of the way done. Okayā¦ Weāre gonna have another couple of rounds of this going on, soā¦
Oh, yeah.
ā¦you have only begun to witness the ways in which React is far more powerful than just being popular. [laughter]
Objection. I think the court should overrule that. We have to retract the statement. Anything after the first wut should be removed from this transcript, or whateverā¦ I donāt knowā¦
It shall be stricken from the record at the editorās behest. [laughs]
Thank you, thank you. No, itās fineā¦
Which means itāll probably still be there.
Itāll probably still be there, yeah. So, okayā¦
Yeah, now it is your turn, Amal.
It is my turn? Ding-dingā¦
[beep]
Okay, you have to start the clock from now, okay? Iām losing timeā¦ Okay. Well, you know what, Kball - that was a very interesting take, and Iād say the word āmediocreā is subjectiveā¦ And I would say React has done a phenomenal job of paving the way, and I think pushing us forward as a community to think about components. And those are all great things. However, 2013 is when it came out; and in JavaScript years - you know, weāre in 2022, so React might as well be going into its grave, right? So weāre the community of innovation on the webā¦ Youāre either moving forward or youāre dead in JavaScript, right? So we are the innovators, and quite frankly, React has been over-innovating in some areas, and under-innovating in othersā¦ I think by trying to kind of have this API - like you said, itās this wide reach, itās used and itās popular etc. Well, guess what happens when youāre trying to appease everyone, and when you have one core library thatās the base for so much? It means youāre doing lots of things in a mediocre way. And some things well, most things not so well, right?
So when youāre thinking about your API design, you have to be intentional, and as a library author you have to kind of resist the temptation; like, do one thing, and one thing well. And I think React kind of lost the story when it tried to reinvent JavaScript engines in the browser, quite frankly. Thread management, scheduling, concur, this, that and the other thing. I think when they first rolled out some of those features, Facebook.com had bugs. Every abstraction in the web has a cost, and React for me is just too much of a cost at this point. I canāt justify their cost. The only kind of case where I would consider using React in 2022 for a new applicationā¦ [wut?]
Iām gonna cut you off right there, right at the perfect cliffhangerā¦
I was trying to target multi-platform users, you know? Thatās about it. [laughter]
You didnāt hear that. You didnāt hear her perfect case for itā¦ Stopped right thereā¦ [laughs]
Alrightā¦
So, we have one more, and that is Amelia. Amelia, do you wanna have your Nope opening statements? [beep]
Yes. So first of all, Nope. Second of all - so we always talk about how React is super-unopinionated. And as a veteran of the framework wars of 2015, I just wanna say we donāt want to go back there. It was exhausting having a new framework every single week. Life is much better under the benevolent monarchy of React. Like, isnāt it nice to have one framework that works pretty much everywhere? And thereās a libraryā¦ Hey, I want a library that has a 3D rotating globe with lines on it. You know what? You jsut google it, itās there. You pull it in. Pretty easy. Life is good. Do we really wanna go back to life before React?
[15:52] Another argument is if weāre gonna have one ruling framework, donāt we want it to be unopinionated? So React is really nice, because itās basically just a rendering library with a minimal state management solution. Thereās so many other things that build on React, that kind of make it equivalent to other frameworks. So even if you think about meta-frameworks, there have been so many popular ones. I think when it came out, there wasnāt one, and then there was Create React App, and Next, and Remixā¦ And there are ways to have a more opinionated React ecosystem, but youāre not really forced into any of them. So if, say, Svelte or Vue or Angular were the benevolent kind, would that really be better?
And then the other thing I wanna say is if you look at the State of JS, the chart we keep mentioning, I think the X axis is satisfaction, and the Y axis is popularity or their ver- [wut?] Dang it! Iāll get back to thatā¦
Thatās kind of like the remix to that song āI canāt get noā¦ Doo-doo-dooā¦ā You knowā¦ I thought that there was gonna be like a remix of thatā¦ But anyways, thatās fine.
Satis-wut-ctionsā¦
Next time.
Speaking of Remix, you yourself are making React references here, talking about Remixā¦ You talk about React being down, but youāre bringing up Remix!
Oh, please. Iām talking about musical remixes, not frameworks that think theyāre DJ songs. No. No. [laughs]
Well, speaking of remixes, we are going to remix this argument in the next section. But first, we have to close out this one. So weāve heard the opening statements of all four of our contestants, and honestly, theyāre all really compelling arguments. I was told that I have to assign points though, and so Iām doing my collating right nowā¦ And yes, the winner of the first round is Jerod, because heās not here. So congratulations, Jerod. [laughter] Weāll see you in the next roundā¦
Such a Swiss man, Nickā¦
[laughs] He wins every one of these, and so we have to continue thatā¦ [laughs] Alright, weāll see you in the next round for more rapid-fire discussion.
Alright, so weāve heard the opening arguments of each of our contestants. Weāve made our preliminary decisions about whoās right in this premise, āIs React only great at being popular?ā What do you think, audience? Be sure to write us and let us know. Stop right here, write in. Donāt wait till the end of the episode to come to a conclusion. We want your hot take right now. Speaking of hot takesā¦
Changelog Slack! Come into the Changelog Slack.
Thatās true.
If youāre watching on YouTube, Changelog Slack! Hot takes, right now, in the JS Party channel.
Kball is way better at doing these plugs than I am, so I appreciate that, Kball. Alright, speaking of hot takes - weāre going to continue this discussion with a rapid-fire round. Weāre going to go and do a one-minute round each, and at the end of the minute, if you have tagged someone, or if you have called someoneās argument out, they will get a chance to rebut it as well. So weāre going to do this ā weāll start with one minute, andā¦ Where should we start? I donāt know that thereās a specific place to start hereā¦ But letās start with Kball. Kball seems to be chomping at the bit.
Yes. I want to call out Amal, with her āWe are the innovatorsā approach. On the one hand, your argument, āWe should be moving to more innovative frameworksā, and on the other hand youāre arguing the fact that React is trying to push us forward in some of the biggest gaps around web development. Like, how to handle asynchronous data fetching, and interactions with your rendering pipelines. Lack of threads and prioritization. These are the things that we need innovation on, and React is the framework that is doing it.
And sure, if you donāt need that function now, use something that doesnāt deal with it. If you donāt need interactivity, build something with raw HTML. If you donāt need to worry about data fetching ā oh, waitā¦ What are you building where you donāt need to worry about data fetching? We all need to worry about data fetching if weāre working in a JavaScript framework. And yes, I agree, suspense is weird. Iām deeply skeptical of throwing promises and all of that stuffā¦
Theyāre weird, tooā¦
ā¦and yet, it is attacking a very real problem that every single one of us has, where most other frameworks have just kind of thrown up their hands and said āHey, itās the userās problem.ā So Iām withholding judgment about whether Suspense in particular, as itās implemented, will be the solution, but this is another place where again React is pushing the world of frontend development forwardā¦
Objection!
ā¦making things better for developersā¦ [wut?] And we are the innovators!
I object! [laughter] Okay, Iām gonna go ā and I want a bonus 30 seconds, becauseā¦ Okay? Bonus 30 seconds starts nowā¦ Kball, I appreciate that rebuttal. So I have to remind you, that innovation should not be happening in JavaScript land. We need to push browser engines and JavaScript engines and rendering engines to be better. However, we also need to curb our enthusiasm for JavaScript. I donāt know, weāre shipping tons of JavaScript. I know, letās just use JavaScript to manage JavaScript. No. Like, how about we just ship less JavaScript? ā¦which is where all of the thought leaders within JavaScript are pushing us towards. Astro, Svelte, Vue.
[24:15] Secondly, I wanna go to Ameliaās point from earlierā¦ Amelia, you said āOh, I really love this land where I have interoperability, and things just workā¦ā And yes, I get it, weāre in the golden age of not having to change our framework every week. Thatās exciting. But guess what - you also just donāt have to change your framework every week if you use web primitives. I donāt knowā¦ Like, Web Components. Maybe all of our reusable thingsā¦ Maybe that button, and that dropdown list, and that calendar icon, or calendar date picker thing that we have to reinvent every time thereās a new framework - maybe that should just be written in the base primitive.
So I think we need to rethink the way our APIs are shaped. We need to rethink about whatās reusable, whatās composable, whatās something that I should write once, for real, only onceā¦ And we need to rethink what is it that weāre using our JavaScript frameworks for. [wut?] And frankly, React is just a confusing API now. Itās lost its luster, and for me itās just way too much complication, and I can get more bang for my buck anywhere else.
Mic dropped.
Mic dropped, yes. Mic drop sound.
Yeah. That was a fantastic rebuttal.
Itās also about thisā¦ [Web Lovers] Okay? Iām a web lover. I love the web. I have to think, is React really good for the arc and the health of the web? I donāt know, kids. I donāt know. Do you really wanna come back to a React application in ten years and have to figure out how the hell to run all those build tools and how to updateā¦? No. Simple is good.
My grep file is doing just fine, thank you.
Yeah. Well, Iām just saying, you know? We have lost our taste for simplicity, because I think people are hungry to solve problems, and they donāt realize that weāre over-engineering the wrong things. Iām just putting it mildly and simply.
Amelia, your response.
Alrightyā¦ So my first response is that one of the beauties of React is that it has a really low floor, and a really high ceiling. So with the low floor - you donāt need to ship JavaScript just because youāre building something with React. You can ship a static HTML page; itās just that your developer experience is way nicer than just writing HTML. And then with the high ceiling, going back to āShould we be experimenting within the core web functionality?ā, which Iām not sure I totally buy that. I feel like if weāre gonna be innovating and experimenting, it should be on a framework that people put on top of web technology, instead of in the coreā¦ Because we know, first of all, thatās really slow; second of all, it has to all be backwards-compatible, so if you add something to browser engines you canāt take it out really, so youāre stuck with it. So if youāre gonna be experimenting, then Iād say it should be in React instead of the browserā¦ Iāll leave it at that.
Youāre so polite, Amelia.
You can continue if you want.
Nick wants to get his wut out.
I was gonna go back to this stupid thing I was mentioning earlier, with the ā
[laughs] Gloves offā¦
ā¦the popularity versus satisfaction cycleā¦ And I was just gonna finish itā¦ [laughs] Donāt wut me.
Wut?
Itās just that ā itās just like a cyclical thing, right? When something isnāt super-popular, the people using it donāt have to use it, and so it goes up in satisfaction. And then it gets more popular because more people are satisfied with it, and theyāre talking about it. And then it starts going down in satisfaction, because everyone has to use it at work. And thatās usually one hypecycle. And I feel like because React has been around since ā did you say 2013? Itās amazingā¦
React is like corporate enterprise JavaScript now. Itās like the base stack for every new companyās thingā¦
It is.
Right. But if itās at that point of the hypecycle, itās amazing that itās still so high up in satisfaction, as opposed to all these other new frameworks.
Preach.
[28:07] Very well said. We have one more guest to get their hot take onā¦ So Josh, do you wannaā¦?
Alright, Iām gonna go all-in on this one.
Good, because the timer is just up in the airā¦ You just go.
Do you know why React is so high in satisfaction? Because itās so complicated to use it makes you feel like youāre a total ninja when youāre using itā¦
I feel called out.
ā¦when really all youāre doing is using ten lines to solve a two-line problem. It makes you jump through so many hoops that you feel like youāre on American Ninja Warrior, reaching the top of that giant thing, just for writing a little bit of codeā¦ When really, they made you do this; this was just solving a web problem.
I also wanna call out the āWe donāt need to go back to whatever bad time beforeā¦ā We donāt want to go back. Nobody says weāre going back. Thatās the opposite of what we want. We want to move forward. React is firmly entrenched in the past. All of those decisions that were made nearly a decade ago are still in place, they are still having reverberations, and we have moved long since past then at this point. We donāt need JSX for anything, letās just be honest.
[singing] We donāt need JSX when weāve got HTMLā¦ Or string templates in JavaScript!
Give me a chance to rebut this one, pleaseā¦
Go for it.
It is a kludge. It is clumsyā¦ It is just a way to shoehorn HTML somewhere that HTML should not be
Label fourā¦
Yeah, HTML 4, classnameā¦ I donāt know the difference between props and attributes..
Whatās a classnameā¦?
Iāve gotta have a synthetic event systemā¦
Iāve gotta jump in hereā¦
Jump in.
[laughs]
ā¦because people love to hate on JSX. And there are real trade-offs between templates and templating languages and JSX. But letās talk a little bit about the benefits that JSX brings you. So JSX is ā
Iām sorry, do you just get a new turn now? What is happening? [laughter]
Abso-freakin-lutely, because you brought out the JSX. Now, JSX is a domain-specific language for generating HTML. And if there is one programming concept that is under-utilized in the industry, it is writing DSLs. Domain-specific languages. You can get so much freakinā productivity and communicatibility by moving into a domain-specific language. And what this does is it allows you to bring the full power of JavaScript to bear on your problem, as well as domain-specfic sugar, and help, and a way to talk about and think about things that make sense for rendering HTML. And as much as I do love templates, and I do love templating languages, and I love writing bare HTML, there is a real cognitive load to jumping back and forth between mental models and programming languagesā¦ While JSX essentially lets you stay in the JavaScript mental model throughout. And you can write it in all the different ways you write JavaScript. So if you like writing imperative, stateful JavaScript, you can write imperative, stateful JSX. If you prepare pure functions and composition, and really clean, and beautiful, functional architectures, you can do the same thing with JSX. And this is a huge reduction in cognitive load as you move through parts of the application. This was the key initial insight of React, was you put these things that are conceptually together, together in a place where you can work on them without having to jump context, without having to jump mental models, without having to do all of these different mental gymnastics, and itās a dramatic unlock in terms of productivity and being able to think about it this way.
So you mean if I wanna write an if statement, I can just write on in JSX? Is that what youāre saying?
If you really want to, you can. So yes, there is enough rope to hang yourself, or whateverā¦
I can just do just a JavaScript loop?
Yeah, absolutely. The more power you get, the more footguns you can get.
With great powerā¦
You know what my favorite - and when I say āfavoriteā, I mean favorite-not - feature of JSX is? [singing] Dangerously set inner HTMLā¦ Whatās so dangerous about HTMLās inner parts? I donāt knowā¦ [laughter] But theyāre dangerous on the internetā¦ Of React. Reactās internet, of course.
[32:09] Because clearly, injecting unsanitized data is not dangerous to anyoneā¦
Well, you know what? I donāt really think SQL injection or whatever else is whatās happening most of the time here.
Cross-site scripting is not a problem anymore, andā¦
You know what - this is its own debate, right? Iām just saying, React basically makes it difficult to do anything with the HTML. You have to use JavaScript for everything. JavaScript gets in the way of ā thereās no direct communication between the developer and their HTML.
Itās Atwoodās Law.
Everything is created by React. Like, whatās up with that? React generates my HTML?
Iād also like to point out, since weāre just sticking on this forever now, I guessā¦ 90% of that argument was not specific to JSX. It was just specific to domain-specific languages.
Show me another domain-specific language for rendering HTML.
There are far less clunky ways to do it.
Show me another domain-specific language for rendering HTML.
[laughs]
Mustache? Handlebars? I donāt knowā¦ [laughs]
Liquidā¦
Thatās a templating language. Once again ā
Is this library vs. framework for how we put HTML on the page?
Rightā¦ I would say, to be honest with you, I like ā whatās his face? It has a nameā¦ PX-somethingā¦ Something-PXā¦
So markup languages are useful. Generating a templating language with markup - that is useful, and then you have a separated compiler and integration. But you end up doing a totally different set of thingsā¦ Which - there is a taste aspect there. And there are definitely benefits to templates. The thing you just picked on - dangerouslyā¦
Set inner HTML.
ā¦set inner HTML - that is an example where in a templating language you can actually do a lot easier stuff because of the world youāre in; you donāt have as much flexibility, so you donāt need to put as many controls in place to keep yourself safe. So a benefit of a templating language is you can actually be much more careful about how youāre doing sanitization, and all that, much simpler. But you lose a lot as well. Thereās a lot of things that you might wanna do that are much harder to express in a templating language.
Like the expressiveness stuff, right?
Yeah.
That sounds way too nuanced for this part.
Would dangerously set inner HTML be as controversial if it were just three open curly braces?
[laughs] Oh, I like that. Look at you, Nick Nisi, and your nice API designā¦ I see an RFC coming. Yeah, three curly braces is ā
If I remember correctly, thatās the Handlebarās way of ā just render whatever; just drop what I put in here, and do it.
Just do it! #nike
Yeah. At least the dangerously partā¦ Like, itās called out.
Trust me, I know this content is goodā¦ [laughter]
Trust me, I know what Iām doingā¦
I think it should just be called āTrust me. Do itā HTML.
Do it! Right. Right.
Yeah, the JustDoIt.
I just wanna highlight how good of a point it is that in your article, Josh, you talk about the learning curve for React. And there is quite a learning curve. But at the heart of it, if you know JavaScript, you know pretty much all of React. Like, if weāre using JavaScript instead of a templating language with JSX, you donāt have to look up like āOh, is it āIf#If or ngIfā If you know JavaScript, you know how to conditionally render some HTML, or loop over something. Youāre not going back and forth to the docs and to your text editorā¦ Iām a little bit afraid of the looks youāre giving me. [laughs]
[35:51] Yeah, that was always my argument for React over Angular. I remember thinking āWow, I donāt have to learn about all these pipes and filters, and all these mystical things that are very domain-specific to Angular, for example. JavaScript and React - they are one and the sameā, right? That part was awesome. You kind of have to squinch your eyes a little bit at JSX. Itās like, āI donāt know what the hell is going on thereā, right? And then for me, the hooks ā I mean, I actually really donāt mind JSX, but the hooks API is really where Iā¦ For me, that was the beginning of the end for me. Itās just a very clunky API. I feel like itās difficult to use. People think they know it, but they really donāt.
And for me, this really ties into your point earlier, Amelia and Kball, around learning React. I think Amelia especiallyā¦ So the reason why hooks is a thing - or one of the main reasons - is because people were really confused about this, and the this keyword in JavaScript with React. That was a huge driving factor, because there was constantly community support questions about āWhy is this not working?ā So binding, and managing the this pointerā¦ Classes just were a little confusing for folks. And for me, I wish we could have just kind of really redirected folks towards good fundamentals courses, because I think ā itās one of those things where like, yeah, I really doā¦ I have a hard time saying this, because it feels a little gatekeepy, but I do really think itās important for you to understand the fundamentals of a language, especially if youāre gonna be using it every dayā¦ I think hooks kind of bypassed the need for that.
And yeah, youāve got a lot of other powerful things too, but I donāt knowā¦ Iām not into React anymore. I havenāt been in it ā it feels good to be able to say that out loud, becauseā¦ [laughter] No, because you know, for a while it was hard. It was hard to say that.
Yeah.
We could go on forever here, but I donāt think classes and this was the reason for hooks. I think itās about composability and reuse of statefulā¦
It was a primary driver, from my understanding.
Iām gonna pretend to be the moderator again, and pretend like this was allā¦
Planned?
ā¦controlled very well. Sorry, Jerodā¦ [laughter] So I think that weāve all made great pointsā¦ I donāt even know where weāre at anymore with thatā¦ But to get us back on track, and now that Iāve sufficiently filled the quota for time on this segment, letās go ahead and do a quick 30-second closing statement from each of you, and then weāll move on to the next round, where we can speak freely. Josh, you were about to say somethingā¦ Do you wanna kick us off with a closing statement?
Sure. Iāll just say, the argument was made itās easier for beginners to get into this, because itās JavaScript, whatsoeverā¦ I think thatās a little bit of a stretch maybe. If I see those double N percents, or that map instead of a loop, I donāt know if that necessarily intuitively makes sense to me as a beginnerā¦ But I also wanna point out, we should be careful how much we assign to a beginnerās perspective, and we should be talking to the actual beginners. And in a lot of cases, the beginners do find that that templating is much more intuitive for them, and much more simple and delightful to use, dare I use the wordā¦ [wut?]
Very well said. Kball, do you wanna give your closing statement?
Sure. I will give a closing statement. So I think at this point weāve covered all of the infinitely many ways that React is more than just popular, but I wanna talk very quickly as a closing statement of something thatās downstream from popular; something that popularity enables, but itās not just about popularity, which is the incredible ecosystem you have around React, in terms of documentation, learning resources, plugins, libraries, componentsā¦ You know, if youāre trying to accomplish something in React, thereās gonna be something out there thatās gonna help you do it. [wut?] And that is something that is related to popularity but it is not a guarantee, and it is a distinct and unique benefit that you get with React.
Well said. Alright, Amelia.
[39:49] Alright, so I just wanna point out that I feel like the Yep team has kind of tied themselves in circles and a little bit contradicted themselvesā¦ And I think thatās just due to the tough position that theyāve been placed in, where React is unopinionated, but also itās hard to use, orā¦ I think the fact that itās unopinionated makes it a really, really good majority used framework, where weāve been building on it, itās iteratedā¦ This was really confusing early on, and so they moved to a more functional component type of solution. So weāre not using this and getting confused about it anymoreā¦ So I just wanna say that React is a benevolent dictator; I guess itās changed from a monarchy, but itās okay.
And on that, we will end this segment - well, this debate. Iām really not sure who wonā¦ Jerod did, again. Congratulations for not participatingā¦ And yes, I think that we will all show how we, by our own admission, when we all pretty much go back to our dayjobs of writing React, weāll figure out who won. So yeah, stick with us through the break, and weāll talk about real thoughts on this.
Wait, those werenāt our real thoughts?
They could have beenā¦
Just kiddingā¦ [laughter] I mean, they were mostly mine, butā¦
Yeah.
So that was our debate, Yep/Nope on React only being good at being popular. And of course, as we mentioned in the beginning, Josh and Amal were assigned to team Yep, and even though Josh wrote the article that this whole is based off of, he might have different thoughts on thatā¦ And then on the other side, team Nope, Amelia and Kball were arguing that no, thatās not all that React is popular at. So where do yāall really stand on this?
I feel like I wanna hear from Josh first, because he wrote that articleā¦
[laughs] Yeah, obviously, I wrote the articleā¦ The piece has a lot more nuance than I think you probably heard from me today; I hope that comes through there. And I readily admit that although Iām not a fan or React, I will gladly take it, in many circumstances, if thatās my option.
Well, you use it at your dayjob at Shopify, right?
I doā¦ And Iām very happy at my job, in case any of my bosses are listening.
Back to that corporate severance JavaScript, you knowā¦
If Iām picking, Iām not picking it. I do think that it has probably aged more poorly than a lot of people realize. I do still admit that it is very good, and I think Kball honestly made a great point about the things that popularity bringsā¦ Even if I would rebut by saying thereās a point of diminishing returns with what popularity gets youā¦ But yeah, somebody said weāre in the golden age of frontend, or something like that, and I do kind of feel like that. Itās great that we have these choices, itās great that we have a solid default, even if it isnāt one that I particularly enjoy.
Yeah. And from that default we got into a big tangent about JSX. And kind of calling back to previous Yep/Nope episodes, specifically with Kball, where heās appealing to authority, and specifically appealing to Laurie Voss talking about these ideas that transcend the user land, or transcend the frontendā¦ Well, JSX in a lot of ways has kind of transcended React. Itās used in other places than just React. And my opinion is - I was there in 2013, when Facebook announced it at JSConf, and I laughed at it, and I have a tweet out there that is ā
Not aged well.
ā¦the silliest thingā¦ Yeah. [laughs] And now I really like writing JSXā¦ Specifically TSX, but thatās a different story.
Oh, wowā¦ Oh, my God. Oh, my Godā¦
Iām obligated ā
Like you needed to say itā¦
You cannot get through one freakinā show with Nick Nisi without bringing up his beloved TypeScriptā¦
[laughs] Thatās right.
I will say that TypeScript support is another driving factor for moving to functional models for state handlingā¦ And I have gone from being a place where I was a little skeptical of that level of typing, to I donāt know how I ever lived without it, soā¦
Nickās the only winner today.
Yeah. To go back to that point though, Kball - from my understanding, that was a huge driver for hooks. Like, people just didnāt ā the this context was hard. And then there was also the boilerplate problem, right? Lots of boilerplate. So itās like, okay, how do we take that and allow for more reuse? And so the hooks API was born. But for me, itās a clunky API. Iām sorry. Thereās too many leaky abstractions. Thereās too many implementation details. Iām like, āWhy are you exposing this to end users?ā I feel like I have to really have a deep understanding of the framework internals in order to really not footgun with hooks. And thatās saying something, right? Thatās saying something about your API.
And Iām a seasoned user of React. Iāve been using it since 2013, early days; very early adopter. So if Iām coming here and saying āThis feels weird. This is unnatural and unintuitiveā¦ā For a very long time I felt like the only person in the room that felt that way. And itās hard, you know? It was very hard to be that person. And itās getting less hard.
I will say that I agree with that. It took a long time to wrap my head around hooks. I like them now. I feel like theyāre powerful, and you can do a lot with themā¦ But also, Iāve never used Svelte, for anything, but I have looked at the Svelte homepage, and they just say ālet counter=1,ā and then they say ācounter=counter+1ā later on and theyāre not doing a āuseStateā and then calling a setter to specifically set thatā¦ I like that, but also that kind of scares me, because itās magic.
And have a magical callback array, andā¦
Yeah, there are so many trade-offs involvedā¦ So if Iām gonna step back, if I were doing a personal project right now, it would not be in React.
Same.
What would it be in?
If Iām picking a language for a company, it probably is React. But the Svelte compiled ā like, having it basically go through a compile phase gives you so many nice ways that you can get some of the benefits that you get with hooks, without some of the cognitive overhead of an awkward API. I also love, if Iām honest ā like, the Vue Composition API feels to me like a much more beautiful implementation of the same concepts of hooks. Now, it comes with some its own drawbacks, because you have things wrapped in different ways, and you canāt access valuesā¦ Everything in this has pros and cons, but yeah, hooks is not the most beautiful implementation of the hook concept.
You were highlighting the this conflict again, and I feel like thereās more than just trouble with like the syntax in thisā¦ Because I think where you really run into trouble ā like, I guess React didnāt ever really have this concept of mixins, but trying to compose logicā¦
Very early days it did.
ā¦and reuse it in the class-based model - I ran into that a lot in Vueā¦ It was a nightmare to keep track of whatās going and understand how things are gonna relate with each other, and compose with each other, and all of that, and it was so easy to footgun, and it was just like a really hard mental model. And the hooks model and the composition API in Vue just makes it so much easier to reason about that, and move things around, and compose them. So you were right that thereās an awkwardness to it, and youāre right that part of it was a hang-up with the previous model, but I think that it goes a little deeper than familiarity with the language, and I think it has to do with how do you bring together reusable concepts that interact with state.
Right.
I think itās worth mentioning, to that point - for as unopinionated as React is, it is extremely opinionated about how you handle data and immutability. And I think that has roots in its Facebook origins, andā¦
The Flux architectureā¦
ā¦how they were trying to create something that would help them wrangle the unthinkable complexity of this highly interactive application. And if thatās where youāre at, then maybe that system where you literally canāt touch a variable unless youāve gone through the proper steps first - even that makes a lot more sense for you.
Oh my God, Josh, Iāve never heard thatā¦ Thatās so cool.
I was just gonna say, a hundred percent to Kballās argument, and also to what youāve just said, Josh. I feel like Iām still jetlagged from the Svelte Summit, which was a wonderful conference. I personally really, really love Svelte; for side projects I will 100% use Svelte. Itās just so much fun. Thereās way less boilerplate. Reactivity is so, so nice, and they have built in animationsā¦
Magicās not a bad thing, Nickā¦
I mean, Magic is the opposite of leaky abstractions, you know?
I think a little bit of magic is niceā¦ But not like Angular.js levels of magic; that got a little bit painful. And I think that kind of gets back to - if at my dayjob we need a project weāre gonna hand off, or that needs to be maintained for a long time, I feel like React scales a little bit higher, a little bit more easily. Itās harder upfront, but then if you have the data immutability and ā I think hooks scale a little bit higher. If you had a really large codebase, I feel like it can be a little bit neater in React, especially because all of those things yāall were talking about.
Yeah, thatās a really interesting perspective. I think for me, if I was starting up something for a company, if I had to pick, Iād probably be like Vue at this point. Vue, and then Angular. Angular is very much kind of like a platform, and I feel like itās very good for large enterprises, with lots and lots of developers contributingā¦ Because thereās really good conventionsā¦ You know what I mean? Thereās that kind of batteries-included feel with Angular. Also Vue, a little bit. So I think for me those would be the two. But yeah, definitely not React at this point.
I was just thinking, one other interesting thing was that at Svelte Summit there was some talk of how Svelte isnāt the biggest, and how it doesnāt want to be the biggestā¦ Success for a framework isnāt necessarily more and more usage. Iām kind of really happy, selfishly, with the way things are, with React having such a large market share, and Svelte being this fun thing that I do for projects that are more enjoyableā¦
Yeah. That brings up a question that I wanted to ask in this section, and that is - do you think that this would be the fate of any of these frameworks? If Svelte had come out first maybe, and gotten to the popularity level that React is at, would we all be hating on it just as much? Especially if it was Facebook-backed.
According to the hype cycle that Amelia was talking about, I would say probablyā¦
I think itās reasonable to assume that it takes time for something to become the majorly adopted choice, and in order for it to have been around that long, itās probably just going to necessarily have some baggage from the past, that newer things are not gonna have. So to a certain extent, this is a cycle, and thatās one thing I really wonder about, is what does that next iteration look like? Does React just have a very long tail? It doesnāt seem likely that anything is going to overtake it and be the thing at any point in the foreseeable future, so itās interesting to wonder what does the next era look like, what is the next iterationā¦
Yeah, I couldnāt agree with you more. Hopefully, itās React adopting more from other people, other librariesā¦ But yeah.
I think itās worth thinking a little bit also about the organizational structure that results in these frameworks. Many of both the places where React excels and some of the places where weāre running into friction with it are tied to the fact that it is built still by Facebook, and the focus and optimization choices that theyāre making are for solving the problems that Facebook has. And those problems have a reasonable match with the problems that many corporations have when theyāre building JavaScript applications, but they are definitely off on one hand. And actually, I think you run into some of the same things with Angular. Angular is still primarily driven by what Google wants and what Google needs. So I think that if Angular hit this level ā well, early Angular kind of was really popular, and then went through a lot of this. Now, if you look at the satisfaction, people are deeply dissatisfied with Angular, even though thereās a lot of people using it. React has thatā¦
[56:11] Vue feels at this point much more community-driven. I get the impression Svelte is going that way as well, even the both of those started with a benevolent dictator approach. Theyāve both kind of embraced a broader community, rather than sort of going along the needs of a single corporationā¦ So if they were to get there, they might do better. That being said, that may also make it harder for them to get there.
Going back, old-school frameworks ā like, Ember was one of the first ones here, and they did so many things so well, and were also not backed by a single corporation, and they never got much adoption relatively speaking. Theyāve stayed very, very niche.
Very good point.
Yeah. I think, Kball, your point about Facebook solving problems for Facebook - it really ties back to what Josh was talking about a little earlier too, around like even the strictness and the heavy opinions around data mutation is somewhat inherited from Facebook trying to wrangle its eventing architecture, right? There are so many things happening, having that downward flow, and being really strictā¦ That was something that Facebook needed.
This is something that weāve talked about on the show even recently, Amelia and Nick, in our tech interview discussion we had a few weeks agoā¦ I brought this up, around how these ideas and tools and problems within big tech are kind of proliferated throughout our community, where itās like people donāt contextualize it. Itās like, okay, the problems that Netflix engineers have, and the reason why theyāve created this library - they have problems that are unique to Netflix. Netflix in particular is a company that ā you know, before the Disney Pluses of the world, they were a very unique kind of streaming service that was operating at this scale. They were very alone in that bubble. Lots of people have joined them now, but they were solving problems that are unique to Netflix. Facebook - the same thing, when Facebook was scaling in that way. I mean, come on; itās like the biggest website outside of Google.com. And Google.com is one input box and a list view. Facebook was so ā you know, all these interactive elements, and really a fantastic place. If you look ā I donāt know, for me anyway, I have to close my eyes on the product; if I donāt think about what theyāre doing, like, itād be a fantastic place to work as a frontend engineer, to work at that scale, and have to think about all of those elementsā¦ Itās a huge website.
[58:35] So I think we just really donāt contextualize that enough, and I think for me a bigger concern that I have is the corporatization of all of our open source projects that we love and care about. Quite frankly, everything is coming supported by Microsoft now, or Google, or Meta, or Netflix, or Airbnbā¦ You name it. And these community-driven grassroots projects, like Vue, and Svelte, Astro - theyāre just kind of fewer and in between these days. I just wanted to point that out as just the kind of general smell that I see, thatās happening within our community right now.
I donāt know, corporate projects are great. Theyāre stable, they usually have less bugs, lots of upsides, but at the same time, we donāt really have open governance around the roadmap, at any point they can drop it and stop caring about itā¦ All kinds of reasons why I like community-driven open source; itās usually a better bet. But of course, that also has its trade-offs, right? So I donāt know, it feel like weāre stuck between decisions that itās like āHereās a bad decision, and hereās a less bad decision.ā Whereās the good decisions right now? Itās hard to really make that, I think, for frontendā¦ Seriouslyā¦
Is there anything that React could do to save itself? Like, some kind of reinvention, like Angular to Angular 2. Or would it suffer the same fate?
I think Angular to Angular 2 would destroy a lot of the good will that itās built up by being one of the most stable options out there.
Yeah, agreed. Theyāre too big to fail, in many ways now. Theyāre literally too big to fail, right?
I mean, classes and hooks are not fully interoperable already, right? I mean, I guess you can use either one, soā¦
Thatās true. Wasnāt there like major changesā¦?
Yeah, you do not have to rewrite your apps to upgrade. I did a React upgrade recently, and it was seamless.
Okay.
Thatās a tremendous benefit.
So thatās a bit of a different thing, I guess.
Yeah.
I donāt knowā¦ I feel like Iāve heard rumors that maybe there is some kind of new exploration being done in the hooks realm, to make hooks maybe a little more performantā¦ I donāt know if thatās going to change the syntax, or whatās gonna happen thereā¦
I hear theyāre gonna throw promises nowā¦ [laughter] Iām kidding.
My opinion is that React is never gonna stop being React. I think itās too far down the road for the things that make it what it is to change at this point. Itās built upon a foundation that you canāt really just shift. So I donāt foresee it undergoing a major change, so I donāt think itās ā as much as I hate to use the phrase, I think it sort of is what it is at this point. Iām sure it will continue to improve; itās got a very strong team of incredibly smart people behind itā¦ But I think the core foundation itās built on is bound to stay there.
I think thatās a good place to end it. Thank you so much, Josh, for coming on. Weāll have a link to your blog post in the show notes for people to check out. Congratulations to Jerod for winningā¦
Awesome blog post.
Yeah, definitely.
Thank you for having me.
Yeah, thank you so much for coming on, and thank you to Amelia, Kball and Amal for joining as well and for viciously debating and supporting the sides that were assigned to you. We appreciate it. And we will catch you next time!
Our transcripts are open source on GitHub. Improvements are welcome. š