← Back to Show Notes

Transcript: Event Sourcing - Chris May

Will Vincent

This episode is sponsored by Hacksoft, your Django development partner Beyond Code.

More on their services later in the show.

Hi, welcome to another episode of Django Chat.

I'm Will Vincent, joined by Carlton Gibson.

Hello, Carlton.

Hello, Will.

Will Vincent

And we're very pleased to have Chris Maid join us today.

Um Chris, welcome to the show.

Chris May

Hello, Will.

Hello, G Carlton.

Great too, Chris.

Thanks for coming on.

Will Vincent

So we've known you for quite a while now through conferences and stuff, and so much delayed having you on.

But maybe you could tell us what what are you up to these days?

And then we'll dive into your you know your previous talks and backstory.

But how how are you using Django today?

Chris May

Um mostly for my website, honestly.

Uh I've we built that.

I'm trying to remember how long ago.

It's been definitely over a decade since I've put it on top of Django, and uh and now I'll use Wagtail to to power it.

And uh uh sadly that's the primary way I'm using Django right now, except for all my little experiments uh at work.

Uh more mostly Fast API or uh Starlet.

Um with you know I keep saying, but Django, Django's a really good option.

So I guess I guess you could say I'm a polyglot for Python web frameworks.

Will Vincent

On your personal site, uh so you can make that however you want, right?

Like are you on 5.2 or planning to?

I mean, that just came out a couple days ago as we record.

So right.

Chris May

I uh it's this is the shame part.

I do not know exactly what version I have.

I had it open yesterday, but the numbers don't stick in my head.

But it's definitely not I don't even think I'm on the latest LTS, honestly.

Um mainly because my local setup um ever since I got my new computer, I I just haven't like spent the time to get it set up correctly.

You know, I'm kind of in some ways in maintenance mode on my my personal website.

Um but uh you know, just trying to clear up some time to upgrade everything.

Will Vincent

Yeah, well that's how you know you're a professional, right?

Like you don't have you don't have time to fully perfect everything, so yeah.

Chris May

The web developer's website is never up to date.

Will Vincent

No.

It doesn't have to be.

Chris May

Yeah, as long as it's running, right?

Will Vincent

Carlton, you must have a takeover.

Carlton Gibson

Well I I'm just s sitting here smiling as Chris tells us, you know, oh no, uh my jang is not quite up to date, nor how you know it's still going, it hasn't fallen over.

Why would it fall over?

Carlton Gibson

That's the that's the great thing, right?

You can um you know you can update it when you're ready.

Yeah, absolutely.

Will Vincent

And if it's well architected, then you don't like you don't have to think about it.

I know we we talk about the latest versions and features, but the reality is a huge map of what you actually have to do, and yeah, not having to keep up with Django is a big reason why we use Django, because it's there if you want it, but it's probably not gonna break on you.

Carlton Gibson

Can I swing back quickly, Chris?

You talked about talking about your work you're doing um using Starlet first API there.

What's the what's the application if you can talk about that a little?

Chris May

Uh so I work for a company that makes software for the health industry.

Uh, and so I've been on a couple of projects.

Like the current one I'm on um is kind of a a uh essentially like an internal tool that um, you know, I it's funny, like I've I've joined this company for less than a year, so I don't understand all the organizational aspects of it or even all all the offerings they have.

Um, but you know, uh there's one tool where um it's related to people who have uh post-acute care.

So uh essentially a patient comes into the system, they have a giant document of their medical history, or at least recent medical history, and as a part of the flow, a nurse has to go review each one, or you know, yeah, a nurse has to review some of them.

They have a team of nurses.

And uh so my services, um, the the point of it is to one um to get that packet of information uh and leverage AI to ask it a bunch of questions and summarize it for the the nurses.

Uh so that yeah, they don't have to.

They can they can you know it's funny because like one of the best things about it is we're trying to figure out how reliable is this, you know, with and thankfully it's been incredibly reliable.

So that's we you know, we keep doing blind tests and stuff like that.

And so uh thankfully for at least this application, a the AI is is okay.

Carlton Gibson

So my my sort of take on this is that if you're getting them to reduce, if you put in more context than you're asking them to output, they are very reliable because they're taking they're summarizing an amount rather than try whereas if you only give them a little bit and try to get them to output a lot, that's when you're in big trouble.

Chris May

Exactly.

Will Vincent

Yeah.

I'm here in Boston and so there's several startups just in my co-working space doing similar things, you know.

So one is using AI to tap into uh Athena Health to do like the for doctors or nurses I guess, but when you do like get your blood work and stuff or things like that, right, it pass it through AI first because it will flag if something's off.

And and I guess I think I've talked to them quite a bit over the over the months, and a lot of things in medicine are somewhat routine, or and you have these uh nurses and doctors who are just completely overworked, and so something that saves them time that they still need to they can still review and sign off.

There's still a human there for a variety of reasons, but AI is great, right?

It's not like nobody's building an agent yet for healthcare, right?

Whereas coding, like somehow we're all replaceable, but you know, maybe it's maybe it has to do with the billing and the interface.

Carlton Gibson

I just realized we're a bit going wrong as well, because of course we just said that uh, you know, if you give them a big context and ask for a small one out, you'd you can do quite well.

Whereas the other way around.

Whereas I'm like, can you, you know, can you write my UI for me?

And they give me this UI.

It's like, hang on, the UI was more than I gave it.

So I perhaps I need to up my prompting.

Will Vincent

But I mean, uh but but uh you know, but coding is such a broad, yeah, it's sort of kind of infinite, right?

If you said, hey, build a Django front end, there's I mean, what are you doing?

Are you using HTMX or using React?

Are you, you know, blah, blah, blah, blah, blah, right?

Whereas in the context, I would imagine in a in a medical one, it's much more specific.

But actually, I have a question on that.

So are you using uh or are they using um not off the shelf, but you know, like chat GPT kind of stuff, or are they using because there's now a lot of these more targeted domain-specific LLMs?

Chris May

We're using uh we're on the GCP platform, and I think we're using vertex AI to do the um rag um questions and stuff like that, the processing.

Will Vincent

Okay.

Do you get to play around with with that whole part at all, or you're more more on the website?

Chris May

I'm on more on the website.

I I yeah uh I have a very small team, there's three of us, and uh one, the the kind of the senior, uh the architect of of our area, he's like, this is my baby, I want to play with this.

Yeah.

Chris May

So I get to look at his code, um, but I'm handling all the the the web stuff, which is my baby.

So that's wonderful.

Will Vincent

Right.

Well, one of the I mean, again, just going off of my uh discussions with the people I know here doing something a little bit similar, some of the things they've mentioned that uh didn't occur to me at first is that you know, because your the prompts are, you know, in English and you're and you get it to work, but it's specific to that model.

So, you know, like a new model, they're right, there's constantly updated models.

The process of uh you know, it's not as smooth an update from like Django 4.2 to 5.2 as it is going on whatever version with the LLMs because you're sort of back to square one.

So I guess I'm just I imagine that's also the case for your colleague that you're you're really kind of it's harder to switch because the LLMs and the prompts it's yeah, it's not code, it's sort of English.

Chris May

Yeah.

Yeah, and we definitely have uh you have a tool that you we we have a few, you know, trial PDFs that don't have, you know, uh patient information and or you know, we have uh it's it's sanitized, let's say.

And so we have a tool that I can, you know, we essentially have a Python script that you aim it at a PDF file, tell it which model you want it to do, it'll do the whole process so that uh we can test each new model as they come out and see how they perform.

Right.

Carlton Gibson

That's that's the the the the trick, the engineering trick, it seems, is to have some kind of test harness which can validate whether your prompts are still working.

Chris May

Yeah, and we have a team of um you know uh project man or a few project managers who are and and other people on the you know the team that we're serving who are former nurses and things like that.

So there's a lot of industry knowledge.

So we pretty much run this and go, here, is this good?

You tell us.

Carlton Gibson

Gonna just say you've been at you've been at the engineering a while, right?

You see this you've got because you know, we're gonna go on and talk about your talks, which is just super, but uh you you come at it with uh quite a lot of

Chris May

I mean I'm building I've been building websites since 1995, so that's you know, a couple of years.

Um, but I I graduated with a degree in graphic design uh mainly because I thought I wanted to be a computer scientist, but couldn't understand what they were trying to teach me.

Um so switched to graphic design.

Absolutely love that.

Um, you know, I I you know just just the it's like uh I I often I used to say that I'm really the product of my parents.

My dad is an engineer, he thinks about how things work and and and things like that.

My mom is an artist, and so I am very much using both sides of my brain.

And so I love the graphic display of you know websites and trying to figure out how to make a really great user experience and then having the engineer prowess to you know actually make it possible and to make it as smooth as possible and you know have uh well-readable, well-understandable code at at if I can.

Yeah, yeah.

Chris May

And so um, so yeah, so essentially back in uh roughly around 2007 is when I started using Python, and just a uh a few years later I started using Django, and uh yeah, that's kind of been my passion is is you know making yeah, the user experience as best as it can be, both for the users and for the developers.

So um somewhere in there too, I okay.

I since I I pro I learned to program as an adult, I had a lot of um, you know, uh feeling like I didn't belong, and I did a lot of r learning from the people around me.

And as I I tried to like whenever I learned, either through a blog post or a podcast or you know, uh somebody I'm um on my team, I would try to make a habit of like sharing it with another uh colleague of mine, because I figured like if I just learned this, then then they might want to learn too.

And about a third of the time they're like, Yeah, yeah, I already knew that.

Yeah, thanks, sure.

About a third of the time they were like, Wow, well, I didn't know that, thank you.

But the best part was like a third of the time people would be like, Well, that's true under these circumstances, but here's a thing that you might want to know.

And um, and so kind of by doing this, I also felt like I've kind of as I grew as a developer, I also grew as a coach because I got to, you know, share with people and uh and then eventually like when I became a a lead developer, which was a major anxiety point in my life as an imposter, um, I uh didn't know what to do for a couple weeks until I finally thought, what would my podcast say to do?

And I just tried to invest in those around me, and uh and that's kind of what I've been doing for the last few years, and I've been really enjoying that too.

Carlton Gibson

I like the um that little story because I as you began it, I was thinking, well, you know, the the teaching is learning kind of thing.

So you know, you come across something new if you try and teach it to a third person, then you know, you you'll be um you ground that knowledge a bit deeper in your in yourself.

But then when you get that feedback of that third of the time and someone says, Oh, but if you consider this, it's okay.

Yeah, it's the circle's code.

Chris May

The the strong opinions loosely held kind of thing is what I try to strive for.

Will Vincent

Well, I think it's if you learned how to program within these organizations because you're coming from the graphic design side, you had you had those colleagues.

I mean, I think a lot of people, you know, don't have that at all.

I didn't have that when I was learning how to code.

Um, and it really hinders you.

You have to find, if not a community, a group, right, where you can bounce ideas and uh have some give you know give and take.

Um it's a little bit easier now with Discord and the forums and stuff, but you know, back when I learned how to code, it was Stack Overflow, and ooh, you didn't want to go in there with a question that wasn't perfect, you would get lit up.

Chris May

Yeah, and actually to that point, um in the first programming job I I had, uh, you know, I was learning Python, I was loving it, and one of my colleagues uh was also very passionate about Python.

And so the two of us were like, wait a minute, Richmond, Virginia needs a place for Python developers to hang out.

So we created PyRVA, and um we've actually wow, we're closing in on 10 years of PyRVA.

And um, you know, we we're trying to create a little community where people can just kind of come together and you know, learn together.

And uh yeah, absolutely.

Will Vincent

Well, there's uh I'm not gonna say surprising, but there's there is quite a a scene in Richmond.

I mean, several people we've had on this podcast, I mean Justin Duke from Button Down, uh, I believe Andrew Michar.

Um there's you know, it's I mean, I know that I mean Richmond Richmond has always had what was it?

There's there was a a very prominent digital agency that's been there for a long time, right?

Chris May

Um Yes, probably.

And I probably don't realize how prominent it is because this is Richmond.

Will Vincent

I remember, you know, 20 years ago, um, because I went to college in Williamsburg, Virginia.

So that's right.

Will Vincent

Yeah.

Some sense of the Virginia thing.

And uh That's where

Chris May

they grew up, actually.

Oh, okay.

Will Vincent

Yeah.

Um anyways.

Will Vincent

Well, so we so you started in the graphic design.

So then did you did you go into what did that mean?

Did was that like graphic graphic, or did you were you have a chance to do a bunch of HTML, CSS, and JavaScript before you went over to Python?

Chris May

Um a little bit of both.

Um most so when I started web development, we there was no CSS, so but uh all my computer science friends said, damn it, Chris, your websites are so much better looking than ours.

And so I kind of had I, you know, I had uh I I won a copy of Photoshop in some high school, you know, competition.

So I was always messing with uh graphics and stuff like that.

Um but then I um you know through the graphic design thing, I essentially got pulled away from web development.

And so I was doing you know all the print stuff.

Um in fact, the the I at first I had a hard time finding a job because they were like, you have too much web experience, we want more print experience.

And um, and so then I ended up getting a job at a advertising agency and did a lot of you know logo work, uh brochures, that kind of thing.

But also, you know, the they realized, oh, he knows how to do websites, and so I would do just H at that time I learned H uh CSS, so I did HTML and CSS, but not JavaScript, because I thought JavaScript was Java and I hated Java applets, and I was like, there's no way I'm learning any of that.

Um and then in my next job um was uh similar.

I was at a trucking company uh that's nationwide called Estes Express Lines, and uh essentially it that was awesome at first.

Like it would there was you would think doing design for a trucking company would not have much variety, but I got to do everything from of course the deep cows in the truck and brochures to custom um board games and product photography.

It was just it was shocking.

And then at um at some point they needed somebody to help uh implement the the website because they they bought the design of the website but not the impl implementing of it, and I was like, I'd be happy to help out.

And uh that's when I learned that JavaScript is not Java and uh and started reading blog posts and listening to podcasts, and and then I realized at some point I was learning all the things that the computer science teachers were trying to teach me, but I was doing it through blog posts and the way people were you know talking about it there is like, oh, now I get it, you know, and uh yeah.

Will Vincent

Well, especially front end, it's hard for the teachers to keep up, right?

I mean it's one thing if you're teaching the core algorithms course in Java, but if it's JavaScript and all these things, right?

I mean, they're um especially if you're in acad a truly academic setting, you have so many other things you have to deal with, you can't keep up, really.

I mean, could right because they're not practitioners generally.

That's true.

Yeah.

Chris May

Yeah, I don't know how many people are learning HTMX in in in college right now.

Will Vincent

Well, yeah.

I mean, if they are, it's you know, some adjunct teaching it.

Yeah, right.

Will Vincent

But same same same with same with web development, right?

I mean, because my my books are taught at some universities, but it's always web is not a core part of computer science curriculum.

Chris May

That's a good point.

Yeah, absolutely.

Will Vincent

I wish it were.

Chris May

No, yeah, because that's one thing I've been thinking about too, is like, you know, every now and then I get into a conversation of like how worth it is college.

And it's like, I think, you know, in certain ways it definitely is worth it, but it's like, you know, the computer science is not, like you said, web development.

It is a lot of theory, and of course, you know, great for, you know, I know some people who are learned a lot in computer science, you know, uh uh um courses, and you know, they're great at all the algorithms, and it's they are really smart in that way.

Um, but you know, I guess really what it what it comes down to is this world is just so complicated that just a you know, the the colleges are trying to do their best, I would think, but like computer science is not you know, I think that um the college I went to also had like a uh information technology degree, which was at the time I was like, How's that different from computer science?

Of course it's very different, and I still don't know exactly how, but it's like it's you can't it's hard to like you can't have uh you know a degree in every single discipline, I guess.

Carlton Gibson

Well if you if you did IT you can fix the problem.

Will Vincent

Well, I mean the the three of us, none of us have formal computer science experience, right?

I mean, and here we are.

I mean, I think one of the nice one of the things that's about web that is so helpful that I wish there was a little bit more is that it's one of the few things you can jump right in and immediately get your hands dirty.

And you know, uh Carlton's used this analogy of like the grandfather clock with deployments, but I think having a project where you know you can build this, build a site, have it interact with people, you know, add analytics, you don't get that with writing, you know, Python scripts for like a TikTok uh not tick to uh tic-tac-toe, you know, like it's not visceral and it doesn't kind of keep you going in the same way.

Um is right, you can kind of get going and it's just nice to have something to to put a toehold in.

And I think that's that's the challenging thing about computer science is you do have some students who've web or AI or whatever, they've they already have the context.

They sort of see how it can be applied.

And then you have just bright students showing up being like, what is this thing?

And you're dealing with people who've been, you know, A have the context and B have been doing it for years, and you just don't have that, you know, like chemistry, people don't walk in with like six years of chemistry experience to the intro to chemistry, right?

So I d I do feel a lot of people are like, Oh, computer science isn't for me.

It's like, well, no, like you're, you know, you're you're comparing yourself in the wrong, you're comparing yourself in the wrong place, and you completely lack the context, which if you certain minds, you know, love the abstract nature of computer science, but I think most people want to do something with their skills, and you yeah, it takes I think it's like uh only the upper levels you kind of well depends what you want to do, right?

I I personally like the the nuance of database abstractions is not my cup of tea, but some people it is.

I'm just like, yeah, get the data, throw it over here, like let's go.

Chris May

Um and and to your point, you know, too.

I was thinking about how just a couple years ago, uh, you know, we had a session at PyRVA, and you know what I can't I need to remember to do this, but every now and then I remember like, you know, we we have a session at the theme is this, but I also want to add, you know, if there's anybody here who has a question about Python, I'd be happy to, you know, help or whatever.

And so one of these days I remember to do it.

And this gentleman came up, uh, you know, young man who um was working on a really old computer, and he was like, I want to know how to I I I want to make a website, you know, with Python.

How can I do it?

And you know, over the course of I don't know, half hour, 45 minutes, I I helped him to download Django, uh, create a virtual environment, download Django, and we ended up with the you know, the the starter page when you get everything up and running initially.

And like he lit up because all of a sudden he he he saw that he could do these things and it does it.

He can load the web page in his browser and it's running on his computer, and it's it was such a magical moment.

And then I was excited because just uh uh was it this month or last month, he came back to PyR VA and was like, Chris, thank you for all your work you did.

I now have a job in web development, thanks to you.

And in and and I was like, Well, thanks to you, because you did all the hard work.

I just showed you how to get started, and uh, you know, it it I think that is such a great thing to be able to experience, you know, like like you said, like like doing something and having it, you know, the change and and experience it is.

Will Vincent

Yeah, I think of it as the aha moments.

Like you you get a lot in web development and you need them periodically, or most people need them.

Um maybe Carl, you know, Carlton's a philosophy PhD, so maybe he can just read the manual and be good to go.

Carlton Gibson

I don't know if that's true.

Like I I can read the manual and then I can sit there staring at a syntax error for five hours, you know, when I finally realize it was a missing semiconductor.

Will Vincent

Because you're not using LLMs enough, Carlton.

That is that is a good use case for too much.

Carlton Gibson

Well, yeah, too much.

Will Vincent

Yeah, no, well, we don't need to get totally dis Yeah.

Carlton Gibson

Anyway, anyway, anyway.

I mean like you know LLM stories.

Will Vincent

I just wanted to get to HTMX and stuff, but I don't know where you were headed.

Carlton Gibson

Well, yeah, so I was gonna ask Chris, you said you're interested in user experience and crafting the thing, and we know you you've done these talks on HTMX and SBAs and things, but I wanted to kind of back up a second.

So is that have you you've done the React stuff, you've done the the uh the other things, and uh like where do you think the richness of UI is is best or depends on on what you're doing, or you know, we'll I'll give you it depends out straight away.

Chris May

So essentially, yeah, I I I went deep into the single page application um environment.

Um as somebody who cared so much about user experience.

Uh I was working at a creative agency at that time and you know heard about this React thing that came about.

I was doing research on it, and I was like, we need I need to find a really good use case for this, and um eventually found one.

Actually, we ended up using View at that time instead of React, but of course I've kind of dipped my toe into all of them and loved it for years, you know.

And then at one point in one of the podcasts I was listening to, um, the person was saying, you know, I realized that uh oh, well, I'm trying to I know at one point I I I think it was the same person I mentioned in my talk, uh, where he realized that all the work he was doing in um, I think he was also using Vue at the time, is just like so much more work than he did when he was just using Laravel.

And that kind of planted a seed in my head, and I started looking at my projects and thinking, yeah, you know, we're we're validating things twice, you know, to you know, as as smooth and as wonderful as the user experience is, we're having to do a lot of work to get that to happen.

And um, and essentially I, you know, kept experimenting with things along the way, but it wasn't until um David Guillot's talk at um DjangoCon 20 uh U J DjangoCon Europe uh in 2023 where I was like, oh HTMX is much more than I thought it was, you know, and uh and yeah, starting at that point, I was like, what what that team did was amazing, and I need to like do some research into this.

And so, you know, experimented it on my with myself, and um, you know, the for me it's like I think the biggest where they're they're essentially, you know, like I kind of talk about how like it's for the user experience and the developer experience is really what it comes down to for me a lot.

And that initial page load is it hampers the vast majority of single page applications, and so like that's why uh you know my talk I talk about streaming the HTML so that like pretty much as soon as the essentially as soon as the you you start you tell the browser to go to the page, you start getting content back and you can interact with that content.

Uh I love that.

Um, and then having you know a progressive enhancement enhanced experience so that like you know, especially oh my god, I can't I don't know how many times I go to a website and I try to click something or try to interact with it and it's like nope, not yet, because you haven't finished loading.

It's uh it's maddening.

Carlton Gibson

Um the example which comes to mind is git is GitHub.

So I mean I'm sure it's fine if you're in San Francisco, but I live in Spain, and so like literally I'll I'll be trying to review a pull request and it'll be click and multiple seconds will pass before that click does anything.

It's like no no no no no, this isn't this isn't progress.

Chris May

Yeah, yeah.

And uh our bank just updated their web presence or their uh you know what the stuff that you sign on to, and it's just like okay, so I I've now loaded this page, I have to wait seven more seconds for a summary of my my accounts, and then I have to click into that, and I have to for some reason some reason as soon as it's live, you click on a link, it doesn't do anything, but you have to wait another second or two before it goes, and it's just like this is not what we

Carlton Gibson

yeah, and you know you know which link you want to click, right?

So if that link just functioned, you could you could be on.

Chris May

I don't even know if I could deep link to it now that I think about it.

That might save some time.

Will Vincent

Hacksoft is your development partner beyond code.

From custom software development to consulting, team augmentation, or opening an office in Bulgaria, they're ready to take your project to the next level.

Carlton Gibson

Can I ask you a question about the HTMX methodology?

Because I picked it up I don't know a few years ago now.

Um, and I the thing that really struck me was the way it kind of ties into HTTP, how it ties in, you know, that the you use the HTP HTTP verbs, you use the gets and the posts and the puts and the deletes and it just felt like it was kind of of the web in a way that and that for me that was why it worked so well with Django, because like the patterns that Django wanted, HTMX just enabled, and it was like okay.

I think that no, we get a lot of return on investment from from leaning into the

webinar that way.

Chris May

And it's funny too, because like I really when I kind of dove into HTMX, I also did Alpine JS at the same time, and I really loved you know that locality of behavior, you know, so you can just work on one little component and have everything defined.

Oh, and tailwind, I I had tailwind too, I like that another story.

And so like everything right there in your HTML.

And I I loved that.

Um, but I also acknowledge that like that is a lot of like that adds a lot of weight to the HTML, which I don't think as far as you know, the the kilobytes across the wire, I don't think it matters that much.

But what you know, some of the things I I'm concerned about is when you know the the person comes up behind me or me in six months, will I be able to understand that?

And usually I can because you know it like you the I have like uh I think it's called Rusty Wind, it kind of sorts tailwind uh classes um so that like I kind of know like okay, you know, it it might take a little bit, but it's like, oh yeah, each of these things means specific things, that's excellent.

Um, but like sometimes the Alpine JS stuff, I'm like, what was I thinking?

You know, uh that one's a little harder.

Carlton Gibson

The the trouble is it's like um in the old days of jQuery when you could just you know you select your element and then you'd just do a line of and then your line would get longer and it would get longer and it would get longer, and in the end you'd be like, I've done too many lines here.

This is this is the same danger applies with Alpine, right?

Because one line of JS, yeah, no problem.

Any given moment, one little bit more, no problem.

But all of a sudden it's like, hang on, I've written an entire JavaScript in an attribute on one element.

Chris May

That's totally yeah.

One of the project, one of the experiments I did.

Well, I guess I can can't really say it's an experiment because I was doing it for a client.

Um, we were doing a uh uh rules engine, and the you know, so I was hired by the uh uh vice president of the company, and um, and so he was like, Okay, I'm gonna work on it in React, and you rework on it in Alpine, and we'll see like what it how how it comes about.

And pretty quickly he was like, Wow, this Alpine version is much simpler.

So he kind of joined me on that for a little while.

But then it was just like it's just kind of crazy because like it in some ways it was super cool because it we just had native HTML, form elements, you know, field sets with inputs and labels and all these things styled to look amazing, and and had all these hidden text fields to um to to kind of carry some of the data around with it.

And so, yeah, it in some ways it was like a technic I felt like this is amazing, because like you we sub you everything was just in the form, the state was in the HTML, and uh, and then you know you submit it and it it's just the form requests going out.

Um, but oh my god, like all the template inheritance and all the like special cases.

I was like, yeah, there's definitely some kind of balance in between the two that that would be good.

So I'm especially right now, I'm looking into like web uh components and trying to figure out how to kind of what's what's the next stage, you know.

Like Alpine JS is awesome for like you know the small things that you can handle.

Obviously, it can handle so much more.

You can you know, you don't have to tie things straight to the HTML element, you can you know add things through Alpine Magics and stuff.

But um you know, I know David Giu uses uh stimulus in his projects, and so and there's I mean so many other things in Django, Django Cotton, I think.

And I I just you know that's one of the things I'm frustrated with at work.

It's like I want to try some of these things, but we are not using Django.

So what's the UI stack at work?

Carlton Gibson

Is it the React type thing?

Chris May

No, well, so I I'm sorry, I should say yes.

Uh yeah, for like the projects I've been on, not not well, not my current project.

Uh the current project I'm doing with HTML and Tailwind and um and actually Pico and uh Alpine.

But um, but yeah, the other projects they have dedicated teams to do front-end development.

And so they do I think it's uh it's either React or actually it it they're polyglot, but you know they have different libraries that they're using and leveraging in the different spa architectures.

But um, you know, I'm

Carlton Gibson

so you're you're that naughty back end developer who quickly sneaks in a little bit of HTMX on the side when no one's looking.

Oh yeah, I just I just built that because I didn't want to disturb you.

Yeah, exactly.

Chris May

Well, and it and we the the company that I work for has a uh internal uh conference, developers conference, uh once a year.

And so last year I essentially gave my PyCon, my DjangoCon talk uh to them and was like, hey, you know, there's a better way than the the single page application route.

And it turned a lot of heads, but I don't know that much has come of it.

Carlton Gibson

Oh companies are hard to turn around, right?

Chris May

Totally.

Yeah.

Will Vincent

I I wanna I want to come back to so you mentioned it's fast API and Starlet, sort of the underpinnings.

Um like why do we talk a lot on this podcast about you know fast and whether Django or not is fast.

Uh I get well, I guess I'm not trying to have you like throw a colleague under the bust, but I'm curious like if if there are indeed specific asynchronous things with the workflow that you're doing that benefit from that, or more it was someone who thought speed would be important and maybe like like how how does Django lose out in those situations?

Because you know, like we would say, well, you can use Django in something that needs to be fast, like you can do asynchronous things, like or you know, where is the slow where's the speed problem?

Um, but like when I'm out in the wild, because I sp uh like you, I spend a lot of my time dealing with non-Django people now.

And you know, so I hear about Java and Kotlin and all this stuff, and then I also hear about, oh yeah, I gotta be async, gotta be, you know, fast API and Starlet.

And I I I try to push them on like what are you talking about?

And I haven't really gotten a great answer.

I know there are use cases for it, but it generally seems to be more of a sense of okay, Python web, these are faster, Django's slow.

And then you know it's a year later, and like you know, you're using these tools and and they're good tools, but um all right, so that that that's a long-winded thing.

I just like as a Django diehard, it hurts me a little bit when people say it's slow.

It's like, is it slow?

Like, um Yeah.

Chris May

And honestly, like I don't myself, I don't feel like it's slow.

You know, I know I've seen benchmarks, but it's like, you know, the you can't I feel like the the the difference between, you know, say fast API and Django is not worth the you know, it it it it's negligible in in real world.

Right.

Will Vincent

Unless you if you have experience in one or the other, like you know, go with it for sure.

But I've also yet to see I I mean ca you know, maybe if you if you're doing something truly, truly real time, like I don't know, chat something or other at scale, chat bot at scale or something.

Okay, maybe.

But it um and maybe maybe I just well definitely I need to spend more time with especially with Fast API.

Um uh because partly because we my my the company I work at supports it and we have integrations, but also it's I mean I suspect it's a lot it's it's not just the speed element, right?

People like the newness of it and you know uh you know yeah, you start with something and then you just keep going with it because a lot of these tools are are quite good and

Chris May

yeah, and in in the case of my current project, uh so I, you know, presented a couple options and the the pr the person who you know was has been shepherding this project was really mostly reacting against what he found in another project in our group.

Um they use um I'm sorry, let me think what work, they use Starlet on theirs.

And um my colleague was like, I don't like the way that is handling, so let's use Fast API.

Which of course I'm like that use the Starlet under the hood.

And he's like, Yeah, it doesn't matter.

Will Vincent

He just he likes that abstraction better.

Chris May

Yeah, uh, and I think it's mainly because the um, you know, like this my colleague is I don't know how much Python specific experience he has.

He had a lot, he's a polyglot, he's a lot of experience in Java and is you know incredibly smart.

Um, but he was seeing the code that the the the team was creating, you know, on top of Starlet.

And my impression was that he was not happy with that.

Um maybe some of the the patterns that they use to connect the routes to you know the the functions that that call them.

Um I don't I don't I didn't really dig dig deep into the why but I was just like yeah pass API sounds good, sure.

If that that's what you really want, no problem, let's just go with it.

Will Vincent

Yeah, I mean, well Carlton, you're the expert here, but I mean Starlet is is ASGI.

It's not really a full blown like I don't know how many people are writing pure Starlet stuff, or maybe they didn't realize they shouldn't be.

What do you think about it?

Carlton Gibson

Fast API is a nice well fast API is a is a nice layer on top of Starlet, right?

It's a nice uh

Will Vincent

but why would they use Starlet in the first place, I guess, right?

Like that that's sort of I'm sure they have their reasons.

Carlton Gibson

That's okay.

So I see I so I maintain the channels packages, and I see an awful lot of people who are diving into async just because they they think they need to.

Um and they're creating um people I often see are creating an awful lot of problems for themselves, which they could just avoid by not doing that way.

So I think there is a certain amount of um uh how do we say um async is better no matter what uh belief out there, which it isn't really grounded in reality.

Um I think and so if that's the case, then well, fast API is the is the exciting um choice there in the space.

It's like okay, that's the one with the mind share, that's the one we'll go for.

But I don't think it's in in for uh most of the cases I see it's not really a technical um the it's not really a technical choice.

It's not based on do you know what we've got these three put throughput requirements for these kind of you know none of that's been done.

It's literally a um a vibe choice.

Um and so the interesting question is why Django, the Django because it's old, because why we aren't our messaging isn't you know better.

Why aren't we should be out there banging the drum?

Do you know what Django is still actually the best choice for you out there?

If we want to, you know, if we want to stay relevant and stay competing and stay winning the choice in those kind of I don't really know what I'm doing, but I'm gonna pick a web framework.

Will Vincent

Um I think it's that newness though.

Again, like when I see non-Python, non-jjango people, they they look around, they're like, well, Django's been around for forever.

A flask isn't featured enough.

Fast fast is like the new Django, it's got a lot of stars, that sounds good.

Let's right.

Will Vincent

I mean, I think it's pretty much pretty much that and it and it's you know, there's nothing against it, right?

But it's all you know, yeah.

It's I don't know if how much of that is is that a polyglot thing?

Is that just an ignorance thing?

You know, because I mean if I was diving into I don't know, rust or something, I might look at something that's newer that has the same amount of stars as something that's older and just like, oh, that seems better without you know, there that that's the problem with being a polyglot.

You're maybe you don't have the depth.

I mean you might, but you probably don't.

Chris May

Yeah, and I I know you know, and I think just it's also trying something new out too, you know.

Um I do feel like sometimes I wonder if I'm really an odd duck because I just will create a project on my computer just to try out a new thing, you know, a new tool.

And I don't know how many other people really get to do that.

Um and so I think when a new project at work comes around, they're like, Oh, oh then maybe this is my opportunity to try this out, you know?

Will Vincent

Well, I think most people don't have full control over what they do.

So like you either need to, you know, hopefully find yourself in a consulting or other setting where you can try out new tools or you just need to s do it on your own.

Yeah.

I mean that's why I think like yeah it's you have to have something of your own that like you can play with like you know like a Django thing, right?

Like that was like I had I have this Learn Django site that I like completely rebuilt last year and like there were some business reasons, but a big reason was I just want to have like a real functioning thing that like I can do stuff with.

Like I'm coming up on there's a whole bunch of stuff I want to do around testing and all these things and you get kind of tired I get kind of tired of just like spinning up prototypes.

It's nice to have just something I fully control that you know matters but doesn't matter so much.

Like I made a mistake the other day and I I I I took the site down you know for like five minutes.

But I have tests that said ah and I have you know I have tracking and so I quickly fixed it.

Right.

Nice.

But yeah.

Carlton Gibson

That's that's still three nines.

It's easy you know how many nines do you want?

I just hang on before we go I just want to swing up I think there's two things we need to do.

We need to finish off the async story in Django.

It's it's so nearly there but like we need to get the ORM async so we've got the full flow.

Like we've got the full request response flow.

If we had the if we had async cursors in the ORM you know we could do everything.

That would be good.

Carlton Gibson

And I think we still need to big up the ecosystem more than we do.

One of Django's absolute strengths is the depth of the ecosystem and we hardly mention it.

And you know if you're starting out and you're choosing why is why is Django a good choice?

Well because you you do know that there's this massive depth of ecosystem oh no I didn't really know that I'm choosing yeah you know the core framework against the core a fast API framework why would I choose Django?

Well it's just older and clunky well no but you've got all of these resources just there for you if you choose if you want them and we don't message that very well.

I think yeah

Will Vincent

it's just it's a discoverability problem.

I mean yeah and right and culturally like Django itself is not going to pick favorites there which okay that's fine.

But um yeah I don't know as much as right there's Django packages there's awesome Django there's people writing great posts but it's still hidden to people in a way that well I mean you know like like like Laravel right like Lar it's a whole separate beast for a lot of reasons but it just goes oh you want this boom use this one right it's just all kind of right there and approved even though that we could name 10 20 packages that are kinda official they're just not actually official

Carlton Gibson

Yeah totally so well the steering can just just on this the steering counsel is working on an ecosystem page to go on the site you know hopefully the top banner saying so at least there's like a you know uh here's here's here's some of the ecosystem going

Will Vincent

exploring which we

Carlton Gibson

haven't yeah here's where you might look where which we haven't had previously um I think if we can at least guide people out into the wider Django world we can you know do do a lot of newcomers to the framework a big favor.

I love that yeah sounds good so the other I go on you go ahead Carlton I was gonna ask him about his events is I was gonna ask him about his event sourcing article but you go ahead

Carlton Gibson

yeah I was gonna ask about that

Will Vincent

too all right you go all right you go all right you go

Carlton Gibson

well so Chris the other thing I want to talk to you then is about as event sourcing which is your your new hotness you did a post the other day and it's gonna be a whole series right

Chris May

yes yeah in fact I'm hoping to launch the second one after this podcast after we record this

so like I wonder how many will be up by the time it goes out but um yeah yeah uh essentially you know I uh I mentioned about how I learned a lot of things through podcasts and uh roughly a little over ten years ago a number of the podcasts I was listening to people were like oh what's this event sourcing thing and um I started you know listening to it following people bought a couple courses on it and was like wow this event sourcing thing sounds really interesting the the thing that was really and

and actually now that I think about it it probably had a lot to do with the whole single page application pattern because they were um the the thing that really made me interesting about interested in event sourcing was the idea of always having a fast uh UI because um essentially let me rewind and they define event sourcing uh what event sourcing is is um it's an application a a architecture for application development where any time you want to change the state of the application you save an e

vent which essentially represents that delta into a uh an append only log of other events and then the the second component of it is anytime you want to know the current state of an item um you query those the the relevant events for that item and then replay them in memory and then you you know like that's the current state.

And uh and so as a most event source applications leverage a technique called CQRS which stands for command query separation responsibility separation which essentially means uh the way you save data to the database is different than how you like read data to the display and so um so the idea is every time an event changes the state then you have these listeners that listen out for specific events and can update you know database tables or uh you know R

edis caches or a file in the file system anything like that so that the user experience could be blazing fast.

And um and like I said that was about 10 years ago that I started listening into that but um and you know a lot of people that I was listening to were really smart, really heady a lot more than I am and they were like you should really if you want to implement event sourcing or if you want to use event sourcing implement it yourself because it's not that complicated.

And plus you'll know all the little mechanisms and so I was like well I'm never going to do this on a production thing.

I'm gonna figure it out on my own right and um so last year I got laid off and I was I uh was you in the midst of job searching I was like I I want to keep my you know um I want to keep sharp so I was like well why not I've been meaning to do this for 10 years let me like actually do it and uh and so I created my own little event source application and learned it was such a hard thing to do for me.

But I learned a ton doing it and of course I've I've known for over 10 years that there's a package on PyPI called event sourcing which makes it a lot easier.

And so all I have to say is uh I mean I've I've I'm now that I've actually implemented at work and have a production or we're not quite in production yet but the the two the project I'm working on is event sourced and I'm just seeing you know all these other well partly also because though there are these two gentlemen um Adam Dmitriuk and uh Martin Dilger who um they've been living the event source lifecycle for over a decade each and they've figured out ways to simplify work

ing with it essentially like um um how to communicate with the teammates and the business of you know what what the events are how things change how you use the data um organizing your files in such a way so that you don't step any uh you can have multiple developers working on the same thing and not step on each other's toes and then you know simplifying you know essentially kind of putting guardrails up with event sourcing so you don't get yourself into trouble.

And uh and oh my God it's it's I like I hope this is it's like one of those things where like I've been programming for almost 20 years this but by following the people that I've you know around me.

And now that I'm doing event sourcing I'm like this is so nice.

I need to I need to share this with people you know you can make your own decisions it's but for me this is very compelling.

Carlton Gibson

So um one thing I'm gonna ask you about it is the um the way you kind of um get rid of your model objects in a way because you've got your models are your events and but then you're gonna map those to um domain objects in your aggregators in you know your functions which go and get all the events and work out what the current state is and then those objects come out.

So it's it is really a big um kind of shift from the model first approach.

Chris May

It's funny well especially if you're using the event I'm gonna say it's not it is and it isn't in that um because the event sourcing community came out of the the domain driven design community so they are very tied to the aggregate uh idea and so therefore the Django model you know and so it has a lot of that same thing especially with the event sourcing package because you just create a class that works the way you expect it to in Python and you decorate it with some decorators and it automatically creates the events for you transparently in the background

And so if you're just doing it for like you know creating models and mod manipulating them or whatever, it's in a way it's like not doing anything different.

I mean, and and there is an extension with the event sourcing uh package that works with Django.

And I haven't experimented with it yet, so I don't know exactly how deep or how similar to Django it is.

Like I thought it said it can use the overRAM and stuff, but um I'm I'm not sure yet.

Carlton Gibson

Well, you could at least use the ORM for um, but I don't know about the width of the package, but you the obvious thing to use the ORM for is your event lot is your event table, right?

Chris May

Is yeah,

list of events.

Carlton Gibson

Here they go in that table.

Chris May

Well, yeah, and it's really interesting because like um because it's so like this is one of the things I'm most interested in, in a way, because with event source I mean so tied to domain-driven design, uh there it it I feel like in the last few years they're really starting to realize, hey, we don't need to use all this of domain-driven design.

We don't need to be tied so tightly to it.

And so there's like a uh one of the things I'm learning now is a what they call um dynamic context boundaries, which is of course a very domain-driven design way of saying um flexible uh um, you know, you don't have to be tied to one aggregate.

You can say like you can create a dynamic boundary to say, like, these are the type of events that I care about.

They might span multiple, you know, aggregates or they might be less than what I would do for one aggregate, you know, like instead of like uh, you know, like let's say like if you have a a s uh a course uh you know in a in a in a college career, uh college course, you may not care that the course changed names over the course of its lifecycle, but you might want to care about like how many um what's the maximum of attendees a course can take.

So you can just listen to a subset of events for that one object.

Will Vincent

That's a nice example.

Well, we're gonna we're gonna link to that.

I definitely I have played with it at least of the three of us.

So I'm I'm looking forward to your new uh your second in the how how many do you anticipate in the series?

Is it a s a series you're thinking of?

I do.

Chris May

I have five drafts right now.

I might like based on the feedback I get from people, like because there's still there's tons of questions about it, which I get and I'm I encourage because like the more people ask me about it, the better I can explain it, the more better I can, you know, z help people.

So I'm thinking about maybe adding a sixth one that's kind of like a questions I get asked during this this whole thing or something like that to try to uh you know cover up some or not cover up, but you know, answer some of those questions.

Right.

Yeah.

Will Vincent

Well, gosh, we're we're at 50 minutes somehow.

So I want to quickly ask you our our infamous question about the magic wand in Django.

Do you you've listened to our podcast, so yeah, you have one.

Does something something you want to change?

Chris May

There is something I want to change, and really in theory, I I could change it.

I just need to find the time to do it, but it is being able to stream HTML.

Like that, um, I really seeing how much that can affect user experience.

Um you know, I I mentioned uh sadly in my first talk that the you know maybe we'll have that in a year, and I was like, why did I even say that?

Like I I practiced so many times not saying that, but it came out when I said it.

Um but yeah, you know, like I know at one point they I think somebody was looking into doing it at a Google Summer of Code.

Um, but it just it hasn't been done.

And you know, and I think partly because they they need you you make need to make the whole um template engine async, which you know, I don't I don't know how how hard or or not hard that is, but it's just it's not a priority.

So but that's something I want.

Will Vincent

Is this a steering council priority, Carlton?

Carlton Gibson

I think some I think we'd have to see a proof of concept for that.

I think, you know, for me, okay, it's so the um 5.2 is out the door now.

Django con Europe's just around the corner.

There will be conversations now will start to be start to happen about okay, so what what are the two or three things you want to push for 6.0, this uh Django CSP, this the async story, you know, if we could push just the ace the ORM cursors, that would be an amazing thing.

I think asyncrifying the the um the template language is you know gonna have to wait a while for it to become a sort of community project, but if a community priority, but if somebody wants to push it, I think that what would I do in this thing?

I would split my um my response into chunks and I would render each chunk and and output it.

So you know, if it's say it was a list of items, I'd you know, stream, render one item, send that, render the next item, send that.

And it's close enough.

It's not streaming natively from the template, but okay, it on the wire it's gonna look very similar.

Yeah, yeah, very true.

Carlton Gibson

But yes, that would be a lovely, uh lovely addition.

Will Vincent

Maybe someone listening will uh chase.

Carlton Gibson

These kind of things need somebody to sit down, roll their sleeves up and come out sick from their cave six months later with it, you know, sort of working.

Chris May

With a big pizza tab.

Yeah, yeah, yeah.

Will Vincent

Well, Chris, I'm I feel like we're just getting started, but I think we're we're we're up on time, unfortunately.

But but um people, we will link to your your talk if they didn't see it on HTMX and Django, which was popular at the time, has had a resurgence of late, and everyone I think it's one of the best, you know.

If you have questions about both, go check it out.

You I was I yeah, I was in the room when you gave that talk.

Chris May

So yeah.

Yeah, I that was I was so excited to that I was very looking forward to meeting you afterwards, and I was excited that you wanted to meet me because uh you enjoyed the video.

Oh god, thank you.

Will Vincent

Please.

Yeah.

No, no, no.

Will Vincent

I mean, that's the great thing about this podcast, is I just learn and learn.

Um so yeah, yeah, yeah.

Carlton Gibson

Yeah, I think you I'm very much I'm very much looking forward to you pushing forward the event source sourcing story in Django.

I think that's um it's an exciting, you know, extra thing we could have, that extra set of tools.

Chris May

I think so.

I think so.

Especially, like I said, great user experience, great uh developer experience.

I think uh I think it's gonna be very interesting.

Yeah.

Will Vincent

Well, DjangoChat.com.

We have links to everything, including all your resources, and thanks for making the time, Chris.

Appreciate it.

Chris May

Oh, any time.

Thank you.

Will Vincent

All right, we will see everyone next time.

Bye bye.

This episode was sponsored by Hacksoft, your Django development partner beyond code.

Learn more about their services in the link in the description.