Skip to content
473: Mental models for browsers episode artwork

Sep 9, 2025 44 min

473: Mental models for browsers

from The Bike Shed Hosted by thoughtbot

Joël prepares to write his new book by asking Sally some fundamental questions about Web browsers. Together they look to answer the deceptively simple question of what is a browser, examining what they are at their core, what they’re capable of beyond basic functions, the nuances of programming for the web across different systems and devices on the front and back end, as well as unpacking the surprising benefits of different forms of browsers like the terminal text based platform Lynx. — Thanks to our sponsors for this episode Judoscale - Autoscale the Right Way (check the link for your free gift!), and Scout Monitoring. Your hosts for this episode have been thoughtbot’s own Joël Quenneville and Sally Hall. If you would like to support the show, head over to our GitHub page, or check out our website. Got a question or comment about the show? Why not write to our hosts: [email protected] This has been a thoughtbot podcast. Stay up to date by following us on social media - YouTube - LinkedIn - Mastodon - BlueSky © 2025 thoughtbot, inc.

Episode details come from the podcast's RSS feed.

Embed this episode

Ready to play

473: Mental models for browsers

0:00 44:12
of matches

Transcript Auto-generated, may contain errors

Autoscaling is a simple concept. Automatically add resources when needed, and automatically shut them down to avoid paying for excess capacity. How hard could that be? If you've set up Autoscaling yourself, you know it's not that easy, especially using the native Autoscalers on platforms like AWS and Heroku. That's why you need JudoScale.

JudoScale is Autoscaling as a service, and they make Autoscaling simple and easy, as it should be. You can use JudoScale on AWS, Heroku, Render, Fly.io, and more. It's free for low traffic apps, and unlimited plans start at $25 per month. Autoscale on Easy Mode at Judoscale.com. Hello, and welcome to another episode of The Bike Shed, a weekly podcast from your friends at Bapat about developing great software.

I'm Joelle Kimville. And I'm Sally Hall, and together we're here to share a bit of what we've learned along the way. So Sally, what's new in your world? The thing that's been on my mind a lot recently is my workspace, my home workspace. So we are all remote, we work at home, and I'm lucky enough to have a room in my house that is sort of mine for my home office, but I also do a lot of crafts and things like that.

And so it's soagroom slash office slash whatever I happen to be doing at the moment. And I rearranged it recently. And it's been sort of interesting because I've been thinking about things like how much of a divide physically, if any, do I want between where I work and where I do other things, where I live, where I play, where I craft. So like, is this going to be exclusively a workroom, or is it, are you going to allow some of your personal life to bleed into that physical space? Right.

So it's definitely the room itself has to be both, because there's not enough room anywhere else in our house for my yard. But I've sort of created a barrier right now with some shelving. So it's like a pseudo separate room. My wife saw it and recalled it very dorm-like, you know, we've got to create private spaces with furniture. So I've got my little like work corner right now, this separate from everything else.

And I'm sort of feeling different ways about it. You know, part of me is like, yeah, this is more focused. This is more like, when I'm in this part of the room, I'm doing work. And when I'm not in this part of the room, I'm doing whatever else I do. But I think there's also a part of me that really enjoys like glancing over and seeing yarn or sewing project and process or something like that.

So I've been sort of thinking a lot about like how separate do I want these to be? Or do I guess kind of spills over into like how separate do I want my professional life and personal life to be? Yeah, how have you managed to sort of that divide? Because that's, I think for a lot of us, we get into software because we enjoy coding and that can really blur the lines. And the industry encourages us to, you know, do open source on the weekends and all these other things.

So like how do you manage that personal, professional divide? Yeah, that's interesting. I think I'm probably one of the rare professional developers who doesn't really make software all in my free time. So for me at the end of the day on Friday, I turn off my laptop and usually it stays off until Monday, which is not to say that I'm not, you know, on screens. But generally I try to use my brain for different things on the weekend or, you know, sometimes not use it at all, which I've kind of always been curious about like how, how far can I get in this field while only doing software and code and programming and whatever else during the 40 hour work week?

I actually think many years ago we had a conversation about this and I feel like I've been able to learn more and do more than I was worried I would. And I'm still kind of wondering, I'm still waiting to hit the wall. We're like, okay, in order to get better at this or to move up in any way, I'm going to have to start doing this in my personal time. And I don't think I've hit that well yet. Sometimes I wish that I were the kind of person who wanted to like build things on the weekend.

And I do build things on the weekend. They're just physical things. So it sounds like you've not like had a plateau or anything. You're still feeling like you get a lot of growth, even just in the regular work week. Yeah, so far.

I mean, I've definitely had some plateaus, but I feel like they've been sort of intentional, you know, phases of my life or time period of time where I've decided like, okay, I can't focus on professional growth right now. So I'm just going to do what I can to sustain what I'm doing right now. And then when things shift, I can sort of throw myself mentally more into that, which is interesting because it's not like a different amount of time I'm spending at work. It's sort of just like a different amount of mental and emotional energy I have to put into the growth. Yeah.

Right. Yeah. What about you? I feel like you I got the sense that you might do a little more building on your personal time than I do. I do.

Yes. I'm not very as a lot, both in terms of like what are the other things happening in my life that I want to be dedicating time to. And also a very just by interest, I often use code as a way to sort of interact with a different topic that I'm interested in or sort of a way to like make something feel more tactile. While back, I had read a novelization of the life of Cicero, the Roman Order. And it was, you know, it's an offalization.

It was a political thriller. It was really fun. And I was like, all right, what I want to do coming out of this, I'm really excited to write some code that models an election in the Roman system. Okay. Like I was reading this political thriller, but I wanted to make it.

Yeah. And so like that was a project I did. And I was really excited to and I had that motivation. And then you might have like a bit of a dryer spell. I'm like, you know what?

I'm not doing anything. There's nothing particularly excited about. I'm not like, oh, what is it? And open source project I can contribute to or anything like that. Yeah, I do think that the times that I have been motivated to build something on my own have been in support of another interest.

You know, like a while back, I tried to make an app for this complicated workout plan I was trying to follow where there were different exercises. And then each day you would combine a set of those exercises differently. And I was like, oh, I could make an app to help me not have to flip through 15 pieces of paper to figure out what I'm doing. I never finished that, but it was fun to work on. I think for me, oftentimes the side projects are more sort of curiosity driven than they are practically driven.

So I don't feel the need to complete things necessarily as long as I felt like I learned something along the way or I was able to explore a topic that I was interested in. Yeah. So, well, what's new in your world? So some big things are new in my world. I've taken on a big side project code related, but totally outside of work.

Okay. I've just recently signed on to write a book for Pragmatic Press. Oh, my gosh, that is really exciting. Congratulations. I'm so excited to read that.

Thank you. What is it going to be about? It's a sort of discussion of all things web, but not the code part. So in everything but the code, some of those fundamentals that you often just sort of have to learn by doing and a lot of things in the web platform that aren't necessarily taught when you're learning two codes. So you're learning JavaScript, you're learning HTML, you're learning CSS, you're learning a backend framework, but you might not necessarily understand the nuances of HTTP or how to do a lot of common tasks or even how certain tasks are maybe different or more limited on the web.

Yeah. So an inspiration for me here was helping out someone who wanted to save a file and they're like, okay, when I write Python, I just write to the file system. Why can't my front end app just write the file to the file system? Oh, and my first question was, which file system? On the web there are two.

You can write to the user's local machine or you can write to a server somewhere. Those are two entirely separate things. Have you thought about like, what do you plan to do with this file and how that might impact where you might want to save it? Yeah. And then if you're saving to the browser, there's all these limitations around sandboxing, the permissions that you have.

So these are things that you don't necessarily learn just by learning HTML, CSS, JavaScript. These are parts of the web that are really just part of the platform that you have to learn. So that's what the book is trying to teach. Everything about the code. So it's everything but the code, but it sounds like it's still fairly technical.

It's not like a social science investigation of the web. Exactly. Right. I'm not looking at the impact of the web on our society or that would take a few books. How would it be media savvy when you browse the web or anything like that?

This is a four programmers. I'm targeting people that are about a year into their first job. So junior developer, maybe you've come from a boot camp or you've done a CS degree or something like that where you've learned to code, you get your first job, to fire hose. You just, you're overwhelmed with all the things. And then maybe a year in, things are starting to stabilize.

And then you realize, huh, there's a bunch of fundamentals that I'm missing. And they're not fundamentals in the like CS way of thinking. It's not like, oh, you need to be better at big O notation or something. But it's not like, how does this environment where I code impact the things that I can and can't do? How does it impact the way I debug the way I think about performance?

The architectures I can build. My boss asked me to build a feature. Do I know enough about how the web is structured to be able to say, hey, here's a plan for how I'm going to implement that feature front and back end. Or I get stuck. Do I have the knowledge of just enough of the web fundamentals where I know what questions to ask to get myself unstuck?

Sort of removing some of the magic that happens once I finish my code. And then it's suddenly there. And people are using it on the web. Sort of like, how is that all happening? Because it does feel magic in the beginning.

Yeah. And a lot of times in your beginner, you're doing a lot of copy pasting. You rely very heavily on your framework. And maybe you just sort of do what you're told by a more senior person or you're sort of working in much more smaller scoped parts of the code. That sounds really interesting.

I am very excited to read that. Do you have a release date or release timeline? I don't know. Is that just a little question to ask? It's still very much in the air, but probably summer 26.

Cool. Yeah. That's an exciting project for me. Because of that, I have a lot of sort of fundamental web things in the back of my head. I think about that a lot.

And I'm slowly filling up my note-taking system with a lot of notes about the web. Long-term listeners will know that a thing that I like to put in my note-taking system are notes that capture heuristics and mental models, ways of thinking about a thing. We've done episodes before where I'm like, hey, here's like three or four different ways I like to think about Ruby numerators or here's a heuristic I use for managing branch and code. Things like that. So they often turn into episodes as well.

And what I was excited to talk about you where with you today is a sort of fundamental question of what is a web browser? So if you're sort of paired with a junior developer or an apprentice or something like that, and it's their first week on the job or something and they're feeling a bit overwhelmed, they come up to you and ask you, like, really, what is a browser? How would you answer that? Oh, goodness. I'd probably start with a joke or something like it's where the internet lives.

So the internet's home, which is simplified and incorrect or incomplete. I'd say, yeah. That's a good question. Like, I haven't actually thought about that a whole lot. This actually, this makes me think of way back 70 million years ago when the internet and I were both babies and we got an AOL disk in the mail and I, you know, had my first going online experience.

I remember being frustrated using AOL because there was all this stuff you could do within their little world and I couldn't figure out how to get to what I thought of as the real internet. And by that I meant a browser where I could type in a URL and go visit a page and I remember being really confused. Sort of like, I'm on the internet, but it feels like I'm not on the internet. What's happening here? Right.

What's the difference between like the real internet versus just the AOL world? Right. Yeah. So I guess thinking about it that way, I would say that like a browser is a tool that you can use to navigate to different, I'm going to use the word website very broadly here, websites and interact with them, view them. I think that would be my first answer.

Browser is how your code usually gets to your user. It's literally browsing. Yeah. Yes. Browsing.

I think for me, when I was sort of breaking down, because this is a sort of fundamental question I have to answer, I sort of looked at it from a few different dimensions, but one of them that was really interesting to me, if you sort of strip away all the fancy things that a browser can do, what is it at its core? It is a graphical program that can issue HTTP requests on behalf of your user. So we're developers. We can make HTTP requests via curl on the command line and that works. It's not a very ergonomic way of doing things around the web, especially if you need to do a lot of different requests.

And so a web browser sort of takes very simple user agent like curl and makes it graphical. Now, instead of going around and typing things out, you can just click buttons. And I think it does this in sort of a few different ways. One is that it allows you to issue an arbitrary get request to any place you want, just by typing URL in the URL bar. Secondly, it allows you to issue a get request to sort of a pre-defined location by clicking a link.

And then the really interesting one is that it allows you to issue either get or post requests, but then it allows the body of that post request to be customized by the user of your page. And that's what forms are doing. And if you just take that core of like, these are the things that a web browser can do, links forms, and I guess just make sense typing in URLs to make it your requests, you already have a sort of minimal model of like all the things you can do with the web. And it feels like a lot of what you then add on there is just sort of the look and feel of it. Would you know, saying just sort of look and feel like minimizes.

That's a huge part of the web experience is how it looks and how you operate, how you interact with it. But underneath, it's all HTTP requests, isn't it? I think for the book, I sort of posit that there's two key concepts you need to know to understand the web or to reason about everything else on the web. Those are our client server architecture and the HTTP protocol. You know, those two things you have what it takes to reason about just about every other topic that touches the web.

And so within that framework, that's where I was starting to think about browsers in this way. And I think that thinking about browsers in that way ties in very nicely if you're a Rails developer and you're getting into things like Hotwire, because Hotwire tries very much to work with native browser behavior. And yes, it does sort of hijacks and things and make JavaScript requests in the background. But when you're as a developer writing things, you are just writing forms and links and sort of native browser things to issue all of those background requests. If JavaScript is enabled, then Hotwire will hijack this and make those requests in the background and live update your page and all that.

But the beautiful thing is that if JavaScript is not enabled, your site still works. It's just that now instead of rendering in line, you're redirected to another page after you submit that form. But you don't need to be writing sort of JavaScript code to be making requests in the background. It's all just native browser things. That is definitely part of the appeal for Hotwire to me, which is that I am not the biggest fan of JavaScript, but they're cool things that I want to be able to do when my apps and Hotwire helps me do some of that without having to write so much JavaScript.

I guess. Yeah, so that's the first mental model. And I guess my reaction is like, well, yeah, that's it. That's how I think about browsers. But I'm really curious to know what's another way to think about browsers.

I think that's sort of more sort of standard-driven or sort of HTTP-driven models, maybe more how backend developers tend to think. Yeah. Because on the backend, you're mostly consuming those HTTP requests and you tend to think more about pages and form submissions. Maybe you're thinking in terms of JSON APIs if you're building an API. But I think that that model is a little bit more how on the backend you tend to see what browsers are doing.

Yeah, it's more of a discrete request backend process response. Right. Right. Request server something response. The flip side of this is that if you're just executing HTTP requests, what you get back normally is an HTML page and you need to display that.

And it turns out that browsers are really rich UI runtime. In fact, you can completely turn off your internet connection, not talk to any servers. So forget client server, forget HTTP. And if you're looking to build an interactive app, you can just write it so that it runs in the browser rather than having it use some sort of native UI toolkit, so for Windows or Mac or whatever. That's interesting.

Yeah. And thought about the idea of a non-internet-based application that runs through your browser. But there's no reason not to. It's got the full toolkit. You can do the sort of the built-in widgets that you can use to capture user interaction and then it's all scriptable with JavaScript.

And so you can build an application that's about as complicated as you want. And it doesn't have to be sort of tied into the sort of web or request response server cycle. It can be a thing on its own. Right. I feel like I've had the experience where like the internet's not working or a page doesn't load.

And yet there's some sort of interactivity in the browser to keep me entertained, like a little game or something. A little like a dino game that you get in Chrome. Yes, exactly. That's an interesting example. Like that's a pretty simple one, but that's an application that runs in my browser with no internet connection necessary or even relevant.

I think if we sort of look at it through that lens, that explains the ability to do things like to certain extent like React Native, where you're effectively writing JavaScript code. It's not quite the same thing because it also binds to some native sort of UI components. So it's not all like just load a web view and now you have an interactive thing. But you are able to write programs that sort of run effectively in a browser-like environment. I think that you also at that point, you can sort of push that and get things like PWAs, Progressive Web Apps, where they're not totally separated from the request response cycle, but they're built where they can sort of be downloaded and run offline.

You know, when you first suggested we talk about browsers today, I was like, okay, I don't think I have much to say, but sure. And now that we're talking about this, it's so interesting and I'm so excited to know what it can be. Like I haven't thought about browsers this way, but it makes so much sense. And it makes me want to build something that runs in a browser, but it's completely separate from the whole HTTP request world that I usually think about. I know developers, that's what's most accessible to us because we already know the tool chain, we know the environment, we know the languages, and you don't have to learn Swift UI, or you learn GTK, or you learn like one of these other UI frameworks that you need to do.

And I think that's one of the real beauties of the web. Oftentimes, I think when you learn non-web languages, the thing that people teach you to do is, oh, we're going to write a command line program because the graphic stuff is actually kind of complicated. Yeah. But that always really frustrated me because there's not as much of a like payoff for me in terms of excitement for having built something by looking at a just text coming in and out. I want a program that does something visual.

It's less fun to show off to your non-coder friends and family when they have to interact with the command line. Absolutely. Have you ever tried to debug an issue in production while switching between your error tracker, log viewer, and APM tool? Maybe you know how painful it is when you can see the error, but can't find the relevant logs, or when you see slow performance, but it can't connect to the root cause. Scout monitoring is all in one platform, built to make your life easier, with log management, performance tracking, and error monitoring coming soon.

All of your data will be together at last. You'll go from bug to fix in one place. The result? Less context switching, faster debugging, and monitoring that actually helps you ship code instead of distracting from it. No DevOps team?

No problem. Scout works with your existing stack and gives you insights in five minutes, not ours. From bug to fix in one place at ScoutAPM.com. I think this view of the browser as a UI runtime is a little bit closer to what a lot of front end devs see things. The idea almost that the network is there, partly because you need a centralized place to share data across different clients, and like a database to store things in.

But also, it's effectively a place where you just download a program to be executed on your local machine. Your browser is a UI runtime, so you make an initial set of HTTP requests to pull down a bunch of executable files instead of having a program saved on your machine, and then you execute it. The initial request response cycle is really only about almost downloading a program and then running it, rather than thinking about it as more of a back and forth HTTP. That makes me think about how the different browsers that you can use as a person who thinks prefers to think about the backend, I don't think about that a lot. I probably should think about it more, but I don't spend a whole lot of time thinking about our user's going to be using Chrome or Edge or Firebox or something else, because from the backend it doesn't matter a ton.

But I think the closer you get to the browser and the closer you get to the front end, the more all of that matters a lot, because they're different runtime frameworks, and so they're all going to interpret things differently. Yeah, and that's the thing that's a little bit tricky, is that they all will interpret your code a little bit differently, and they might even offer slightly different capabilities. Sometimes they'll have a feature that's available to you in Chrome, but not available in Safari. Again, going back to some of the ideas from the book, the core thesis of the book is that you have to think of the web as a platform, and looking at it through that framework, sort of a meta-mental model, allows you to do all those other things that I'm hoping that you can do.

Part of understanding the platform is that it has a lot of capabilities and limitations, and what are the different bindings that you have? And code that executes on one platform might be different or not even have access to the same things on a different platform. So JavaScript that runs in the browser has a totally different set of things that you can do than JavaScript that runs on the server in Node.js. But within that, I'm talking about web as a whole of the platform. Each browser is its own little sub-platform, and they're slightly different as well.

So now you've got to think about all those variations. And then each browser on different OS's, you might say Chrome, and feel like you've covered one thing, but are you running Chrome on Windows or Mac or Linux or your phone, or I've got a first-generation iPad? And it can browse the internet, but a lot of what you expect to see on the internet doesn't work there. I'm a big fan of the website, can I use? That's a great place to find out what is available on these different platforms.

Also if you're thinking in terms of browsers, this maybe pulls us back into more of that mental model of browsers as HTTP user agents. Are you familiar with the Lynx browser? No, what is this? This is an entirely text-driven browser. It runs in the terminal.

You sort of give it a URL, and it will then sort of make that request and give you sort of a, I guess, rich text in the terminal, whatever that ends up being. And there's a few keyboard shortcuts so that you can sort of trigger requests by, I guess, effectively clicking a link, but it's all keyboard navigated, submitting forms and things like that. But it strips away all of the JavaScript, it strips away all of the sort of fancier interactive HTML stuff. And it really is just a content text and the ability to follow links and submit forms. So it's different than just doing a curl request because I'm assuming taking the HTML and using that to structure the text that it displays as opposed to just spitting out all the tags and whatnot that a curl request would do.

And you don't have to manually craft the request and say, I want to make a get request to this place with these parameters. It does allow you to just say, oh, I want this link here with this link text. It's not quite clicking because you're doing it with a keyboard. It's more like reading a Markdown preview and clicking a link there and it takes you to another Markdown preview and you can fill in forms. This immediately makes me think about accessibility and the idea that if you want to know if your website is truly accessible, how does it look in this Lynx browser?

Yeah, does it work in Lynx? Yeah, because if you can't, if you have to use a mouse or if the visual display of something is the core of what you're trying to share, people with visual differences or who don't use nice or whatever are not going to be able to handle your website. Yeah, and there are some types of websites that just will not work in something like Lynx because especially if you're leaning into that browser's UI runtime, well, maybe you have a bunch of things that are meant to be more visual, more interactive. Maybe you're building a game and browsers run, you can interact with WebGL. You can work with Canvas for two-dimensional things.

You could run a full-on 3D game if you wanted to directly in the browser. That's not a thing that Lynx can do. I'm imagining it can't even do video or audio or images. It's really if it can't be represented in text. Yeah, I'm not sure what it does for that.

Been a few years since I've tested it out. But for those who are curious about that, we'll put a link in the show notes. I'm definitely going to play with that after this. Wonder if does it just display the alt text? That would be a good solution.

Or in the world of AI, does it have an AI generated or could it have an AI generated description of the image that would be displayed instead of displaying it? I was almost thinking, and this is where things get really wild. You just get the alt text and a local model generates an image for you based off the alt text. I love that. It's a horrible idea.

It is. It would definitely result in not at all the image that you actually got. But it could be a fun game. It's a little bit like AI telephone. Yeah, I was thinking, were you like, draw something and then the next person has to write down what it is.

And then the next person doesn't see the drawing just because it's written down and they have to draw it and it goes around and turns into something terrible. Is it the televisions I think? Yes, yes. It's really like a lot of illustrations but with AI. I can imagine this is a really horrible idea in the world where you have a lot of processing available, but bandwidth is really limited.

Yeah. So you're like, oh, transferring an image over the network is just possibly expensive. So what we're going to do is I'm going to have an image on the server and I'm going to have an AI generate alt text for it. Send it down over the wire because text is cheap and then have an AI on the client try to reconstruct an image based off the alt text. Yeah, I mean, if you wanted to go almost off the grid but not fully.

The world's worst compression algorithm. Yeah. It just guesses. So you said that you've been sort of getting more into the front answer react world. Yeah.

Do you feel like that is maybe sort of reshaping a little bit of your view of what a browser does? Oh, but yeah, I think the thing that I've been thinking about differently or more is the idea of like state management and local storage. You know, if I'm working in a pure Rails app, no JavaScript, no React, just ERB, HTML stuff and request back to the server, generally I think about data in the context of an HTTP request and comes from the server to the browser, the browser renders it or goes from the browser to the server and the server does something with it or stores it. And so now I've got this whole different world where it's like it goes to the browser and then the browser we're using a lot more of the power of the browser to store things and manage things and manipulate data.

Data persists across multiple requests on the front end. Yes. Yeah. It's not the sort of pure like almost stateless HTTP where you're like request response and we're done or maybe we start again, but we're sort of starting fresh every time. This is a we're slowly building up state locally and it's a full on app.

Yes. So it's definitely thinking differently about, yeah, what a request is and what state is and what the browser knows and what the browser doesn't know. I think, you know, one of the biggest bumps so far is understanding when things will persist across requests and when they won't and how to, you know, manually refresh things that I don't want to persist and how to make sure the things that I do want to persist are persisting. I still can't understand why some things get rendered so many times. Like component tree, like when do you trigger a re-render versus when do you know that the data hasn't changed?

You know, put a debugger in the like Chrome DevTools to sort of see why the state isn't what I expect it to be and realize like, oh, we're hitting that point like 15 times when I thought we were only hitting it once, which it turns out is not always a sign of a huge bug. Sometimes that just happens and that's part of what we're just doing. And so adjusting to that has been interesting for me, for sure. That's interesting because I feel like that's very much moving into sort of the types of issues that you see in your UI runtime where you're like, oh, well, why is this like redrawing the section of the screen more often than it needs to? Why is this or re-computing these properties?

Those are sorts of things that you have to think about more in a, when you're building a GUI than you are in a sort of traditional web page. Yeah. And thinking about the scope of different components. You know, like these components are both on the page at the same time. So it's easy to be like, oh, this is just one page.

But really they have different like little worlds of scope that sometimes overlap or interact and sometimes don't like just because they're all being displayed at the same time doesn't mean they all know about each other. It's not one big flat HTML world. Yeah. It's not just derived from some sort of core state components can have their own state, which has its advantages and disadvantages. The Elm language tends to prefer to have a sort of single source of truth, like A state that's at the root and then everything is derived from that.

And that simplifies the model a lot in some ways, but also can make it harder because you have to pass everything into every component. And if you're like doing deeply nested components, it can get like really annoying in terms of just doing the plumbing of passing everything down from those sort of root state of or store state. Yeah. I've been pleasantly surprised by how easy some of that is in the UI, you know, not all of it, but like, you know, I'll be approaching it thinking like, okay, I need the information from here to be available over here. How on earth do I do that?

And sometimes it's a lot more straightforward than I realized. I'm just, I'm really appreciating the power of doing stuff on the front end. It's, it's really cool. This past summer, I give a talk at RailsConf highlighting 10 impactful blog posts on the Rails community for the past couple decades. The last one on my list was an article by Radan Skorik asking about whether you should use Hotwire or front end framework in your next Rails project.

And he gives a really interesting mental model there or a sort of maybe a heuristic to say most problems on the front end fall into one of two buckets and it's a bit of a spectrum, but they're either the big thing that you have to solve is a lot of like visual interactivity or the big thing you're trying to solve is state management. And he posits that on the spectrum front end apps that are more on the visual interactivity side of it would benefit from something like React and front end apps where they don't need that much interactivity and state management is the bigger problem, then they're better off with something like Hotwire. Interesting. How I guess I'm thinking it's been a while since I've used Hotwire and I actually haven't, I'm excited to get to use it again at some point because I think it's really interesting but I think there's a lot that I don't know about it yet.

What would you say or what would he say makes the Hotwire more appropriate for state management? How does that work? Because it eliminates state management on the front end. Okay. Now you're back to that sort of classic model.

The browser is just issuing HTTP requests. The source of truth for state lives on the server and is just sort of sending down scraps of HTML. So that's more towards the like cheaper network requests. What we were saying before about being like almost entirely off the grid. I've got this supercomputer that will you know interpret this alt text and turn it into an image for me because it's expensive to send information but cheap to process it.

It sort of feels like Hotwire leans more into that like we're going to be sending a lot of information and doing less processing on the front end and that's our service responsibility. Right. We're sending sort of already rendered HTML snippets and then we're just sort of inserting or removing them from the DOM and that's most of what we're doing. So you're a little bit more limited in terms of what kind of server interactivity you can offer. Particularly interactivity that doesn't involve a round trip to the server.

But if most of your interactivity does involve round trips to the server anyway and you don't need anything too fancy that can be a way to sort of eliminate a lot of your state problems. Let's just say let's keep source of truth on the server and sort of work with a more minimal approach there. So I thought that was a really interesting way of framing the problem. I'm sure you sort of sit down and maybe pick holes in a little bit or find situations where like you know what I do prefer a more front and heavy situation even if it is a state management problem. But I think having that in mind as a mental model or a heuristic is going to be really useful on future projects.

I'm wondering how you would adjust that heuristic to account for if you're building for a specific user base that maybe you know isn't going to have the greatest internet connectivity. They're in rural areas or they're I don't know coal miners mostly using your app underground. How you could leverage that difference to sort of optimize their experience for less connectivity or if they have connectivity but you know not super powerful client machines sort of thinking about it even deeper like less what exactly do I need to do and more what am I users have access to what is easy for them and their devices to do and what's hard. And that's a whole other sort of set of questions right but now you're talking about cell phones talking about handheld devices.

If I'm on an older phone I might not have as much processing power. Maybe I'm on a new work phone I have really good processing power but I'm in an area where I don't have great connectivity. What does that experience look like? Or I'm on a limited data plan. You know I've got good connectivity but not a lot of it.

I don't want to spend it all on just your site. Yeah I don't need to download your fancy interactive which I just need you to tell me when the train will be here. And then at that point you know you sort of have break it down into sort of initial download and then sort of continuous downloads that happen afterwards because of sort of a more like download and application into your runtime approach the initial download is often much bigger with the idea that subsequent requests are smaller and that leads to sort of maybe faster things although if you're waiting on a request to the server anyway it's possible that doubling the size of your payload isn't going to make that much of a difference if it's sort of the network connectivity in general if you're talking about HTML versus JSON.

There might not be that much of a difference between the two but maybe you can do a thing sort of locally where you do optimistic updates and now like it feels like the page is doing things you're not just waiting you don't have a spinner. Yeah there's a whole world of sort of I guess front end UI engineering about managing these problems and thinking about the performance issues and the network latency and the bandwidth issues at all of these different levels as well. Browsers are a lot more interesting than I assumed at first. Yeah there's so many different things you can go into and I think there's a lot of value in sort of seeing them from different perspectives not just sort of theoretically as we did a little bit today but also maybe putting yourself in the shoes of a front end developer versus a back end developer and realize how we tend to see things very differently.

I've definitely felt my brain sort of changing a little bit with how I am starting to approach problems with a more front and heavy application I'm working on. And that's the value right of a breadth of experience. Someone who's worked front end and back end who's full stack really says experience across the stack all of a sudden has a lot more to offer when they're faced with a new problem than someone who's sort of only experienced one side of things. Yeah yeah and it's helpful to know how to do something on both sides and then evaluate what's the best way to handle this situation. You know like filtering data or paginating data.

Do I want to do that on the front end or I want to do it on the back end? Now you're back to you know payload sizes and all these things and does data live where does data live and all that. Yeah how often does data change? I think also you know sort of experiencing things on the front end versus the back end. That is growth that's happening and if you're doing projects where you have to do one versus the other and you're I guess you have the maybe the courage to be put on an initiative that's in an area where you're less comfortable in there's your growth within your 40 hours a week.

And I think that's one of the best ways to grow. I find that you know sometimes when I try to learn something on my own by thinking of my own idea for a project it's pretty easy to accidentally change not accidentally but like not realize that you're changing the requirements to fit your skills. Right right now whereas when I'm building something for someone else I can't just change that feature because I don't know how to do it. I have to go figure out how to do it. It's definitely a different kind of pressure and motivation to solve certain problems.

Yeah hopefully you know this episode has been maybe a little bit eye-opening for some of our listeners or it's caused you the listener to maybe question for yourself what does it mean to be a web browser what does it do? I had a couple more mental models we don't have time to go over them today so I guess they'll probably come up at some point on a future episode or people will just have to get the book. On that note shall we wrap up? Yeah I think we should.

Frequently asked questions

How long is this episode of The Bike Shed?

This episode is 44 minutes long.

When was this The Bike Shed episode published?

This episode was published on September 9, 2025.

Is there a transcript available for this episode?

Yes, a full transcript is available for this episode. You can read the complete transcript on the episode page.

Can I download this The Bike Shed episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.