And welcome to the React Show. We've got a really fun show for you all today. It's a little less heavy compared to last week, but I think it'll be a lot of fun. Yeah, I'm Thomas and I'm with my co-host Austin. We're with Owl Creek, uh high performance React Consultancy. Welcome, Austin.
SPEAKER_00Hey, glad to be here. Thank you.
SPEAKER_02Yeah, uh, and uh as we mentioned last week, um, we now have a way to uh send us questions and feedback. That would be send us an email at the React Show at Owlcreek.studio. So yeah, we'd love to hear from you if you have any feedback, if you want us to answer any questions on the show, um, yeah, just let us know. Um yeah, and so we'll get started. So the the topic today is driving React forward. Um and this uh with a we'll we'll go into a little backstory. Um it comes from a project I did about five years ago called the 3L project, which was a sort of more broad project that had a similar goal, but in terms of computing itself. So we looked at like, hey, if you kind of like don't look at the current trajectory of languages or operating systems or whatever systems we have now, uh, where could we be if we like could we make things way better in some way? You know, and so that was really the exploration we did in that project. And I thought, you know, that would be a fun thing to look at in terms of like React and maybe JavaScript and the web ecosystem. Like, hey, we have something that exists, and uh we know that it's hard to change you know something with as much momentum as the web. But like I still think it's a really good exercise to direct future development if we think about like where could we be if we like just kind of ignored maybe the current situation somewhat, maybe you know, and imagined the future, you know, like could we make our lives as programmers way better? Could we make users' lives way better? You know, are there major improvements like that? So I thought you know, we could just sort of have some fun talking about um different ideas we had. And uh, if anyone listening has ideas, we'd love to hear from you what your ideas are. Um yeah, so um, you know, I'll just probably start with maybe an easy one. So we'll just kind of jump into it here, which would be uh a designer for React. Um and by that I mean like you know, a GUI program where you could design how things look and actually um connect with your your code, uh like a good one. So these do exist um to some extent with different component libraries, but they're all in my experience kind of primitive and basically like build a basic UI and then export it, and then you're kind of done using the GUI. Um but I find a good designer, like I've used with um cute or even um actually I wouldn't say it's a good designer, but you know, like Visual Basic, it it worked well because um everything was really integrated. So like you drag a button onto the screen, double-click the button, it takes you right to like the on-click handler for that button. You know, like it just it's a really nice experience. Um, and you could I I think we could have something like that, but way better for React. So it could read your React project and find all your components and probably organize them based on like your components and then components imported from like a component library like MUI or whatever. And so you could be like, okay, yeah, drag this one on, and you know, sort of like um, kind of sort of like storybook in the sense that you could see all your components, but this would be in a designer itself. Um, so you don't have to like kind of look through the code and be like, oh, what is this? Is this the button I want, or do I need to make my own button, or what can I change about this button? Or you know what I mean? Like there's a lot of uh I think improvements we could make. And I think it would be awesome if we just had a generic React designer that worked with any component library, any project. And you didn't have to eject your code. It was integrated with your IDE so you could interact with everything directly, jump into the code, jump into the design, and back and forth. Um, yeah, that's that's my idea. What do you think, Austin?
SPEAKER_00So would you you would you just mentioned that it would be perhaps an IDE uh integrated development environment? You would have like a code editor and designer, or would it perhaps live inside of the browser as like a browser plugin? Um what what are your thoughts on like how the developer would use this?
SPEAKER_02Yeah, um, I think it absolutely needs to be connected to your editor. Um, how that's done, whether it's in the browser or something else, I don't know that I am really thinking that much about that level of implementation detail. I'm just kind of thinking, like in my magical wishful world, you know, having that connection would be important between the code and the designer itself. So maybe even calling it a designer isn't even the right term because it's like designer and editor. Like I don't necessarily think they need to be connected. They could be used some protocol to talk to each other or whatever, but like, you know, having it just all be connected and seamless, I think would make a really great experience, both as an experienced, like a uh experienced developer. I just used experience twice in a row, um, but anyways, as an experienced developer and as someone new, especially as someone new. Like I remember that about Visual Basic. It was just so awesome because you didn't really need to learn a lot before you could start using it. With React right now, you actually kind of have to go through and learn a ton of it before you can like get in. Like if you haven't used something like it before, you really have to learn a lot before it all starts clicking and you can start making a real program. If you had a good designer editor integration, it should just be able to like run your project and you know, like have a play button, you know. You you say new project, it shows you a screen, drag some buttons onto it, double-click it, you know, make it show an alert or something, and just you know, take like five minutes. You know, like I think that would be amazing. But then also have it work for really complex projects so you can continue to use it.
SPEAKER_00Yeah, I think the the main thing that comes up in my mind is it seems that there would have to be some sort of standardization of how um design is implemented in React or like how components uh interact with each other. And it like made me think of uh the atomic design principle where you have like atoms, molecules, and organisms, and like how when you would drag and drop these items into each other, like how that would work. Because like if you had this like alert that you just drag into the page, like how do you like how do you make certain that it's like living where you want it to live in the in the grand scheme of everything? Um that that just seems to be the the biggest hurdle would be like how like like how do you nest components properly and manage that entire orchestration? I'm just like seeing that the web of prop drilling or whatever, and it it's quite interesting to imagine.
SPEAKER_02Yeah, that's a good point. I I don't uh yeah, I don't know if I have answers to that, and it might even mean like in my head when I'm thinking about this, I'm like, I don't care if that means re-architecting how React works or something. Like, you know, I'm thinking like, yeah, let's make something like this happen. But you make up a bring up a really good point in terms of like implementation. Um, as it stands now, that would that's probably why it doesn't exist. That's hard, very hard. Um, and I think even with what we have now, you could probably make it exist. Um, I don't know, I don't know how much of a priority it is. I think um maybe it's just like there's not money in it, not enough money in it, I guess, for the amount of development effort or whatever, but I think it could happen. It would just be a ton of work.
SPEAKER_00Yeah, and I'm sure that developers that are uh trying to protect their jobs from having React Me too easy are also like, yeah, let's let's not make this feature so that I can't be outsourced as easily.
SPEAKER_02Yeah, that's true. I hadn't even thought of that. I mean, yeah, that could happen. I mean, I I would never do that, of course. But of course. Uh did you have anything else you wanted to say about that?
SPEAKER_00Or uh no, it's uh it's an interesting idea. Definitely would be uh nice. I know that like for example, Figma, like a lot of the time we work with designers that use Figma. I think there are integrations with Figma that you can export Figma to React Code or React Native Code. Um, stuff like that would be uh cool to look into, like see how they're doing it now, and maybe learn from these projects. Um I don't know any of them specifically.
SPEAKER_02Yeah.
SPEAKER_00But I do think it ultimately in the long run would be really beneficial for creating applications faster with like in a more standardized way to like instead of like you're actually tied into having to use a quote component library versus like um having a lot of custom components flying around that you're coding. Uh instead, if you had this visual designer, you would have to create the components first as a standard reusable component to then use in the design. It would make design be taken more seriously and would perhaps lead to better UI and UX in general.
SPEAKER_02I hadn't actually thought of that, but I think you're absolutely right. That that would be a tremendous benefit. Um yeah, you're you I've always been excited about this idea, um, but now I'm even more excited.
SPEAKER_00Right? Like these UI, like I know in a project we're working on now, they're like the design has always kind of been iterating, and now it's kind of getting to a point where it's more finalized and a sort of design library has been created, and we're now like implementing that uh as like with each new feature or uh feature updates, but there's still design elements throughout the app that are like not caught up, or we've been like using different uh different types all over the place, and it seems like using a designer like this that you're talking about would kind of force uh uh proper design and it would ensure that as the design does update, we're actually using the it's it's not just updating on the design side, but it's updating in the in the application as they're both tied directly to each other.
SPEAKER_02Yeah, I I think that makes a lot of sense. Um, and I think it would help you more easily like see where you differ from the design, or like where one component, you know, if you're looking through the list of components and something doesn't didn't get updated or whatever, it'd be a lot more clear. Or if like uh you're like, oh, we have three different buttons, you know, like you know, stuff that maybe we don't even know because they're like one's named the fat button and one's the skinny button, and you know, nobody realized there was also a generic button except the person that wrote the first verse, you know, like so you end up with that without even really realizing it. Um, this could really help show that, you know, be like, hey, here are all the buttons, you know.
SPEAKER_00Right, right.
SPEAKER_02Yeah, yeah, that's cool. I I I like that. Um if only I had the time to implement it, but uh yeah.
SPEAKER_00Yeah, it it sounds it sounds pretty nice because like storybook, it's cool and all, but it's like it's its own separate thing that you have to like maintain, and it's not necessarily coupled in directly with what you're programming. So like this sounds like a much more tightly coupled uh interaction that like enforces these rules, and that sounds great to me.
SPEAKER_02Yeah, yeah, I agree. Um I also think it ties in nicely with you know our next topic, which is uh just exploration in general. Um, so we were talking about essentially exploring the components we had. Um I I also wanted to talk about you know exploring um your React application in a general sense. So like right now, um there is like uh React DevTools with like an inspector, um, which is it's not bad, but it's it's pretty limiting. Um I don't find myself using it that often just because it just doesn't have a lot of what I I think would be useful. Um but yeah, I was just wondering, you know, in my head, like, you know, what could be done to make it so that your running application is easier to like interact and manipulate with? Because like a lot, at least for me, a lot of the way I program is I I just get something working, get something on screen or whatever, and then I you know have to tweak it to make it you know in the right position or behave the way I need it to behave, or you know. Um so I like coming from a like list background where we have like the the integrated REPL and everything, um, which we we do have with JavaScript, but it's not really as integrated with React. Like they're pretty it's pretty hard to like directly interact with your running React application. So I'm thinking like, wouldn't it be awesome to be able to modify things like props and state and stuff in your running React application and see the effect right away? Like right now you can kind of do stuff like this by editing your code and getting hot refresh, but it's all it's kind of hodgepodgy and it doesn't work that well, in my opinion. I think it'd be awesome if there was like a browser extension or something where you could just go in and sort of make the component the way you want it, live, you know, and then just have get the code or save the code or whatever, connect the code in some way. That was one of my ideas. Um I don't know if you have any ideas, Austin, for for that.
SPEAKER_00Yeah, um like you said, the like React can't be interfaced with through the repo through the console. Like the console is mainly used for like logging. Um it would be pretty cool. Like there's a disconnect. You have to like you're writing the code and then you go to the browser to like see the effect, and then you like you're hopping back and forth versus uh being able to more directly interact with these things. Uh, I honestly I don't use the React Dev tools because like I I think I mentioned in a previous podcast, we were having some bugs in um we were having bugs in Safari, and so I just was like, I'm just going to kind of be a dedicated Safari developer because some of these people were using Safari for our application. Uh, so I don't have access to the dev tools, but uh so I couldn't really tell you what does exist there um off the top of my head, but I do remember when I was using Redux in a project that kind of has some similar uh features to what you're talking about, the Redux dev tools, you could kind of like step through the state and kind of like modify it there or pause it and like go back and forth, uh, which I thought was that was pretty cool, even though I I'm not a big Redux fan personally.
SPEAKER_02Yeah. Um yeah, I I actually I I've I had forgotten about that. Um yeah, it would it would so the thing is like yeah, Redux, you could do that, but you'd have to, and that works because it's you know fully purely functional, you know, you you you only ever you know update your your state through uh purely functional means. Um and yeah, I mean the problem with that is you just would have to use it for literally everything. Um there's not it's probably more work to to make it work, you know, for a non-reedux situation. Um but yeah, I I think when you're talking like um the console, you know, or the the the REPL, I like so when I'm was used to do you know just plain HTML, or when I end up doing that now, you know, you can like select an element in the inspector and then $0 will reference it down in the the console, right? So you can like inspect it, modify it. Like I'm I would look for something like that with React components. Like, can I select a component and then in the console start manipulating it like with code? I think that once you cross into that connection between your debugging and your ability to interact with it with code, it opens up a lot of opportunities. Like, you know, when you look at just JavaScript, when I'm talking to somebody about some JavaScript question, usually what I do is I put it into the REPL and find out what happens, right? Like that's probably what most of us do. Oh, what does this function do again? How does this behave again? I write a lot, I'm maybe it's just me, but I write a lot of my code in the REPL when I can. But React code, I can't. It just doesn't, that's not a thing, you know? And so you you're more of the like write the code out and then pray it works. And if it doesn't, kind of hodgepodge your way through figuring out why it doesn't work. I would love a more integrated solution.
SPEAKER_00Right. I think the the problem is is the feature that React is built upon is translating these components to the DOM, right? And so like once it's translated over, you don't have access to the the way the components were written. It's all now uh HTML. So it's like if there were a way to like have an interface of the pre-translation uh to like directly interface with that uh to modify that in the browser uh through the inspector or something, that would be pretty pretty cool.
SPEAKER_02I mean, I think uh that must uh be somewhat in existence because the current dev tools allow you to actually click on the components and and work your way through them. So that must be, it seems like it's probably possible even now. Um yeah.
SPEAKER_00Um maybe there's someone listening right now that is a React DevTools wizard and has some insights on things that we don't love to hear about more of that.
SPEAKER_02Yeah, it's definitely not an area of my expertise. I'm just thinking, you know, what I would want. Maybe it already exists. Um that'd be even better. Yeah, the the next thing I was thinking about that would be really cool is being able to like record and play back renders. Um I I think this is something that we've as React developers, we've all had to deal with is sort of manually deconstructing renders. Like maybe it renders three times, and the first time your variable is the thing you expect, but by the end it's not, and you're like, hey, how did that happen? Or how you know, why is it not what I'm expecting? I think it would be awesome to hit a record button. It records every render and records why the render was triggered, so you could figure out oh, you know, like, oh, okay, that's why that makes sense, or that doesn't make sense. Show you all the props and state for every render and the output. Like, I think that would be amazing. I don't know.
SPEAKER_00Yeah, I think there are some tools that are like libraries uh that have been created that you can kind of inspect why the uh something has been rendered, but I don't think that they're very robust at the moment. Uh it would be really cool to figure out like what is causing all of these chain reactions. I I know that uh since I've started using hooks, that I've noticed there are a lot of uh re-renders that occur. um from from like using multiple hooks and multiple of these use effects like the it's there's a lot that gets fired off and it it's not ever clear like like your console log inside of the the main component page or whatever you're on um a value and it would be cool to know like which one like which console log was related to which like effect firing or which uh whatever firing without having to like put console logs in all of the different hooks or that that you're using.
SPEAKER_02Yeah um you you can use console.trace uh which helps a lot um but yeah it's you you might still end up in the case where the thing that triggers it is higher up the chain and so you might not might not see it or whatever but I didn't even know uh console I the only consoles that I have used is like console.error console dot of course and console dotable so that's cool I didn't know that trace existed oh yeah trace is great because um it will show you the whole call stack to that point um yeah it it can be a little bit weird to like look at and and react but as long as you're in development mode it works pretty well cool yeah well yeah I'm looking at the the Mozilla developer docs now and that's that's pretty cool.
SPEAKER_00Sweet. Thank you for learning something new every day.
SPEAKER_02Yeah of course um let's see I think we already talked about the next thing I had on my list here. So is there anything else Austin that you would like to see in terms of exploration um interactive development type of things?
SPEAKER_00Well like there's there's like the breakpoints and stuff uh that you can use to kind of like zoom through your code um it there's just like it's not a really clean ecosystem to to use I I feel like especially in Safari it's like it's just like to find uh the parts that I'm trying to do breakpoints on it's it's just always messy digging through that it would be cool to be able to uh I I know that one of our coworkers is a big fan of Web Storm and I think that there's like breakpoints within that IDE that you can use uh it would be cool if there was just some sort of standardized approach on uh navigating like interactively like that as well.
SPEAKER_02Yeah um and that actually makes me think of a big problem which is with with the debugging is um when when you have multiple renders going on or a bunch of renders it sucks using the JavaScript debugger whether it's in Web Storm or the browser because you're you know it just always hangs. You're like no I don't want to always hang on every you know like it needs I mean I guess there's ways you could probably hack around it but by default um I I don't necessarily always want to see every single render I just want to see a render you know and then let the application go or something like that.
SPEAKER_00Like I definitely feel like there could be improvements with that right well maybe someone I I hope our listeners maybe have some tips and tricks and hacks that if they're listening so please yeah do reach out if you have any.
SPEAKER_02Yeah. And if you have any tips uh on safety which is our next topic we'd love to hear that too um so when I what I mean by safety is like um how how do you make it so that your system is just safer by default in terms of like how your code behaves um how it behaves towards the the client system. So like uh safer by default would be a system that doesn't open up avenues for crashing when it doesn't need to or errors that don't need to happen or you know a big thing is like null or undefined um can lead to I don't know I don't know if you'd really call them unsafe but less safe situations. You know how how are we handling it in one place versus another so I I'm thinking of of safety in that sense. Basically how do we make it so the programmer can write safe code easier. My big one that I would like to see improvements on would be use effect. I feel like it I feel like a lot of people don't really fully understand how it works. They just like use it all the time and you know hope for the best and but I I feel like it has a lot of foot guns built into it both you know what a hot topic the dependency array but also beyond that like are you returning a cleanup function when you need to um you know are you even like so many times people have like made a minor mistake on the syntax of use effect like um accidentally returning something or that they didn't mean to like it just seems like it's rife with a lot of issues and I don't know if the if it's because of the underlying concept is is wrong.
SPEAKER_00Like maybe we're we're wrong about how we're doing that I don't know or maybe it's just a bad API but I don't know that's that's something that has often bugged me about the newer version version of React with with functional components yeah I mean use effect in general um could you this could we actually do a little deep dive into like proper usage of it. I know that um for example we have uh a hook that we made where we are we do like an event listener for if changes have been made uh it's like to use the on before unload to like if like changes have been made on the page you and you try to hit back um we we like have an event listener that's in there and we return uh the destruction of that we turn off the event listener by returning it in the effect.
SPEAKER_02Yeah.
SPEAKER_00Are there what other times within use effect should you be returning a cleanup? Is it typical to need to return a cleanup?
SPEAKER_02Because I feel like I've only ever done a cleanup in that instance and like with React Hook form uh I saw that it like when you register um a custom um a custom uh input you should also unregister it uh on the unmount of it is there any other instances where I should be using the the return cleanup I mean it's anytime that you have uh like actual side effects um yeah uh that that I think actually you your question is indicative of the problem it's hard to know and if you don't get it right it it creates problems um right I so when I when I'm talking about safety here I would be looking at okay how could we redesign this system so that anything like that that needs a some kind of cleanup it's handled automatically in some way um or the system doesn't compile without it or you know like that that's really what I mean by being safe is the system's got your back you know um and I don't I honestly don't have a good answer for you and I think that really is why we're talking about this. I think it's just an error prone construct.
SPEAKER_00Well I think that answer itself is is good because yeah it's it is unclear um and the the situations vary so much and like our code it varies so much so and it's still pretty new and we're not really sure how we're we're kind of figuring it out as we go along right yeah um I yeah and I'm not like necessarily criticizing you know the existence of use effect because clearly it has value um but in my magical dream world I'm like yeah we can definitely do better.
SPEAKER_02I don't know exactly what this better is yet but like I gotta imagine there's a better way to do it. And obviously one of the ways is React has already said um that dependency array in the future could be automatically filled in by the compiler. But that also brings up another issue with it which is the the fact that people abuse that uh dependency array to basically do conditional use effects um you know like oh I only want this effect to run when this one variable changes so I'm gonna put that in the dependency array list which is not at all how it was intended to be used. And you know a designer of an API like this it's not necessarily wrong to allow give people the power to do whatever they want to do even if it's dangerous, right? I don't I'm not saying that that you know needs to change.
SPEAKER_00I'm just saying like maybe the the normal way of using it doesn't include things like that where it's so easy to misuse it well the bad thing is is that is like how I primarily use effect is I either use it with an empty dependency array to run something on the page load uh one time or I have like a state uh object or a state value that I'm watching and if that gets updated I want to run uh something on it and I usually only put in the thing that I want the effect to run if only that thing changes right and I think that like our the application in question right now the warnings in our application is something like 500 maybe like with how many there are that exist.
SPEAKER_02Yep and I've I've looked into cleaning them up before but I didn't want to modify the dependency arrays and put in a lot of stuff because they a lot of them were written with the intention to only run on that single condition right so it's like they're inherently broken now and the the warnings I don't know if they'll ever go away right I mean yeah this this is a a thing that's come up um I I have written a hook called use conditional effect which does what people are using use effect for like what you talked about you could drop that in and it would work correctly without having to you know we could blanket replace every use effect with use conditional effect and everything would work correctly and you know we would be using the API right um but really my point here is more like I think I I really think releasing use effect as it as they did from React was a mistake. Now at the time maybe they did not anticipate how people were going to use it and so I'm not like faulting you know them for releasing it how they did but it's definitely a not the right API. I think it's been demonstrated that we can do better. And so I get the actual underlying um reasoning um so React said when they released it that we they said we don't expect people to use use effect very much. We expect people to build other hooks that use use effect that so so you'd have like use conditional effect or use on load effect or whatever if you only wanted it to run. Like their intention seemed to be you only use it as like an underlying primitive. Now that in in some ways has happened there's been a lot of hooks that that do use it underneath um but my experience like you were saying has been that dream of React didn't really happen. Most people are just using use effect just plainly as it comes um and you know I you know I don't I don't know that placing blame really matters but I think like going forward facilities like that need to change.
SPEAKER_00They need to be made safe by default easy to use by default correct by default well I think the problem is is um a lot of these new hook features are really easy to use and uh it like way too easy to use. Yes and like I can tell you personally that I haven't read the using the effect hook page on the React docs line by line all the way through to fully understand it. Because as I do work I'm it's required of me to work fast and build out features and it's like I don't I haven't made the time to fully understand what I'm even using.
SPEAKER_02Yeah um well I so if you don't mind me cutting in I will say that that's I I don't in this some cases that would be like you know RTFM you know but in this case I don't I don't think that's the case because there's a lot of disagreement on the interpretation of those documentation and the documentation is sort of spread out if you want to get the whole idea of how it works and I think it's a messy situation. And this is a case where the way it's being used in the real world right now is actually probably the most relevant use and the most important thing to actually understand. What the theoretical docs are saying to do and how to use it and and about it doesn't really matter as much in my opinion.
SPEAKER_00So like you know I I really don't know if I would feel too bad about not knowing the docs in this case well it's like I I think that the what I was more getting at is like they made these things so easy to use and you you're like hey I need to I'm now using this functional component. I need to do component did update or component will mount um and then you just like quickly read the manual for that and then you don't you don't go into all the caveats for the rest of the hooks right and so like not I I feel like that's honestly how most people using this tool do it is like on an as needed basis. Yeah. And so but I mean well I in a way go ahead.
SPEAKER_02Oh I was just gonna say I don't again I blame this the underlying system for that like it should be usable like you're describing. I think uh you know this there are some systems when you're programming you do need to like really understand how it works. But I think a thing like this that you're using all the time in your front end code it there's no need for you to have to read through and understand this thick manual.
SPEAKER_00It should definitely be uh as needed basis in my opinion well I mean the whole the whole thing is is I I think a lot of this is has been released as where they're just trying to create something to create an easier development environment for us to use React in I think they knew that it would be kind of exploratory like hey here's how it's intended to use we hope you do it right and I mean when have we ever like for example guns guns were created initially to like to hunt right weapons were like for hunting and then weapons like eventually people realize they could kill each other with them and it's like oh well that that's not what we really intended to to do with these things. Now the React team like to to do these to like make things work like the way they intended them they now have to deal with the unintentional use in their like their attempts to create new versions that are backward compatible. So it's like I feel pretty bad for like that situation. Yeah like it's like oh man these idiots like did it all wrong and now we have to make sure that our next release doesn't break 90% of the applications in existence because like they they took this tool we made and they're using it like in all these crazy ways.
SPEAKER_02Yeah I agree. That's enough time for them to figure out how to get around that situation.
SPEAKER_00But you're absolutely right that's the situation we're in now and yeah it's got to be dealt with well I'm sure that they'll figure it out like the um the next topic you wanted to go into I believe is concurrency. They're already working on that in the new releases uh what were you what are your thoughts on the future of that?
SPEAKER_02Um so this is a really interesting one um in the 3L project I I don't know if I solved it and I don't know if anyone's really fully solved it yet but my imagination around concurrency is that I don't even know if we can do it anymore with something like JavaScript and React. I'm not sure maybe we can but like my general idea around it is that we should have automatic concurrency. So you just write a program and you don't really have to think about concurrency at all. And the computer should be able to convert that into units of computation that can be spread across all the cores on the system that make sense. You know maybe and also make sense in in terms of which cores journal it on the big cores the little cores all cores just one core like um so when developing the 3L project I was working on coming up with um sort of a different way of programming um a different type of purely functional program that would allow the underlying operating system to do that. So you didn't really have to think about threading or concurrency. All you do is just write your code and it just magically makes it happen. So maybe we can't go all that way with JavaScript or React. Maybe it's literally not possible because of the way the language is designed or whatever. But I I think um in the spirit of the upcoming React release like moving towards doing more things automatically. And the other thing I would like is some way to maybe like if we can't get it all automatic some way to do it manually or tell the system that I want to do it manually. And we do have service workers and things like that but I find it to be kind of clunky and indirect.
SPEAKER_00I I would look for a much more seamless system how how do you think that is possible considering how JavaScript runs on like how JavaScript it would have to change yeah I I mean this is our our super looking into the future you know like if we could have anything you know yes the current that's rather I was saying at the beginning um I'm not necessarily looking at the current trajectory of anything.
SPEAKER_02I'm saying like ignore that and just jump to the future you know what could we have like because I want to make I want to make computing really better not like just incrementally better. You know like when I'm thinking about this I'm thinking like yeah if we really applied our resources we could probably make all these changes happen. It would take time but we could probably do it if we put enough money And time into it, right? And so that's where I'm like, okay, yeah, right now that sounds really difficult given the current way JavaScript is run and how we've got 20 years of code working based on that model. And you know, maybe we need to introduce a new model, maybe we need to introduce new primitives, like so many different things we could do. But I think it could be done. And so what I'm like looking at is what type of model would we like to program in? And I would love to program in one where I don't have to worry about the underlying hardware so much. I can just write my code and it will just optimally run it, you know.
SPEAKER_00I got you. Yeah, I'm I'm having a hard time thinking so much out the box as you are. And you're you're you're making me feel brave holding my hand to take me out of the box. So but that's uh I think this is a universal human problem, is uh humanity, it's like this train that is going. And uh all of the problems stem from the fact that the train is running, and all of the and there's like some like there's some need to keep the train going. Like there, it's like we have to keep going, like we can't stop. But all of the problems that our entire species um is running into could be resolved if we just stop the train for for a couple of days, you know, and like said, hey, how do we reevaluate this? And that's the exactly what's happening, like you're saying, with the software, our environment that we're in. It's like for some reason, like we just like can't stop and won't stop.
SPEAKER_02So it's like Yes, absolutely.
SPEAKER_00I think the it's like how do we how do we figure out a way to create like a separate platform from that train that we can like have a space that is not rushed to actually innovate um without like the insane can't stop won't stop mentality.
SPEAKER_02Yeah.
SPEAKER_00I don't know how we'll get there like that as a species. It's it's a very big problem.
SPEAKER_02I have theories on it being tied into larger systems, but that might be a subject for a different show.
SPEAKER_00Yeah, the conspiracy theory show.
SPEAKER_02I don't know about that, but I would say it was a perfect tie-in to the next topic and the last topic I want to talk about, which was ecological impact. And I think this is what you don't really ever see on like a feature list hardly. Um, but I think it's something we should be thinking about more. Um, because computers are gonna be used more and more. Absolutely, we already know that, right? They're gonna be everywhere eventually if our current trajectory continues, you know, if let's just assume that happens, you know. Um I think as programmers, we have a responsibility to think about the impact of that on uh the ecology that we live in that supports us. Um and so part of the 3L project and part of what I want to talk about here is like, are there um things we could do on a large scale systemic scale to reduce our ecological impact of the programs we write? Um I I know this is probably a different topic than most people would would hear brought up, but I thought it could be interesting and also useful.
SPEAKER_00No, it's uh it's it makes me think about being in school. Like when you're in school, or at least this was my experience, you have like five classes, and each class gives you a certain amount of homework, and they don't take into account each class, doesn't take into account that you also have other classes giving you the same amount or even more homework, right? And I feel like this is happening with computing, is like I'm running uh Safari, I'm running this uh this uh Jitsi right now to do this chat. I have Google Drive open. I close down Slack because if I had Slack open right now, good lord, like I don't know if my computer would even run that piece of crap. Sorry, Slack, it's the reality. Um and like every every service that is being created seems to be like created without any concept that other services are also running in the ecosystem. Yeah, brilliant point. And the amount of server farms that Amazon is like opening up in my state. I know that like they just put in a huge server farm uh up the road in Ashland, Virginia from us, and it's like what like yeah, the like what is running on that, like how is how we program uh like affecting the heat output, the electrical output, the energy resources going into that farm? It's it's a really important question that is back to that train. It's like, do we we don't even think about it?
SPEAKER_02Well, and yeah, like how many times have you had a client or an employer, you know, or a PM or something say to you, All right, this next sprint is focused on reducing our ecological impact of the program that will be running on five million devices or whatever. You know, that doesn't happen.
SPEAKER_00No, it's it's not even a thought. It it doesn't even cross people's minds.
SPEAKER_02Right.
SPEAKER_00I I worked at a cruise ship company, which I won't name because this could get the it could be some backlash from this, but uh I went on the cruise and we were it was like 9 p.m. and then we were like we were all drunk, and we were like, oh dude, the the buffets are closing, like this hurry up. And so we ran and like got to the buffet, and there were a bunch of workers strolling around with these like huge shopping cart Tupperwares, and like I'll never forget this dude has a huge tray of uneaten chicken wings, and he just like tips the tray, and they just like I hear them plunking into this soup of all the rest of the stuff that wasn't eaten from the buffet, and I was just like, What are y'all doing? And they were like, Oh, well, the all this uneaten food is sent below deck to be incinerated, and just I was like, wait, what? Like, and the amount of like I did some studies um and ran some numbers, and there's like with all the amount of cruise ships in the world, uh, like thousands of tons of food waste is being produced on these food ship, uh, these cruise ships every week due to the them not properly calculating the the amount of food that they need. So I like came up with a tracking system where we could easily do that, and nothing happened about two weeks, no, like two months later, I heard from the guy who had introduced the the thing to and he was like, hey, uh like check out this slideshow. And it was like 2024 goals, like look at uh like environmental impact and like sustainability impact of how we like how we operate. And I was like, dude, I literally created this like tracking system that would have taken a week to prototype implement on board, and the world could have started changing, and I know for a fact they still haven't done anything about it, and that's it's like back to the train. It's like when will we realize that we're building like we built the rails far off a cliff at this point? And it's like, how's the train like even still like in the air, like right now?
SPEAKER_02So yeah, that was a really um, I think, instructive story about what we're talking about, and I I think you're totally right, like um incentives in our society are not towards you know looking at the ecological impact. That's just not nobody's incentivized to that. It's only ever a corporate slide to make them look good in marketing. Um, I mean, there's probably some you know company somewhere that's you know has their employees pick up trash along the side of the highway, but like, are we doing things like large changes, you know, large things like in terms of like what we're talking about here, our ecological impact for programs. No, that's just not that's not a thing. Maybe you have a nonprofit that does it, but like actual the vast majority, you know, it's not a thing anyone's thinking about. Um it's not the focus, it's not what they get compensated for, you know, that's not where we are. Um, so yeah, I think we could take this time to call out the meta thinking. Yeah.
SPEAKER_00Well, they like like it comes down to like all the things that we've been uh asking for. It's like, can we get like a better debugging environment to figure out why these re-renders are like imagine the environmental footprint of all of these unnecessary re-renders and React applications? Yeah, like it sounds silly to like consider, but it like when millions of people are visiting a React app and there are hundreds of thousands of React apps perhaps re-rendering improperly, we don't even think about it. But it it could be like having a huge, yeah, huge like impact that we just aren't even aware of. Yeah, and I think that's the scary thing is like we just don't even know how like bad it is because no one's taken the time to think about it.
SPEAKER_02Yeah, for sure. Um, I you know, and that's that's what I was about to say is like this is I think a time to call out, you know, Facebook, the creators of React, they have the resources to work on this. There's absolutely no doubt. If they wanted to, they could, and I think they should. Like, they should look at React and say, okay, are there things we can do to reduce its ecological impact, like providing better tools for figuring out the performance-related things like re-renders and profilers, or built-in things like not running code when the application's not visible on the user's screen, or you know, letting users specify, okay, this is critical code that we want to run in the background, and the rest doesn't need to. You know, like I think that is really on them as people with the resources that created it, that could do it. Um, you know, and of course it's on us as implementers as well to take that into consideration. Um, but usually we're not the ones uh you know high enough on the food chain to make decisions on and allocating resources to that thing. Whereas if React made those improvements, it would just blanket apply to everyone that's using it, which would be a massive, massive improvement, I think, in terms of ecological impact for society.
SPEAKER_00Man, I think I've found a social cause I can actually get behind. I never never even considered the impact of how I write my code um having an effect on the environment. And uh it's pretty wild to consider that.
SPEAKER_02And um it it's actually really uh um it's it sounds like a weird plug for Owl Creek because we focus on performance, but like that's not how I I intend it. I really just want to say like performance, you know, I'll often say don't worry about it up front, but I do worry about it after I write the code. And even if I'm not hitting a performance bottleneck, sometimes what I'll do is just profile my code and eliminate the the largest bottlenecks because that usually means uh improvement improvement in performance and less ecological impact. I mean, that is actually a simple way any of us could do it now is make our code perform better. I mean, it's it's just that's that would work. It's not as good as like a systemic thing, you know, coming through from React to make it all better or browser engines or or whatever, but like it is something we can do now.
SPEAKER_00I mean, it's pretty much uh the subconscious uh reason why we called our consultancy owl creek because we are thinking about the that creek, that hunting ground for that owl, and how the how React applications are so underperformant. And our mission is to save the Owl Creeks of the world through writing more performant React applications, pretty much. That's the subconscious drive, I guess, behind it all, right?
SPEAKER_02I absolutely love it. Totally.
SPEAKER_00Yes, Owl Creek. I found a new inspiration for doing my my day-to-day now. Thank you.
SPEAKER_02Yeah, anytime. Um, yeah, I think this has been way more fun than that. I imagined, but unfortunately, um we gotta start winding this down. Um we had one uh QA question.
SPEAKER_00Um Yeah, this is the longest podcast to date, I think. We're definitely over an hour.
SPEAKER_02Yeah, it's showing me 59 minutes right now.
SPEAKER_00So well, nice.
SPEAKER_02Yeah, so um the the question we had, um, which uh was from Marissa in Budapest, um in uh episode three when we were talking about uh high quality at high speed, writing um high quality code quickly. I talked a lot about contracts and how I view code as a contract and and each line as a contract sometimes. And and I asked Austin uh what what he thought about contracts, and we never got an answer. So Austin, uh Mersa would like to know what is your opinion about contracts?
SPEAKER_00Hey, hey Thomas, I'm I'm losing you again. My connection's cutting out. No, I'm kidding.
SPEAKER_02Um Austin doesn't want to tell us.
SPEAKER_00Well, until this episode, um, when you when we talked about the show notes before, you asked me, you're like, hey, we're gonna, I'm gonna ask you about that. And I was just like, uh I have no clue what I'm even gonna how I'm even gonna answer that. Um but now that we talked about this ecological impact, um just like thinking about the way I write my code um has taken a completely different meaning just in the last 10 to 30 minutes um in a way that I hadn't thought about before. And so I feel like maybe it's not the answer that's expected, but like thinking about like the purpose behind what I am doing, and it's like uh like right now, a company that we're working on, we're always where we pride ourselves in developing quickly and developing fast, um, at what expense? And well, it's the expense of our planet, perhaps. Um, because I know that the the people using the application we're building is reaching huge numbers, right? And it's like the way that I'm implementing each feature or writing each line of code now has like a completely new meaning. Um, like one of the where we're talking about updating to React query across our application right now. Um, and I had kind of avoided it a little bit recently, and I started this week to rewrite uh an API endpoint, uh a call to an API endpoint, um, because the way that we like load uh we list the next items on uh a date uh a table. Um when we scroll to the bottom, sometimes the scroll will like bounce at the bottom and initiate like 10 server calls, and then once the the movement stops, it like all of those are pinging the server, and it's like creating a huge stress on the server potentially. And React query by default is one of the ways that we're like getting rid of that. Uh it like it queries the server more intelligently. Uh it's not solving the problem directly for sure. It's like an indirect solution.
SPEAKER_02Yeah, it caches it so we're not retrieving the data 5,000 times every five seconds, or we don't need to.
SPEAKER_00Right. So it's like I now have like a newfound motivation to do that work uh after we get off this call. And uh so yeah, like I I guess my answer is like I don't know if I'd taken like what I do and the cleanliness of how I write code or the performance of it uh at this current job super seriously because it's like, hey, get this feature over the the line and we'll like we'll refactor it later. Now I'm I feel uh much more obligated to instead of saying, hey, like at Owl Creek, that's when we like we go in and solve bottlenecks as our profession, but like when I'm doing contract work, even if I'm being told to write things quickly, I feel like I have some sort of standard now that I have to hold myself to uh a contract with each line that I write. So pretty deep stuff, man. I appreciate the this this whole this podcast took a completely different turn than I expected.
SPEAKER_02So yeah, I that was a great response. And it's not what I expected, but I think it was great. So thank you, Austin. Um think we're gonna start closing things down here. Um I'll just mention again if you wanted to check out the uh foundations of high performance React book, and if you wanted to learn how React works under the covers and uh get a better understanding of how to write more performant code, more efficient code, um yeah, you can check it out at owlcreek.studio. We got a link for the book there. Um and yeah, also if you have any uh uh feedback or questions, or you know, uh especially on this this episode, if if you know about tools or or or things that we talked about that you know would address some of the things we brought up. That would be awesome to learn about. Um if you have any more questions, if you want to hear more about any of these topics, we'd we'd love to hear from you at the React Show at owlcreek.studio. And yeah, that's it. That's our show. It's been uh great. Um, it's it's been fun uh talking with you, Austin. And um yeah, look forward to um uh doing this again. See y'all later.
SPEAKER_00Thank you. Thanks for coming by. Take care, y'all.