Karson's Korner - A conversation on practice before theory, hx-swap-oob, and optimistic uis with htmx creator Carson Gross

Lazarus:

Alright. So talking today with, Carson Gross. And, Carson, thank you very much for joining today.

Carson:

Yeah. No problem. Happy to be here.

Lazarus:

Nice. So, yeah, I kinda put together a a grab bag of of items because, you know, there's just, like I've been doing a lot of HTMX stuff, and there's just a lot. So I'm, you know,

Carson:

happy

Lazarus:

to go, you know, to talk through any of it but I think there's not a huge intro needed for you. Most people who are listening to this or watching this probably know who you are. But, yeah, my first thought was just like, big curiosity, just kinda like what is your what's your day like and just your your day to day work?

Carson:

Yeah. Well, at this point, it's pretty chaotic. So I teach at a university, and that is, really great because it's flexible, and I don't have to go in and, you know, be there at a specific time. But, I I have a lot of other things that I'm doing. I'm actually believe it or not, I'm the president or, I guess, it's called the chair of the local youth baseball thing.

Carson:

And man, oh, man, the last 3 weeks of my life have been like I feel like I've been working 40 hours a week on just youth baseball because it's the end of all stars, and so there's regionals, and there was the state tournament and all that. And so, that has ended up taking up quite a bit of my time. And at summertime so I'm off from my university so I don't have an excuse. So everyone else has, you know, to do stuff and I've got actually, you know, so. But, I do I so let's see.

Carson:

What's a typical day like me for me look like? Like, I get up, and I do, like, typically get on Twitter right away. Like, when I'm waking up, I just, like, go and, like, check-in and, like, I'll often, you know, schedule some tweets for later in the day. Like, I I wake up and I have, like, a couple ideas around jokes or something like that, and so I'll schedule those. I hate the scheduling UI for the it's actually better on the phone than it is on on the desktop.

Carson:

But, so I'll do that. And then, you know, it's it's very chaotic. Like, if I have time to work on it, HTMLX or something like that, I'll take a look at the bugs and try and see if there's any that are obvious and need to get addressed immediately. You know, I just released a new version of the paperback, and so I've been doing a fair amount of, like, marketing around that and just trying to engage people and get them interested in that. Very boy, it's super chaotic, though.

Carson:

I don't know if I have a typical day at this point, which is kind of bad for me. Like, for a long time, I had, like, a normal 9 to 5 job. And, I'm, this last year with HDMI getting so popular has been really, you know, obviously very neat in many ways. But, I do kinda miss the 9 to 5. Like, just go in, it's 9 o'clock, Start your job.

Carson:

It's 5 o'clock. The job is done. And, you know, I don't feel like I have to, you know, be quite so on all the time. So, you know, maybe things will settle down here, I mean, in a little bit, and we'll, you know, get into a more normal situation. So I don't know I don't know if I have a normal day.

Lazarus:

Yeah. Well, it sounds like it's like at least now if baseball has taken over that part of, like a large portion of your life. So, yeah, I'll just I like, you know, I'm a I did volunteer to be assistant coach for my daughter's softball team. And that was like the limit of my participation because like I love, you know, I used to play baseball and I love it and like I know you know a couple years ago I noticed the pitching nobody was really showing them how to pitch and so it's like such a huge part, it's 10U so it's like the first time they're pitching to each other and it's like nobody was doing it so I was like, all right, I can handle this and like even just that, like assistant coach doing a specific thing on the team that is and I also keep the books. Yeah, like I don't think I could do more so I'm just taking on the whole league.

Carson:

Yeah. You know, it's just it's I feel like it's a lot like anything else, though. You do it, and then you just figure it's like having kids. Like, oh, I could never have kids because, like, you know, or I could never have a 3rd, you know, 2nd or 3rd kid, and it's like, I just can't figure it out. So I don't I don't necessarily wanna recommend it because I'm pretty exhausted at this point, but I feel like, you know, anyway, people can do stuff.

Carson:

Like, when you sign up, we I've kinda told my wife this. And particularly if you're a perfectionist, like, you just kinda have to accept, like, a lot of the stuff isn't gonna get done that well, but it's gonna get done. And, like, that's okay. And so, you know, I think that's for me where I've kinda gotten to mentally for a lot just a lot of stuff. Even like HDMI at some level, like, there's so much like, we'll talk about out of band swaps and all that here.

Carson:

There's a lot of stuff that I look at and I'm just like, you know, the implementation, if you're gonna complain about the implementation or whatever, like, fine. Like but you just okay. This is good enough. It moves it moves society forward in some way.

Lazarus:

Okay. It's it's pretty damn good. Look at this. It worked.

Carson:

Yeah. It works. It does a thing. Like, we had a baseball season here. Like, that was good, you know.

Carson:

Yeah. Good.

Lazarus:

Okay. So yeah. So it's pretty you know at least now if you don't have the classes. I, like, can't imagine doing a professor working as a professor and mixing in, like, all the other stuff. But, I mean, you know, like, my day is pretty chaotic, but I have kind of just my own basically web development type thing.

Lazarus:

So I I try to keep it at a 9 to 5 as much as possible. Yeah.

Carson:

I really am missing that right now. Like, I feel like I want that back. There's always pros and cons to everything, and I'm you know, I've been like, I am I do consider myself very lucky to have been as involved in baseball with my kids as I have been because it's been a way for us to really connect, you know. Yeah. My oldest doesn't play baseball anymore.

Carson:

But, you know, really it was a big part of our lives for a long time. And that's one of the reason why I'm so passionate about it. I talk about it obviously almost as much as I talk about h g h t m x. So, I've I've been very thankful that I've had, you know, the opportunity, the flexibility, like, now going on a decade to to be a big like, to to coach and to, you know, be a big part, like, travel with them when they need to travel and stuff like that. But, there like, when I was younger, and and when I was in the Bay Area for a long time, I, like, I had a much more traditional job and there's, maybe it's just nostalgia or whatever, but I kinda miss that, like, you know, going into a spot.

Carson:

And then the other thing that I really miss, and you don't really get this as a professor is, although I'm starting to do research and maybe it'll show up there, is just the collaboration with people face to face, you know, like, I collaborate with people online. And that's great, but it's just not the same as sort of, like, face to face collaboration, even just, you know, talks like this, like, it's cool. You know, it's great to talk and everything. It's not the same as being in a physics same physical space and being able to whiteboard and stuff like that. So, I don't know.

Carson:

Maybe, it's probably just nostalgia. When I was younger and I didn't hurt so much, but I feel like that right now, I kinda long for that, for that environment. No.

Lazarus:

I get that. I I sometimes think about I'm like, man, it was nice going into work and like having a couple buddies, and like I learn all this new stuff I never would have learned, like just about life and about music, and like you know the people in your office, you party with them. It's good.

Carson:

Yeah.

Lazarus:

But then, like, logistically, I'm, like, do I really would I really actually wanna drive into work every single day right now? And, you know, I I feel very lucky that I don't have to, but I also Yeah. I also miss it. Like

Carson:

Yeah. Just sometimes Yeah. It's I don't know what to do about it. Trains. I like trains.

Carson:

I took the train to work for a while. That was cool. But, you know, we live in America, so no trains unless you're in a very specific location, I guess.

Lazarus:

Yeah. But, I mean, you're teaching in person. Right? Like, it's not you're not Yeah.

Carson:

I teach in person, and so I get to interact with students, and that's good. But that's a, you know, that's it's not the same as, like, a peer to peer relationship. I am again, I'm I'm doing I'm starting to do more research, and so hopefully that'll, like, come out of that. But then, you know, research like, academia is, kinda clicky and, like, you know, it's not as when you're at a company, you're just trying to get stuff done. And so, you know, it's

Lazarus:

Ideally. Yep.

Carson:

Yeah. Ideally. That's true too. For the and maybe a big part of it is just the company that I happen to be in, which is a company called Guidewire. And maybe I was just there at the right time in their growth cycle, but, you know, I learned so much at that company so fast compared to what I learned in school.

Carson:

Like, I went to school. When I went to grad school, I wanted to know how to make a programming language. That was, like, my big thing. It's like, what's how do programming languages work? And when I came out, I barely understood it.

Carson:

And, but then I went and worked for this company Guidewire, and I worked on they had a custom programming language called, it was called Gscript and then GOSU. And I was like, I learned more in like 6 months there than I learned in all of undergrad and graduate school combined. Like, I learned about recursive descent. There wasn't a good book at the time on recursive descent, so you kinda had to learn it from, like, just anyone who happened to know it. And so we were very lucky.

Carson:

So maybe, you know, maybe it was just, like, right place, right time, but I do look back very fondly on on that time in the Bay Area.

Lazarus:

Yeah. Yeah. I definitely feel like the practical like, for some people, just the practical experience of working on a project, like you just learn so much more because I mean I did a CS degree too and it was like I don't regret it because it's like I don't know, I know I learned a ton, but yeah like the last 2 years I was there like I don't know how many classes I actually used a computer. Right. You know I was doing like theoretical stuff and I was like figuring out inductive reasoning and it's like I you know as a practice, like just in general, like I tend to be more like okay how can I use this and Right?

Lazarus:

For some of that stuff, I loved some of it, but it wasn't like, you know, I did learn a lot once I started programming on my own.

Carson:

Right. Well, and I think what you you know, like, someone something you're touching on there is something I definitely believe really strongly as a professor too, which is that theory should come after practice. Like, we do it the other way. Like, here's all this theory, and now go write code. And it's that's not the way to do it because you don't have any context.

Carson:

You should do you should practice first. You should build software first, and then, like, okay. Now, like, let's talk about why that was slow or, like, let's talk about recursion. Right? Now that you've used it for, say, recursive descent.

Carson:

And so in all my, classes, I try to have very practical projects where you write a lot of code so that you see the the, like, the practice. And then, you know, what's the there's I think it was Aquinas was like, what is it? Like, existence brings essence into being, I think is the saying. Something like that. But, like, it's like

Lazarus:

Aquinas the philosopher?

Carson:

The philosopher guy. Yeah. And I like, that's a that's a, an idea that really resonates with me. Like, this idea that, like, doing like, see looking at stuff and then building abstractions from and, you know, I say this in the Greg brain essay too, where it's, like, don't start with, like, high level abstractions. Like, build stuff that actually does stuff.

Carson:

And then looking at those, now maybe you can, like, get up at a higher level and see an abstraction that makes sense that covers all that. Maybe not. Like, don't feel bad if there's not something there. But go the other direction. You know, academically, we've always like the way it's set up in computer science anyways is you start with theory and then move to practice.

Carson:

You know, or you I guess you have a little bit of practice, like, right at the start where you learn Python or whatever. But then very quickly, you move into these things where, like, you don't know how to write software, but, like, here's here's big o notation, and, like, here's, like, you know, all this stuff that's, like, I don't know. Like, here's how

Lazarus:

to, you know, another go ahead. No. Just and some people, like, really connected with the big o notation stuff and that, and like I had friends and I was just like man, like you guys are smart, and like I'm not like I got nothing against like people who go down that route, one of them actually ended up going to work for

Carson:

Google pretty early on, and I

Lazarus:

was like, this guy's going places, that's great, but yeah, I was this it's not it's not exactly gonna help me in my next project.

Carson:

Right. Well, I mean, it the thing is is, like, all that stuff is useful, but I just think, again, for a lot of people anyways, maybe not for the, you know, the people that are just naturally gifted at computer science, but for a lot of people, seeing the practice first, like, what is a for loop? Like, how do I write a for loop to do something useful? Right? Like and then, okay, like, what is like, let me use let me use recursion for something useful, and then we'll talk about the theory.

Carson:

Right? Like, that to me is, like, a much better way for a lot of people. Not for everyone. You know? It's always context dependent.

Carson:

There's gonna be people that, like, really thrive one way or the other. But for I think for a lot of computer science people, it's it's a disservice to give them all this theory. Well, you know, a good example for me, just from my, like, career was hash tables. So, you know, I'm in grad school and I kinda had an idea what a hash table was, but, like, we did a whole, like, 3 weeks of, like, the theory and implementation of a hash table in c or c plus plus or something like that. And I got, like I just was, like, what is this guy talking about?

Carson:

You know?

Lazarus:

Even just the name of the hash table, it just sounds And then confusing.

Carson:

I just yeah. I don't know what this is. And then I went out into the real world and started programming, and I'm like, dude, these hash tables are awesome. Like, this is awesome. And so what I think, like, in a way in an ideal world, I think it would have been far better for me to be like, here's how do you here's a hash table and, like, let's do some useful stuff with a hash table.

Carson:

Like, what can you do with a hash table? Okay. Like, isn't that useful? Cool. So here's how you implement one.

Carson:

Here's all the, like, the details that here's what's going on on the inside to make this really useful thing, like, work. And then that would have been way better for me, like, as a student to, to understand, you know, what what's going on. So I don't know. I'm kinda being the dead horse here, but, like, I I just feel like, practice before theory is is often very good.

Lazarus:

Yeah. It's such like a small theoretical change too. Like, you're still teaching the same stuff and it totally speaks to me because this is how I always learn, like I just I'm not learning until I'm trying something out and then it's like then this theory stuff actually clicks, I'm like okay, I

Carson:

get it.

Lazarus:

I think that was, you know, the first time I came across some of your stuff including htmx before this, grogbrain was the first time I kind of like came across that and I think that stuff, I don't know if it was from working in companies or from whatever, like I don't know what it felt like a lifetime of pain like condensed into this sort of essay, essay with humor I guess I would say and I just like that spoke to me on a lot of levels and I think you know looking at like the whole sort of body of work of like the GRUG brain, the HTMX, like it's all and probably your teaching, you know which I haven't been in class to and it sounds like, it's kind of going towards this similar place of like Yeah. You know, I can't quite describe what that similar place is but it feels very internally cohesive to me.

Carson:

Yeah. I really like when I heard that quote, existence brings essence into being, I really was like, dude, that is what I'm that's what I'm trying to say in my own idiotic way. Like, do stuff and then, like, and then the, like, music of the spheres, you know, conceptual stuff can be built on top of that. So, you know, I think, you know, it's particularly in my teaching. That's definitely, like, just for me, it's always if I don't you can't just tell I'm not that person that you can tell, like, here's the theory, and then I'm like, okay.

Carson:

Like, I didn't understand grammars until I wrote a recursive descent parser. Like, I mean, I kinda knew, like, how to make the, you know, symbols work and sort of what they did.

Lazarus:

But I didn't, you know What do you mean by grammars?

Carson:

Like like an e b n f grammar of whatever, back as normal form grammar, like the like what a gram like the way you would write a formal grammar for a language. Like, I didn't understand that until I wrote an actual recursive oh, you know, I took the class at Stanford, like, come on. Like, you know, I'm not that dumb. It's just it didn't click for me until, like, I wrote a recursive descent parser, and I'm like, oh, it's grammars are recursive because look at the recursion right here. I'm like, okay.

Carson:

And, you know, that's I've it's one of the reason why I'm such a huge fan of recursive descent. It's like it shows you. Like, you see the recursion and, you know, you can step through it and debug

Lazarus:

it. I have not had that moment. And every time I have to work with recursion I had to like move into a different my head space because I just it didn't I would say it never quite clicked in terms of like the real usage and then when I did get it I was like oh man this is great, this is awesome. I love this. And then a week later, I'm like, how did that work again?

Lazarus:

I'm like, it's like I had to keep resetting.

Carson:

Yeah. I've I think I've just written enough pro and, like, I teach the programming language class here. That obviously helps quite a bit. You just get used to it. But, but that book, Crafting Interpreters by Bob Nystrom, like, that's a fantastic book.

Carson:

And if you really wanna understand how to write a language, you know, I had especially the first chapter, it's in Java. You can do it in Python or whatever. So it's garbage collected, so you don't you don't have to bunch worry about memory management and all that. And, I think that's an ad like and it's an absolutely excellent book. He did a he that's, like, the peak independently published book.

Carson:

Like, it's such a gift that he gives it away for free online, so.

Lazarus:

Oh, nice. Yeah. I feel like I haven't quite gotten like I'm still in the phase of my life and maybe I always will be where I use the tools that people build. I have never been a source diver or to edit stuff. I've actually like I've thought about it with h tmx I'm like someday I'm gonna look into the code and see what's going on there but I'm just like nah not now.

Lazarus:

I think I'll just figure out

Carson:

how to use it. Yeah. I'll figure out how to use

Lazarus:

it for now.

Carson:

There's this video I did a walk through of the source code. Oh, really? On the on on the essays page. If you I think it's down at the very bottom. I walked through it.

Carson:

I walked through the 1 point o code, but the 2 point o code is almost the same. So, and, it's not that bad, you know. I feel like even if you don't edit it, just being able to set debug breakpoints and, like, you know, the the 5 places that matter is, like, that's something that if you become an advanced HTMLX developer, one thing I hope as opposed to maybe React I don't know. I don't know React very well, so I can't I can't say for sure. Yeah.

Carson:

Yeah. But I hope HTMX is something that most developers who are using it feel like they could set a breakpoint in the code and be like, oh, okay. That's what's going on here. Because it's just not that much code at the end of the day, and there's really only a few spots that matter. And they're pretty obvious, I think if you, you know, you look look over the code base.

Carson:

So I would encourage anyone who's an HMX developer to to take a look at the source code and feel like it's not, you know, it's not magic. There's there's a little bit of some crazy stuff, like the way we gather parameters from the DOM, trying to match the way HTML works normally, and, like, hit the history support as a little crazy. And there's there's a little bit of weirdness around the way we do swaps so that we make CSS transitions work. But for the most part, I mean, it's just it's an Ajax call at the end of the day. So he gets a find where I knew up, where I knew up in an ex HR and set a break point there and watch what it does.

Lazarus:

I guess I like I don't even know under what circumstances I would feel the need to do, like because I'm like, I don't know like which I I guess if something wasn't working, but I would just be like, I guess that doesn't work. Like, but it's like every all the stuff that's there, as far as I've used, I mean it works as advertised so like Right. I would never sort of like feel the need to source dive at this point.

Carson:

Yeah. I had someone today on Twitter complaining about the queuing. They were trying to use, like, some advanced queuing stuff, and they were complaining that it wasn't working to spec. And I wouldn't be shocked if there's, you know, bugs in there because the vast majority of That

Lazarus:

looks so tricky.

Carson:

Well, you know, and most people use normal, like, just like q one event, and then that's it. And so I wouldn't

Lazarus:

be surprised if there's bugs

Carson:

in there. So I was like, ah, just set a breakpoint or, you know, fork the code and put a couple log statements in there and see what's going on. But, you know, it's not there there it's not magic. There's nothing magic about it. That actually, I do have to say the queuing code is a little crazy.

Carson:

So I

Lazarus:

would little magic in the

Carson:

queue. Yeah. It's a little hairy, but it's I thought given I mean, it is a little airy, but like the queuing goods only, I think about 15 lines and I like, I got it all right. And I'm like, okay, don't touch anything. As far as I could tell it was right.

Carson:

Like, I was like, okay. Don't touch anything. And then, you know, wrote the test, and it worked according to the test anyways. So, but, you know, you never know. So

Lazarus:

Yeah, that was one I was like thinking about trying to figure out how to do an example of it and I was like, I might save this one for the future. Even just setting up an example is like, it's getting complicated how fast can I do that? I really think like the only thing

Carson:

to me that makes much sense is just drop, Like if there's a request

Lazarus:

Well what about replace though right?

Carson:

Yeah replace

Lazarus:

So I replace is the only one I use because it's just like okay, if I'm sending a really slow one I just want usually this is like lookups, like I'm doing a lookup and I just want my latest one, so I that replace is like the only one I've used.

Carson:

Okay. Yeah. Sorry. You broke up on me there. That's very unpredictable.

Lazarus:

Yeah. Yeah. So let's start okay. So you mentioned this is a topic that you added, OOB swaps. Are they a good idea?

Carson:

I don't know.

Lazarus:

So I I can tell you my experience with them if you want and you can tell me whether that's a good usage of them. Sure. Okay, so let's see. Basically, the best use I've had So I've recommended OOB swaps for like unusual situations. You just you have some part of the page that you wanna update and this is like my default understanding of it, is like, let's say a notifications thing, you just edited something, every single page you want something to pop up in the notifications.

Lazarus:

So, like, when you return your data, whatever it is from any page, you also include this little, like, h x swap o o b with the ID of your notifications thing, and it puts your notification into there. Does that feel like a pretty good usage of it?

Carson:

Yeah. That seems reasonable. I would probably lean towards an event, like, trigger, like, a toast event and then catch that on the body just because that's what I've done before. But the the problem I have with OOB is that it was one of those, like, theory proceeds use. Like, I didn't need it, but I had people talking to me saying, like, hey, what about this?

Carson:

And I was like, I don't know. How does this look? And and then that kinda was it. Like, that was the extent of the design of that feature. And so I've always been a little uncomfortable with it because of that, because I've just never used it heavily myself.

Carson:

So I you know?

Lazarus:

Okay. So so let me tell you I'll just say briefly why I think the swap OB, I immediately was like, oh, yeah, I got like, this is cool, I got this. So before, like back in the day, before I learned how to use any framework, so this is like I was using straight PHP, I was wanting to write stuff from the back end because I was living in the back end world, I just was like, okay, I just said this is like, let's say 12 years ago, so really even before Laravel existed. And what I and then we had a project manager come in who was big on we're making an SPA, like we're turning our project into an SPA. And I was like, okay, I don't really know how to do this, but we're gonna do everything with Ajax.

Lazarus:

And so he was very client heavy, like he wanted to kind of build something with the client. So I was like, okay.

Carson:

Right.

Lazarus:

So I had this idea that I was gonna send everything from the back end. And the way that I did that was I set up a router in the JavaScript, like a single file that just all it really did was scan the new HTML, find the IDs in it, and send it send anything with that ID to where it was supposed to, like send that HTML to the IDs that were specified. So I mean, that's it sounds to me like an HX swap. Oh, it'll be like, that's, like, relatively similar. So from the back end, you know, I had a shell in my front end, my client was just like a shell, and then a backend was just sending everything so literally the entire site and this is like a massive site used by thousands of people and it was like, tons of lines of code, was using HX swap OOB like some version of that, some really primitive kind of version of it, and it ended up being, I would say like a mess, like kind of a disaster.

Lazarus:

Like I overused it. It was like way too much, too hard to tell, very nice from the back end because you could just kind of set it up. But trying to debug is probably what you would imagine if you set up a site yourself with HX Swap OOB as your only form of like, communication with the client.

Carson:

Yeah. Yeah. I mean and that's you know, I feel like there's some spooky action at a distance with it, like, to an extent. It's just this weird it just feels tacked on. So, but people use it and people love it.

Carson:

It's like HX boost. Like, I I'm on both sides on HX boost. Like, do you use HX boost? You know, Alex is on the core team. He kinda hates HX boost, and I'm like, I get it, you know.

Carson:

But then some people love just like, oh, just throw HX boost on there and everything feels faster, and it works, you know, most of the time. As long as you set up your styles and scripting, like, beforehand, it works great. And it's not as, you know, elegant and polished as, like, Turbolinks, for example. But, and certainly not as, like, polished as like live view in Marvel, but it works and, you know, it's useful. So, I just kinda, like, left it in there.

Carson:

So I'm not super I'm not I'm not a purist, in in for stuff like that, I'm not a purist. I'm a purist about some other stuff, like, as far as, like, a HMX. Like, the core idea is, like, abstract hypermedia controls. Like, that I'm a purist about. But, the, you know, this other stuff, I don't mind, like, having some like, people, like, oh, this is gonna be ugly.

Carson:

Yeah. Everything's always ugly. Like, big software projects are always ugly. You know? You're not gonna be able to architect your way into, like, making a 100000 line project, like, fun to deal with because it's just not.

Carson:

You know? You can make some good decisions along the way, like, have an event bus where it makes sense in the system and, like, you know, like, there's some real good cut points that can help a whole bunch, but there's gonna be some grunkiness, you know. So Yeah. So switch you know, it is what it is.

Lazarus:

Yeah. Yeah. I don't use HX boosts that often, but I'm not sure if it's just because it it's, you know, a lot of the stuff that I've been sort of adding HTMX to is, like, the site already kind of exists. Like, I work on a lot of big projects, and so I'm just taking a page that's our I'm not sort of rebuilding a site from scratch using htmx. I might use htmxboost for that more, but it's like taking a single part of the site and completely redoing it with HTMLX.

Lazarus:

That's kinda my my main use right now.

Carson:

Right. Well, in Alex's point is the browsers have gotten actually really good with, like, link navigation and especially once, view transitions come for, like, multi page view transitions, which is like that. I know the Chrome people are pushing on very hard. Like, once that hits, it's like, well, you know, okay. Like, the big thing with h t m x boost is, like, in my mind, first of all, it, like, cuts down on the load, makes things a little faster.

Carson:

But you also have CSS transitions, you know, between the pages, which can be super useful. And so, like, okay. If that if that advantage goes away, then maybe HX boost gets less compelling, which is fine with me. Like, I would love it if if HTMLX, like, slowly shrinks in what it has to do to, like, help the web, like, be to help the hypermedia approach of the web be, like, a viable solution for, you know, good enough solution for most applications or for, you know, many web applications, I guess.

Lazarus:

Yeah. I saw it. It seems like you've sort of been shrinking the core over the over the years or, you know, sort of not not a big push to add in every feature that people may have requested and that kind of thing, sort of the opposite maybe.

Carson:

Yep. Yep.

Lazarus:

Yeah. I I saw that post and I'm blanking on his name right now. You mentioned the guy who's working at Facebook. Not Alex but yeah the guy who was working at Facebook who was like every single line of code you put in here is it worth it? You know?

Lazarus:

Think about that before you do it, and it's just like

Carson:

Yeah. Yeah. What was that? Oh, jeez. I'm blanking.

Carson:

This is one thing that's horrible about getting old. My ability to remember names just completely evaporated. Like, to the point I don't know the names of some of the kids on my baseball team, so I'm just like Yeah. Okay. Well, that gets hard.

Carson:

A lot

Lazarus:

of them have the same names in your defense.

Carson:

They do. They do. How many how many new Steven's can there be in your life? But, yeah. You know?

Carson:

And, like, so just to, like, rip on that some more, like, for h tmx2, you mentioned in the notes, like, we didn't do much whether or maybe I mentioned it. We didn't do much with it. 2 obvious things that we were really thinking hard about adding, one one was morphing, so morph swaps. And, have you ever used morphing?

Lazarus:

Like separately from HTMX?

Carson:

Or just with h either in any capacity. Vito is morphing. Right?

Lazarus:

Yeah. I mean, like I said, like, I don't dive into the code of these. So I'm like, I use, I'm a big, live like, Laravel Livewire was kinda my first introduction to this. And they, you know, they use morph dom, and I think the guy wrote his own version of morph dom.

Carson:

Yeah. He did. For sure.

Lazarus:

Yeah. So

Carson:

so that's an obvious thing to add, you know, it's a it's a different sort of swap. And I wrote I created made that library Idiomorph, which is I think is an improvement on the art of, you know, morphing. It's an improvement over, morphedum, like, the the original which morphedum was really the original, I think. And then it just, like, nothing really changed for a long time. Like, people rewrote it to make it a little cleaner, but it was the same algorithm fundamentally.

Carson:

And so, what I did is I created an, a library called ideomorph, and that uses, ID sets to try to do better matching. It uses basically information from children to make decisions about what nodes match up with what. And, but you have to do that. You know, like, that's a that's a an o of n squared problem in general. And so ideomorph uses information, kind of intelligently from children about IDs, basically, to, to to make the morphing more consistent.

Carson:

And so that you don't because the the big thing when you're doing a morph when and all all for listeners that don't know, all a morph is is you take 1 DOM and some new HTML, and you change the DOM with as few changes as possible into the new that new DOM. So you, like, hook up new elements and, like, just make it match this stuff that's coming from the server. And it's, I believe this is similar to what, like, the virtual DOM, like, algorithm probably looks like, but I don't understand virtual DOM stuff. But, anyways, so, the big thing in the DOM is that if you you can't reparent nodes. You can't take a node and move it from one place to another place in the DOM without it, resetting that DOM node.

Carson:

And when I say reset, what I mean is, like, you lose focus, video elements stop playing like any other sophisticated element like a like a an iframe or a reload or whatever. It just nukes that node really badly. And so that's why the these morphing algorithms came along in order to, like, minimize okay. Like, let's try and minimize how much we actually really change the DOM so that things like focus and videos and, like, all that stuff, like, just stays in in the so we we we mutate the existing DOM to match this new, HTML, but, those those elements that don't have to move, don't get moved around. The problem with that again is it's like the general algorithm is o of n squared, and so it's very slow.

Carson:

And so morphed, took sort of an o of n approach to it. I think it's, I don't know. It might be a little bit, I haven't done a formal analysis of it, but

Lazarus:

you are using that stuff though.

Carson:

Yeah. I am. I'm sorry.

Lazarus:

In the end, it does end up you does end up working. But it's linear. It's it's linear with the size

Carson:

of the DOM, let's say. Yeah. And so and so, or close to linear, with the size of the DOM. And, the, so, but the problem with that is that it it doesn't look down. So if you have, an important child that, one match could preserve it and another match couldn't, like, it doesn't know about the children.

Carson:

And so that's what ideomorph does, is it sort of populates the IDs up the chain so that they can know, like, okay. Like, you've got these IDs below you. I've got these IDs below you. Is there an intersection between those 2 sets? If yes, then we're probably a good match.

Carson:

That's basically the core of the algorithm. And, so that improves the the morphing. So so anyways, all that's to say, like, I had this thing. It's I think it's a good idea. It morphs a pretty good idea.

Carson:

And I was like, oh, we'll add this to, you know, HDMX, and this will be, like, the killer differentiator between HDMX and these other libraries because it uses Idiomort. Right. But then ideomorph, it would probably, like, increase the code base size by 50%, and a lot of people probably don't care about morphing. And I was just like, oh, god. As much as I wanna do it, I just I can't bring myself to, you know, making the code that much bigger and then it's sitting there.

Carson:

And I and I say that as someone who's not, like, a Nazi about, like, code size because typically it's downloaded once and it's cached forever, you know, from a CDN or from whatever. So it's, like, it's not that big of a deal, but it just felt like, man, I just can't have this, like, big chunk of code that's, like, really would have dominated the HDMX code base, like, living in there when there's a plug in, you know, when there's a plug in system that works perfectly fine. And if someone wants to use ideomorph, like, they can just use the ideomorph plug in, and then it all works. So I don't know. I don't know if that's, like, it was a good idea or a bad idea, but that's that's the Well,

Lazarus:

way. Wait. So so you're not using ideomorph at all, or are you using it as a plug in?

Carson:

It's it's usable as a plug in with HDMI, but it's not

Lazarus:

Are you using it as part of the core?

Carson:

I'm not using it in the core. It's not part of the core. So that's and that but I went back and forth on that for 2 point o. Because, like, you feel like 2 point o, it's gotta have a big feature. And I was like, okay.

Carson:

It'll be ideomorph. And then the other thing I was like, it'll be head merging. Like, we'll start pulling in the head and doing basically, like, merge like merging and head changes.

Lazarus:

Oh, yeah. Yeah. Which I've seen people talk about it. They use, you know, they use an extension now to hit an

Carson:

extension for that. And I was like, okay. We'll make that. That'll be the big feature. And then I was like, no.

Carson:

That's that's out too, because it just got too big and ugly, and I'm like, this is too much code for stuff a lot of people just don't care about with HTMLX. It wasn't even like a size argument so much as like, the extension way is fine, and, like, most people don't care about this, and it ends up dominating the code base. Like, it just doesn't look right in the code base. Like, it was literally an aesthetic decision on my part. Well Like, it just doesn't look right here.

Lazarus:

Yeah. So okay. So I I might I might diverge from you on that a little bit because I feel like actually it depends. Is there something with Idiomorf that is legitimately you just can't do with, you know, using whatever other morph plugins. Like that'll be the differentiator for me because the size, I mean really I think what you're saying about you download it once and we're talking like 33 kilobytes versus like 42 kilobytes, like it's like, I don't know what the actual sizes are, but I mean, to me those are minimal.

Lazarus:

If there's some killer feature you can do with Ideomorph that you just can't do otherwise, that's Yeah. Easy win.

Carson:

Yeah. But if the if the plug in's available, like, do you care if it's in the core or not? Like, if you need it, you can reach for it. There's complexity there though. Like, you have to know about that plugin.

Carson:

Right? Like

Lazarus:

I see. I'm not I don't use I'm I look for plugins if I'm forced to. My preference is usually, you know, to to find it in the core. But obviously I know there's a problem with that. You don't want it to get too big and stuff like that, and I get that.

Lazarus:

But, you know, it depends. If there was some some, like, just kind of, like, pretty common bait like, use case, like, I would definitely lean towards doing the

Carson:

Maybe what I should do is, like, build a, like, a kitchen sink HTMLX. It's got, like I love it. Core, like, core, like, 5 plugins that we recommend just all bundled up into one thing. I wonder if that would be useful. Maybe I'll I'll look in it.

Carson:

That would be a good like, I can have just create, like, a separate project that depends on h tmx and, yeah, the other, things, and then just release that as, like, okay. If you want all this stuff, like, here's here's your here's the version that does that for you.

Lazarus:

Yeah. And it's, like, still a CDN, just one of the options for the CDN on a page. Yeah? Yep. I mean, I would probably go for that.

Lazarus:

Like for I mean, I might maybe it depends on the project.

Carson:

Maybe you should do that. Yeah. I mean, Woah. Woah. Woah.

Carson:

Hey. Hey. Hey. Maybe you should do that.

Lazarus:

The classic open source maintainer line.

Carson:

That's right.

Lazarus:

Oh, I don't know. That's a great idea. Oh, I love that idea. How why don't you get started on it?

Carson:

Yep. Exactly. No. I love it. I love it.

Carson:

Now we've got a project for you to take on it. Perfect.

Lazarus:

Oh, man. Yeah. I don't think I actually have anything open source out in the world just because

Carson:

Yeah well now you do, hdmi's kitchen sink. Go baby. Yeah. I have

Lazarus:

to find some, some killer feature I can do with that that nobody else can and then it's just like Yeah.

Carson:

No. I mean, just I think just getting like the core, like, the there's another one that's, another plugin that's, you can use attributes to say, like, when you get a 400, put it here. Like, right? So you don't have to you don't have to script. You can just sort of specify how you wanna handle things.

Carson:

And, that's from a a core guy on the team too. He's advocated moving that into core, and I'm pretty close to, like, breaking on it, but just because he's such a good programmer. But, that's another thing that I think, like, if you made a kitchen sink version of HD max, it would definitely go in there.

Lazarus:

Yeah. I actually, I will say with the errors, I've had a hard time, you know, if something just doesn't work on the server set, you know, I'm like and you sort of get nothing back by default. You get like an HTML error and I have had a hard time with that. So if I if there is an extension that adds that, like, there probably is. There's probably some sort of error extension that I haven't found yet or something.

Lazarus:

But

Carson:

Yep.

Lazarus:

Yeah. I don't know. Kitchen kitchen sink, kitchen sink. I could try that. See what it's all see how badly it is.

Carson:

That was a great idea that you have. Yeah. That you're going to implement.

Lazarus:

So I just checked my email because that guy's name with that quote about, you know, keeping the he worked at react was mikinde

Carson:

yeah mikinde.

Lazarus:

Yeah, mikinde.

Carson:

What was the name of the project again?

Lazarus:

So he had worked on let me see. So I sent him an email with Primer.

Carson:

Primer. Primer. Yeah. I this.

Lazarus:

Yeah. I had asked him about that on an email and he actually responded. He wrote back and I was hoping to get him on the show but, you know, he said he just wasn't gonna be able to he's doing stuff that's unrelated and he, like, didn't but he did say that primer let me just say here. He said, you know, there's a lot going on at Facebook, basically. Like there's, you know, it's, it's complicated.

Lazarus:

And he said, I think React grew from the needs of the ads team and some others for really complicated needs for UIs that are used by advertisers and other specific audiences.

Carson:

Sure.

Lazarus:

So, you know, because I think it sounds like there really was kind of like, you know, a discussion on how to sort of go forward in primer, like for, I don't know, for I just, people who didn't follow that thread, but primer is like a version of of kind of hypermedia first that they experimented with at Facebook in 2012 or something. Is that how you understand?

Carson:

Even earlier. I think 20 like, 2008. Yeah.

Lazarus:

Oh, wow. Okay.

Carson:

I think even earlier. And so and the thing I've never bought like, the story around React was, like, they needed to add a comment to a comment box. Like, that's, like, the story I've heard anyways. It's like it was it was like, oh, they wanted to have, like, nested comments, and so they had to build React. And I'm like, no.

Carson:

They did not absolutely have to build React. Like, that's a perfect use case for hypermedia. Like, I don't buy that at all. So I it's much more plausible to me that it was something like a complicated ads UI where they had to maybe do drag and drop or something like that back in the day because this the the the adding a comment to a thread on the main Facebook website just never made any sense to me whatsoever. Yeah.

Carson:

But yeah, I mean that's

Lazarus:

a totally different just the the divergence in like philosophy of like his stuff and, you know, just that that type of quote of, like, you know, watch out for every single line you add versus, like, the 6 megabyte, JavaScript applets that everybody installs to go to cnn.com. It's like

Carson:

I know. I know. Well and, you know, you can go watch the talk. It's still on YouTube. It's if you look up Primer and, Makinde, you'll find it.

Carson:

And it's a banging talk. It's like, great, you know. It's like, he he was a little bit more focused on using the existing, like, infrastructure syntactically of HTML, like using the of rel attribute and so forth and which is good in some ways. Maybe, like, HTML should have done that. I don't know.

Carson:

But, it's just like, holy smokes. Like, talk about someone that, like, I totally agreed with. And if I had been at Facebook, which I never would have been, they never would have hired me. I actually I interviewed at Google. I actually interned at Google.

Carson:

And

Lazarus:

Oh, really?

Carson:

I, my I had a I had a boss and that boss could not take a joke. And so I was like, the wrong I was the wrong I was the wrong dude for that group because Yeah. As my Twitter indicates, I tend to be pretty unserious about stuff. And, he like, I I'm I'm afraid I got blackballed from Google for that for that internship, but, a lot of smart and good people there. But Facebook, similarly, I just would have been like, I don't know, guys.

Carson:

Like, I feel like I don't fit in here. It's all good. I ended up in a good company, so Guidewire was really a good thing for me.

Lazarus:

Yeah. Yeah. To give you a little more leeway in, how you conduct your personal and business affairs.

Carson:

Oh I think they were more desperate. They didn't need any warm bodies that understood Java so they were like okay we'll take him whatever.

Lazarus:

There's no better pathway for giving leeway than a desperate, desperate company. Yep. I like it.

Carson:

They were building insurance software, so it took a lot to it wasn't people weren't exactly, like, jumping out of graduate school in the insurance software business.

Lazarus:

Bring your own excitement to this job.

Carson:

Yep. Which we did. We made our programming language. It was awesome. It was a ton of fun.

Carson:

It was a great company.

Lazarus:

Yeah. I'm a big fan of not doing things for developers. Like finding industries outside of people who do development because this is just so much better. So much better.

Carson:

Thousand percent. You can go like that's I tell my students, like, you could go to a bank or like a a farm manufacturing company and be an absolute legend. Exactly.

Lazarus:

Or it could just be like some loser who, yeah,

Carson:

You can go to Amazon and, like, fight with, like, some of the smartest people in the world over, like, just, you know, l whatever, you know, like, conversations and then get, like, you know, backstabbed by some thing that's going on at a level, like, you don't even comprehend. You're just like a bug that gets stepped on and you don't understand what hap like, you know, like or just go work for, you know, John Deere or Cat or something like that. And you'll be, you know, you can be a beast there. Costco? Costco is another company.

Carson:

Like, I had a student that was like, he was out struggling to find a job, and he's like, what do I what do I do? And I'm like, well, do you have any, like, parents or friends? He's like, yeah. My aunt like, I I think it was uncle or something like that was, like, at Costco. I'm like, dude, that's there you go.

Carson:

Like, you're okay. Are you gonna be working on, like, maybe mainframe tier technology? Maybe. But, like, it's all the same stuff, man. It's 4 loops and if statements and, like, whatever.

Carson:

Yeah. Go there. You've got the contacts and, like, you're gonna be an absolute, you know, legend at that company if you can, you know, figure it out.

Lazarus:

No. It's so true. Yeah. I'm I'm in the legislative world a lot, like state legislation. And it's just like Yeah.

Lazarus:

There's not that many people in this world who know programming and who are on top of the the latest tech and stuff like that. It's like Yeah. I don't know. It gives me a pretty big advantage and

Carson:

Jack, don't tell anybody.

Lazarus:

I know. Yeah. I'm editing this part out right now.

Carson:

That's my next yeah yeah teach a man to what is it if you if you give a man a fish he eats for a day if you teach a man to fish now you have competition So don't do that.

Lazarus:

Yeah. Okay, so let me see, you know, we can choose anything here, but let's what do you think about optimistic UI? So, like, there was a big discussion about optimistic UIs. That was a big part of, I think, at Big Sky, it came up a few times and it was sort of in the in the like Twitter sphere for a while and I was thinking like you know, I mean if you were to take the premise that Optimistic UIs are like I guess first of all like are optimistic UIs compatible with HTMX in your opinion?

Carson:

Yeah. I think so. I think you could. I I think, like, I wanna do an extension for optimistic UIs just to see, like, what it would look like. I think, because what is that so first of all, what's optimistic UI?

Carson:

Like, you accept user input, and then you say you show them the updated state on the client before it is synced to the back end data store. And why do you do that? Because perceived performance is better. So what are the advantages of that? Perceived performance is much better.

Carson:

Like, people feel like things are happening much, it's much snappier. What are the downsides to it? Well, you're telling the user this is updated before it really has updated. And, you know, like, if they, you know depending on how it's implemented, like, they could be convinced, for example, that they purchased a a plane ticket. That's the example I always give.

Carson:

Like, okay. I purchased that plane ticket, and then for whatever reason that request ends up failing, like, how do you notify the user of that? And so, some obvious ways to do that with HMX would be like, okay, you specify either a template tag, maybe with some dynamic behavior or maybe a JavaScript function or something like that to be like, okay. Given the request, generate some UI that will insert into the DOM immediately as, like, congratulations, you've saved that, and then wait for the request to come back. And if that request HTML is different in any material way, then swap that in and maybe fire an event to notify people or something like that.

Carson:

That's the way I thought about it. And, you know, good for some things, probably not worth it for for other things. I think a lot of people, like, this is, like, way more complexity than is necessary for them to build reasonable UIs. But, you know, I don't know. I've got, like, my own take on what's acceptable and unacceptable web UI, that might not gel with, you know, not might not gel with everyone.

Carson:

So, so I don't know. I I I feel like you could do you could definitely do a plug in in HTMLX. The next level down, which I've seen some people talk about, is to actually work against a local data store, like a SQLite database that's replicated to a back end. And so people are doing that, like, in, you know, in memory type stuff. And, I think that eliminates some complexity in your UI.

Carson:

Yep. But then it it adds complexity because where the synchronization is happening is so low. It gets harder to say like, when something goes wrong, like, how do you what do you notify the user? How do you notify the user of that in a coherent manner? And so, I don't know too much about that approach, but I know some people are pursuing it.

Carson:

And I think for some app, you know, just like everything else, there's gonna be some apps that that is a killer feature for. Most of the apps that I work on, I don't think it's worth it. Even, the the more limited version, than an HTMX plugin might give you, I I would probably do that as, like, an intellectual exercise, but I doubt I would use it very frequently because I just don't care. Like, if it did like, to me, like, once you show a spinner, like, unless you're dealing with, like, really chaotic network environments and, like, you're designing for that, like, once you show a spinner, like, I don't know. Is it worse for a user to think it's been saved and it hasn't?

Carson:

Or for them to be like, man, this is slow? Like, I don't think there's a huge difference from, like, as far as, like, things being screwed up goes in between those two states. But, you know, people disagree with me, and I I'm not gonna fight with them about it. So

Lazarus:

Yeah. And I think I think that the approach you were talking about with the SQLite database and the local data, I feel like maybe that was what was happening in like Warren's talk at Big Sky, Warren Buffering, yeah he was building a mobile app and it seemed like these part of the idea was that you are just using the local but then you're using some sort of advanced sync and to me that Definitely, you know, some things, especially his example, you're out in the wilderness, you want it to work locally first,

Carson:

you know. Yeah.

Lazarus:

Most of the stuff I build, it would be an an absolute nightmare to try

Carson:

to

Lazarus:

do a, you know, a local version and then sync everything. Like, syncing is more is harder than just, you know, having your single server.

Carson:

Well, you know, and I also think about, like, how do you visually represent it. Right? Like, okay, you're offline. Like, what changes haven't synced? Like, do you have a UI for that?

Carson:

Is that something that's easy to get out of the data store? If it's a generic SQL data store, probably not. Like, you have to keep track of all I think. I don't know. Maybe their data store is designed for that, and then, okay, that's cool.

Carson:

Like, that's and but it it does seem like a fair amount of complexity to me. But there are definitely you know, the phishing app is what Warren was demonstrating. I think it makes a lot of sense. If you're designing an app to be useful offline and online, totally. But even with those, you know, you do have to like, what is your how do you how do you do conflict resolution when there is Yeah.

Carson:

Is there conflict? Is there conflict? Like, can conflicts occur? Like, do you design it so that there can't be conflicts? If there are conflicts, like, what's the UI?

Carson:

Because, you know, visual conflict resolution is a pretty advanced thing to have to build. And so I don't think you wanna build that for, like, a stupid cred app that's just not it's gonna be used, like, by people that are sitting at desks all day. Like, that doesn't strike me as, like, a a good trade off. But then, you know, for for other apps, it's the right thing. So just it depends as always.

Lazarus:

No. I thought there was a funny moment and, you know you know Aaron Francis? He's he's kind of on Yeah. Twitter. He's in the I'm in the you know, I just do a lot of stuff with Laravel.

Lazarus:

So he's been big in the Laravel world, but but he he just made an a quick aside and I was, like, curious his take on optimistic UI, you know, and he was like he was like, yeah. I was talking to my friend in the JavaScript's world about optimistic, you know, and he was kinda like giving Aaron something like, oh, but how do you do this? And Aaron was like, I just told him, you know, like, I don't care about optimistic UIs. And that was it. That was the end of it.

Lazarus:

That was it. It's just like, it doesn't matter for any of the apps I work on. It doesn't make any difference to anybody. You know, it was just like and it wasn't he wasn't saying it in a negative way. It was just like, no.

Lazarus:

Yeah. It doesn't matter. Let's just kinda move on.

Carson:

Nobody cares. And then that's you know, it's easy to be flipping about it, but it's also like I feel like, you know, there's something to it, but also like people, I think, in my opinion, tend to overemphasize this. Like, how dare you take more than a sec? Like, they just clicked update, man. Like, I'm fine when it takes a second to update.

Carson:

Like, it's doing something. Like, in fact, I'm a little ups like, I get a little weirded out when I do an update, and it doesn't take a little bit of time. Because I'm like, did it really save?

Lazarus:

Yeah. Exactly. You

Carson:

you like you get this with, like, sometimes, like, the settings UIs now, like, there's no save button. Like, you just change it and you're like, okay, are we done? Right.

Lazarus:

Do I need to quit and restart?

Carson:

Do I need like, what do I am I are we good? And to me, like, having a save button that, like, changed color even if it took 200 milliseconds or whatever, would be like, okay. Cool. We're done here. So I don't you know, it's not again, it's not to say there aren't subjective advantages to the albinism concurrency stuff, but there's also, for me anyways, like, maybe I'm just an old guy, but I don't mind waiting when things update.

Carson:

Yeah. When you're trying to read and click around, like, it's really nice when it's fast. That's a different problem because that's that can be solved with prefetch, which there's a plug in for prefetching and HTMLX as well. So, you know, but, for updates, I don't know, optimistic updates.

Lazarus:

Yeah. I don't

Carson:

wanna say oversold, but not something I'm, like, super bummed. HTMX doesn't have an out of the box solution for.

Lazarus:

But I would you know,

Carson:

I do think I do think a plug in for it would be interesting just to see what you can do. See how Yeah.

Lazarus:

Yeah. So so the the biggest argument I found because, like, I literally have been working, you know, been doing programming for 20 years and I've never felt like the need, like the absolute like, oh, this isn't gonna work unless I have optimum, you know, this never happened. So it's like, from my perspective I don't really care that much. The big push that I would think is I have seen these sort of arguments online that go basically like, can, you know, let's say we use a server side rendering, like people are making this big decision, are we doing client side rendering, are we doing server side? And just like they have to make this decision before they have all the information, it's hard to just like test 2 things, so they're making this decision and the argument that I've seen is a client side sort of proponent will say, you know, if you use server side rendering you're giving up on blank, like you no longer have optimistic UIs as a possibility, you can, and there's other things that I think they think you give up with server side rendering, like transitions and CSS, like that you actually don't because of h you know, HTMLX and and the browser does a nice job, CSO.

Lazarus:

But that part where it's like, they'll their response is basically like, why would you ever use something if there's a limit to it, to what you can do with it? So then we'll just use the client side because there's no limit. So that would be my biggest argument for having some optimism solution, I just don't see it as a real need.

Carson:

Yeah. I think but there's always the, you know, the you aren't gonna need it argument, which is like, that's a has a fairly strong pedigree in computer science. Like, don't architect for stuff you don't know you're gonna need. And then also Yeah. You know, there's the islands of interactivity pattern, which, like, I didn't even come up with.

Carson:

That's just like the the SPA world started talking about that. We're like, okay. Like, we're just gonna have a normal MPA, and then we'll have islands of interactivity in it. It's like, okay. You're not commit like, if you use HTMX, like, the one of the good things about HTMX is that And, similarly, like, if you've got a page and there's a part that it makes sense to use a reactive thing with, like, optimistic concurrency, then just use it for that.

Carson:

Like, hopefully, the reactive solution that you're using is, like, lightweight enough that it doesn't require you to rework the entire you know, like, okay. Like, you know, there's just forms of, like, you know, like, you know, like, okay. Like, you know, there's just forms that we just wanna save. Like, you don't even need to use an x for that. Like, I don't understand why I have to bite bite off this huge, amount of of infrastructure for that.

Carson:

And, like, you got a better solution for, like, an island of interactivity, then good. That's good. You know, the the mother of all HMX demos, which was a a demo of a a Python they had a Python back end, that was contexte, out of France. And I just got an updated essay, like, kind of a review, like, looking back on it from the guy who did that, talk. And, he, he had mentioned, like, oh, there was a spot where we needed a rich text editor, so we ended up using I think he used Vue or something like that for a component, like, monitor component.

Carson:

I don't know. But he ended up using he ended up not using HTML for it. I'm like, thank you. Like, you didn't that would have been a really bad thing to implement in HTMLX. And, like, it you know, I it that's the way to do it.

Carson:

Like, okay. What's what's the problem we're trying to address here? And then use the appropriate tool for that.

Lazarus:

Well, it's like the tool itself, I feel like, HTMLX, it's kind of matches the, you know, your sort of, work with everything, work with everybody, mix you know, it's kind of this this, the ethos of it because, like, I mean, my experience, you know, I I have a bunch of different projects, and I I don't think I have had a project yet where I can't go in and just kinda throw in HTML. And that's really not the case for other libraries, you know, I think like Alpine is one that I've been able to do that with. Vue is a little easier than like going full sort of React or something, but it still takes over. You have to kind of you have to build your virtual DOM, and then more and more of the page has to move out and Vue is growing and growing and taking over more of your, so you know I think the fact that HTMX kind of can be dropped in I think it's unusual.

Carson:

Well and I credit that focus on generalizing hypermedia controls for that Like, the the idea of, like, I'm not gonna try and solve everyone's problems. I'm gonna take this existing idea and extend it. And, like, that existing idea is a pretty good one, and there are some obvious extension points to it. And so I think that that focus is, you know, because, like, oh, like, LiveWire, for example. Right?

Carson:

Like, now the back end has to know about the front end. And if you wanna do it with, like, a different back end, now you've got it. Whereas, like, the h t m x approach is pretty stupid. And, you know, I know LiveWire guys come in and they're like, dude, this is retard like, I don't wanna use the r word, but this is not smart. Let's let's say this is not very smart.

Carson:

This is not very sophisticated to use, your, the what's the name the Snoke guys. And, it's not a sophisticated HTML is not sophisticated in, like, conceptually. I think the implementation has some, you know, somewhat sophisticated stuff going on at times, but the the the core ideas themselves are not sophisticated. And that that makes it so that it's just this DOM tool that sits there and issue HTTP requests and put the stuff in the DOM and that's it. And it's like, yeah, man.

Carson:

That's pretty dumb. Yeah. But you can actually get a fair amount done with it. You can do some interesting stuff with it, and that makes it play well with other stuff. And making the, you know, events like, being really event friendly, I think, is an important another important aspect of the library because, that really lets it integrate with other you know, an event bus is, like, the only way I know of to really have, like, sort of a hierarchy of things that are interacting with each other without knowing about stuff in advance.

Carson:

So, so I think yeah. Yeah. I'm glad to hear that because I I do I that's definitely something I it was a goal with HTML. It's like, let's just play well with everything.

Lazarus:

Yeah. The only things I've had trouble with are, like, other third party JavaScript things just because they always have to be reinitialized every time you do, like, a partial page update. It's like you gotta just remember to do that, and that's kind of a gotcha for me even, like, having done it a bunch of times where I'm, like, alright. How do I initial you know, I'm using select 2 or something, and I'm like, okay.

Carson:

I need

Lazarus:

to remember now that I'm using that.

Carson:

That can be a little tricky with history too. Like, you have to de initialize it before the history snapshot. Like, there's stuff like that that's I just

Lazarus:

don't I don't I don't let them use the back button. You know?

Carson:

Just so much trouble.

Lazarus:

Yeah. Like, I just It's like

Carson:

I always I always say that, like, one of the miracles of the web is that users stopped expecting undo. Like, we we we don't even have like, we don't have to implement undo anymore. Are you kidding me? Do you know how much undo sucks? Like, you've got this, like, two way linked list of, like, mutations.

Carson:

Yeah. It's like awful. Like, holy smokes. Thank goodness. Web programming has led us to not have to deal with that.

Carson:

And now we've, like, gotten to the point where we're, like, we're not even gonna give you the back button anymore. Like Yeah. That was, like, that was, like, 11,000th of what undo was, and we're just, like, we're, yeah,

Lazarus:

I do see you put a lot of work into the back button, though. Like, the history. Like, I mean, I haven't It's hard. It's hard. I think for

Carson:

For the exactly the reasons you outlined, like, Dom state, like, when you snapshot, like, you know, what does back mean when you update a partial bit of the UI? Like, you can put if you wanna have some fun, go set up, like, an iframe based, which is, like, website with, like, a couple of iframes that you can, like, have links because you can links can target iframes. That's there's a target attribute on links and you can target it. And, like, click around on the links and then, like, hit the back button and see what the browser does. And it's, like, it's pretty funny.

Carson:

It's, like, I'm not the only one who is and you are not the only one who has struggled. What does back mean here?

Lazarus:

Yeah. Yeah. And, like, honestly, most of the time it just doesn't matter so much. I appreciate that there are some tools to kinda, like, you know, but like if I'm working with partials I'm usually not, I'm just like when they refresh the page you know they'll start over, it's okay. Right.

Lazarus:

Again, if they haven't loaded all the little things that they've loaded in the meantime.

Carson:

But why do you refresh? Yeah. Yeah.

Lazarus:

Alright, so I know we're over an hour so I want to respect your time. Can I ask you one more question?

Carson:

Yep.

Lazarus:

Okay, so this is just like a general question about memes and logistics. Like, so, you know, it's like like many people I have imagined a world where I'm like, okay, I can put this into a funny meme. And I go and I'm like, okay, you know, here maybe I have an idea of like which of the different topics of memes I have. So I do like a Google search for like okay like midwit meme blank or something like that and then I like find a crappy version of that and screenshot it because I can't download it. And then I'm like by this time I've already spent like 5 minutes and I'm like, okay, now I need to go and figure out.

Lazarus:

So anyway, this is my horrible process for this. So I imagine that over the years, you have a built your own process. So do you have like a folder with a bunch of PNG memes? It is

Carson:

exactly it is exactly the process that you have outlined.

Lazarus:

So you still do the terrible thing that I was hoping you'd have a solution for?

Carson:

Yeah. No. I I I just like, oh, this meme would be funny. I probably have a bigger backlog in my head because my for whatever reason, like, my head is, like, it is an art that I am very passionate about. And so my I'm able to remember and, you know, make association stuff, like, you know, in school and so forth.

Carson:

And so I think that helps quite a bit. Like, oh, I see the relationship and then and so I've gotten very good at finding, like, memes, especially old dead memes. I use Imager a lot, man. Imager is pretty good. Imager.

Carson:

Okay. Yeah. Imager. Is it Imager? I think that's what it is.

Carson:

Like, if I

Lazarus:

the whatever

Carson:

the main yeah. Whatever the main meme generator if I find it on there, I'm like, oh, sweet. I don't have to, like, copy and paste it into I use Photopea, which is an online editor. If you ever heard of Photopea, it's like a it's like a, you know, 1995 version of Photoshop, but online is a JavaScript web app.

Lazarus:

Okay. For JavaScript purposes. Pixlr. It's like a Yeah.

Carson:

I use Pixelmater on the Mac. Are you on a Mac or

Lazarus:

Mac. Yeah.

Carson:

Yeah. There's so photo p for just because it's there and quick and I, like, have the muscle memory, like, I'll often open that up and do it there. Although the fonts are not very memey, but they have good, like, when you need to select and mask out stuff. They've got all the the, like, all the, like, 1995 Photoshop tools, which is, like, the level that I'm at.

Lazarus:

Yeah. That's I'm right there with you. Right there with you.

Carson:

Right. And so, so I use that, when I when I really need to, like, edit stuff up a little bit. Oh, that's what I'll use. But, it's there's no no. You're doing it correctly.

Carson:

Damn it.

Lazarus:

I can't believe I'm already doing it the right way. That's terrible news. Joe Carlasare (3one forty six)

Carson:

You're already doing it. As far as I can tell, you're already doing it the right way. So I'm sorry. It's better to report. Yeah.

Carson:

I feel

Lazarus:

like this I haven't gotten my only hope forever being able to kinda get that good at that is that I do have a Simpsons reference and, you know, building associations. If you're talking classic Simpsons, I can take any moment and find the Simpsons moment. So that I feel like is my background for, like, there's some hope that if I learned other stuff besides Simpsons, I might be able to make those links. I'm

Carson:

gonna be honest with you. Like, a lot of the memes, like, some of the newer ones, like, I don't even understand them. Like, I'm like, you know, like, oh, what's the Rick and Morty stuff? I'm just like, dude, I don't know. I've I've never watched an episode of Rick.

Lazarus:

It's too it's too nihilistic, a lot of that stuff for me. So I'm like

Carson:

Just I don't have time. I got I've got a job, and I got a, you know, I've got h t m x and a book and baseball. Like, I don't have time to watch this stuff. And so but, you know, you can still see, like, you know, you see a couple of memes of it, and you're like, okay. I could take that and, like, modify it for for my needs.

Carson:

And so so that's the level that I'm at. I don't know. I just but it's the same exact process. There's no there is no silver bullet. You just have to put in the time with memes.

Lazarus:

Yep. Cool news.

Carson:

Yep, sorry.

Lazarus:

Alright, well any anything else? So you just released the book, I don't want to leave without promoting something besides, like, the

Carson:

whole this

Lazarus:

whole podcast is a promotion of you and your work. Beside besides that though. I wanna make sure.

Carson:

I'm sorry. Yeah. We just released the well, it's the same book as the Hypermedia Systems book, but it's in paperback or soft soft copy or whatever. But it's a it's a new cover. So the new cover is, like, kind of a pixel art, like

Lazarus:

So good. I I saw it. Yeah.

Carson:

Yeah. I'm I'm really excited with it. And we paid an actual artist. Like, we actually gave an artist money to make the thing and all that. So I'm feeling I feel really good about it.

Carson:

I know some people express disappointment that we didn't use the the one that US graphics made, which is an unbelievable, like, in my mind, like, that was an unbelievable cover, but I just wanted to do something different so that the paperback had its own feel and, you know, get some get some you know, we've we've built up a lot of lore, you know. I guess lore is the term in the HTML community in the last year, and so I wanted something that kinda reflected that a little bit. And so I'm super happy with it.

Lazarus:

No. I thought I I thought it was really, I thought it was really good. Fit the ethos. You had a little bit of the pixel art at Big Sky DevCon, and I appreciated that. And my kid just mentioned to me, and she's like, pixel art's my favorite.

Lazarus:

This is unrelated to HTMX. She just she

Carson:

plays a lot of

Lazarus:

games, and she likes the pixel art and the games.

Carson:

Yeah. Someone someone, someone had a quote the other day. And this is the thing about, like, Twitter. It's so ridiculous. And then every once in a while, something just, like, punches you in the face.

Carson:

And it was like people the the I'll paraphrase it, but it was the claim was that people like pixel art because it it it it stops the infinite recursion of, like, reality. Like, there's, like, a there's a final end to any unit. And so, like, okay, like, it it it it takes away that, like, infinite recursion that you're dealing with in life. Like, everybody, like, okay, what's going on over here? Oh, my gosh.

Carson:

Okay. What are the 10 things? Okay. Now each one of those it's just like, okay. This is a piece of art and I look at it and, like, if I look at any one thing, like, it stops.

Carson:

I was like, man, that is that's a pretty interesting idea to think about. So Yeah. I love it. I love isomorphic pixel art is my favorite.

Lazarus:

Yeah. It's such a cool aesthetic. I actually have had like pretty fun experiences using chat GPT to generate pixel art. Just like literally just for fun. Not for anything else, but I'm just like imagine this world but in, like, isomorphic pixel art and it's, like, actually that's really cool.

Lazarus:

Yeah.

Carson:

It's just such a neat, like, I don't know. I just I love isomorphic. Like, the icons, when I'm in charge of everything, like, computers, we're just go we're going back to isomorphic icons that are, like, pixel art derived. Yep. Because Yeah.

Carson:

It's just such a cool look, and it's such a bummer that everything's so polished and flat now.

Lazarus:

Yeah. Man, I saw something the other day and I don't even know if this is a real product or if it was just something fed to me because of, you know, my but it was a little glass cube. And I would say it was about, you know, that big. And you hold it up to stuff and it like morphs the light, have you seen this? It makes it so that whatever you hold it up to is pixel art in real life.

Lazarus:

So it's like the cube is like, and I was like, is this real? Like does this actually work?

Carson:

Chad, Chad is this real?

Lazarus:

Yeah. Yeah. But, I mean, it was like a looked like a real physical, like, little piece of glass cube, and it just makes everything pixel art.

Carson:

So that'd be cool. I mean, I just kinda love that. I don't know. It's all good. Maybe I'm just old, nostalgic.

Carson:

You need to be a nostalgia maxing. You're really, like, oh, that's just nostalgia. Like, I don't know, man. Nostalgia. If you're gonna be nihilistic, nostalgia is is, like, reasonable value as anything else.

Carson:

So

Lazarus:

Yeah. I mean, we've all seen the older generations, and they they had some fun with nostalgia. They're still watching the movies and

Carson:

Dude, I still like old man, this is gonna degenerate into a long conversation. I don't think there's like nostalgia saying something nostalgic isn't the own that a lot of people think it is in my opinion.

Lazarus:

Yeah. Enjoy the things that just because you happen to, you know, find them when you were 13 doesn't make them bad.

Carson:

Yeah. And there's a craving for, like, permanence and, like, you know, like, I think it hurts when I okay. It was like the last sort of philosophical point. Like, it hurts the the especially in computer well, maybe not especially in computer programming, but certainly in, like, architecture, like, a lot of things like that. This, like, allergy to the past, it's just like, guys, like, stop.

Carson:

It's okay. You don't have to reinvent everything every generation. Like, and even HTML is like this. Like, it's like, I'm not reinventing the web. I'm just taking what was there and what was a good idea and adding a little bit to it, and that's okay.

Carson:

Like, it's okay to have that approach to life. Like, okay. You know? So I don't know. Yeah.

Carson:

But, maybe pixel art is not not the best not the best, like, road into this conversation, but, but I do I I man, isometric pitch pixel art, when I'm in charge, there's gonna be an awful lot of it. So Yeah.

Lazarus:

I like it. Alright. Well, yeah, I mean, if there's anything else you wanna, promote or whatever else. But yeah.

Carson:

You can I just I really I appreciate you doing a whole podcast about h HTMX? It was useful. And I'll you know, I'm happy to come, you know, come on regularly if you like. I don't know. We're we're gonna run out the problem with HDX is there's not a lot to it.

Carson:

So

Lazarus:

No. See. Yeah. I don't know. I'm, Yeah.

Lazarus:

I've been having fun with the podcast, and I haven't even started on the extensions. So Okay.

Carson:

Yeah. Here you go.

Lazarus:

I got a ways to go with the podcast. We're not going we're not going anywhere.

Carson:

So Well, then you could start looking at Hyperscript and then you've got Hyperscripts. Yep. The number of bad decisions that were made HyperView? HyperView.

Lazarus:

I'm gonna start going mobile soon. So

Carson:

Yeah. Ideomore, if you can look at that. Like, there's there's definitely plenty of content, but, but, yeah, I I again, I really appreciate you, taking it, you know, and running with it. So thank you.

Lazarus:

No. I really appreciate you for coming on. Thank you very much. Cool.

Carson:

Awesome, man. Alright.

Karson's Korner - A conversation on practice before theory, hx-swap-oob, and optimistic uis with htmx creator Carson Gross
Broadcast by