Django Chat

Django Testing and Debugging - Karen Tracey

Episode Summary

Karen is a developer and co-owner at Caktus Group, a former DSF Board member, and author of the book Django Testing and Debugging. We discuss her PhD computing background, auto-scaling large sites, JavaScript front-ends, and more.

Episode Notes

Support the Show

This podcast does not have any ads or sponsors. To support the show, please consider purchasing a book, signing up for Button, or reading the Django News newsletter.

Episode Transcription

Will Vincent 0:06
Hello, welcome to another episode of Django chat. I'm Will Vincent joined as ever by Carlton Gibson. Hi, Carlton.

Carlton Gibson 0:11
Hello, Will.

Will Vincent 0:12
And this episode, we're very pleased to have Karen Tracey from Cactus group join us. Hello, Karen.

Karen Tracey 0:17
Hello, Kevin,

Carlton Gibson 0:18
Thank you for coming on.

Will Vincent 0:19
Yes, thank you. You've been one of the original people. I wanted to have come on the show because you've been involved with Django for a long time. And we've emailed about various things. So I'm very excited to have you on the show to share all your knowledge and wisdom. With us.

Karen Tracey 0:35
You're scaring me? Well,

Will Vincent 0:36
I mean, specifically, I'm thinking about the fact that you were on the DSF board back in the day and helped with some matters. And Django is not that old. But it's been around for a while. And there has been sort of these generational things of knowledge and changes around the framework. So anyways, we'd love to talk about how you got into Django, obviously, what are you doing today? But maybe we could start with your background? I know you have a formal background and how you got how you slid down the slope of computer science into Jenga?

Karen Tracey 1:07
Yeah, I started. I mean, I chose competing as a as a focus in college. So I'm more of a traditional came into programming and competing via school. That was a long time ago. Now. I think I was fortunate in the timing, that I was getting into choosing a career back when personal computers were just coming out the internet wasn't a thing yet. And there wasn't a lot of I it was at a time when it seemed like women were getting into all sorts of new things. You know, women could be doctors and lawyers and all this other thing. And I didn't have any back pressure of well, this is something women don't get involved in. I think nowadays, it's much more seen as a guys thing. I think I was fortunate in the timing that I didn't, didn't run into that. And I also came from a family that worked for IBM, both my mother before she started having kids and my dad worked for IBM. So it was sort of like, this is something my family does. Right. So I think I was very fortunate there in how I got into it. And I went into, I went to Notre Dame. And that was where my dad had gone. And I went into the College of Engineering, they didn't have computer engineering, but they had electrical engineering with a focus in computers. And, yeah, that's how I got into computing.

Carlton Gibson 2:47
Can I come back to the question that the thought, you know, but you said, I read an article a little while ago that said something like, you know, in the early days of computer and computer science, computer engineering, there was women were very much involved in that. And then there was a kind of sort of time where it, it's switched on, if you've if you've got a take on that, you know, because it seems, you know, now we're Django Girls and these initiatives, we're trying to bring it back, but it's still very male dominated. And I kind of wonder why if you

Karen Tracey 3:17
look at the history of it early on them before he older than me, there were women involved in you know, rewiring, you know, back when days when you had to unplug and plug wires into computers, women were involved, I think. I don't know, I wasn't, I don't, I'm not a historian. I don't know the how it all happened. But if you look at my mother's experience, you know, she stopped working when she started having kids. So it was more a societal thing of women didn't continue working. So there was that aspect to it. And then when personal computers came out, I've read various articles that talk about how the games and the marketing was all targeted at boys. And it became much more of a this is a boy thing. And then women didn't girls didn't, didn't get attracted to it didn't get into it. But I do think there's no reason I don't think there's any reason that the programming aspects, I think women are an asset.

Will Vincent 4:24
Well, I thought it was yeah, I've seen that chart where I think it was something in the 70s it was majority female, and then it just sort of drops off a cliff. But I know that I mean, there's like that book and movie Hidden Figures. I mean, there's female mathematicians, I mean, they call them computers, like because they were computing before they had so there's a long obviously history of that. I always thought maybe it was like once computers started paying well, all the men were just like, well, we'll take those jobs, whereas before it was seen as more menial, which I think is inaccurate, but it was very, you know, more detail focused. Who's I guess who's to say but it's a shame It's a shame. It doesn't make any sense to me from an objective point of view why that would be the case?

Karen Tracey 5:05
No, me neither.

Will Vincent 5:07
Anyway, so you had the background, you went into computing. So what was I? What were the languages that you were studying in school? And you know, how did you find your way to the web, since you predated the web a little bit?

Karen Tracey 5:20
Oh, back in school. Let's see, the first thing we learned was Fortran, and Pascal, and we did C. C is probably the language that I feel most like, that's my core language. Still, even though I haven't used it in decades. I got involved in a research lab at Notre Dame. And that's what led me to stay there and get a masters and a PhD. And we were doing research into how mainframes and personal computers were gonna talk and interact with each other. And we ended up that research lab focused on building an operating system, you know, it was microkernel, like, you know, a base set of services onto which you could build an operating system. And all that was written in assembly and C. So I had four good years of that was all I did was see pretty much so.

Will Vincent 6:16
So kids these days, right? They just don't know what they're, they're missing.

Karen Tracey 6:21
But so over time, like when I would go back to, I'm gonna jump around here, I guess, in the early 2000s, I wasn't working. And I was thinking about, uh, I should probably go back to getting a real job and having a decent income. And I should try and see, you know, interview you for interviews, make sure you could solve problems or whatever. So there's various sites, you can go and see, you know, solve this problem, do that, whatever. And I had programmed in Java, and Python by that point. But when I went to do these little problem solving problems that like my natural language, might, the language I gravitated to do things that even though I hadn't used it decades, was C, found interesting. That I did use,

Will Vincent 7:18
I was gonna say, what was that? Like? You know, so you have all this experience in a PhD? But can you reverse a link lists on a whiteboard? Did you have to do all that?

Karen Tracey 7:27
I did not. Well. I did interview a couple of times with Google. And those were days of free. Yeah, pretty much whiteboard coding. And I'm very grateful now that I did not get a job was Google because I don't think I would have enjoyed it pretty clearly. Cactus didn't have that kind of interview.

Will Vincent 7:49
So it's got this what you ended up you went directly to cactus after? Yes. Okay. So I was right when it started, right, because we we had them on. And

Karen Tracey 8:00
when I joined, they were four or five guys in a co working space in one little office, that's probably as big as this room. And I didn't fit so I was in a co working space. That was I joined in 2010. I think they were a couple years old at that point.

Will Vincent 8:21
Yeah. Okay, so

Carlton Gibson 8:24
gone. And that, but that would be about the time when you wrote your books. And the reason I jumped to work was because it's massively influential note for me when I was picking up Django because I needed had this sort of introductory material. And then I had, you know, your testing and debugging book, which was like, my buddy, yeah, no, I mean, it was influential, you know, really, like,

Will Vincent 8:45
I read it, I haven't all the other all the

Carlton Gibson 8:47
other books that have gone, you know, I don't need that anymore. I don't know, I've still got your book. And it's like, you know, it is, you know, the unit testing framework doc tests, the debugger, you know, you know, print logging, log logging, you know, it's such a hard thing to pick up and such a hard thing to get right in Python. And now, your book was dislike, you know, walkthrough in such a good way. So, you know, that's one of the reasons why I'm excited to have you because it's like, wow, Karen. She wrote that book.

Karen Tracey 9:18
Honestly, I hate Python logging. Yeah, no, it's so hard to configure properly. Yeah. So that was I it was after I had finished the book that I started working for cactus. So I got out of school, I went to work for IBM for about a decade. I took some time off. And then I got involved in crosswords. And I wrote my own set of utilities for building crossword puzzles. And what got me to Django was I wanted a a, I wanted to be able to see my database of published puzzles from various outlets, New York Times, Los Angeles Times, I forget what all I had, and I wanted web pages. where I could see the puzzle. The the aspect of the way I can see it in my crossword builder programs was a little bit of it. And I wanted to be able to see like this was the whole puzzle. This was the context in which this entry appeared. So that I could more easily evaluate is would this work in this puzzle in this context that I was working on, sort of thing. And I had a friend who suggested Python as a language learn as was a cool language. And I knew very little about web protocols. Back in my IBM days, I knew I knew we knew that I knew the details, the bits and bytes of the TCP protocol, IP protocol, that was the level which I went to the operating system, the middleware, the web, I didn't want to learn how to, I needed a framework, so and I looked around, what was there pylons, there was a set of them. And there was several to choose from. And I gravitated to Django, because of the documentation. Okay, interesting. And the, the completeness, like I didn't have to choose, I didn't have to make a lot of decisions, like do I want? I forget, the other ones seemed like they were piece parts, like you had to make decisions. And I didn't want to have to make a lot of decisions about do I want to use this or that I just want to like, do it for me. And let me focus on what batteries need to do. Yeah.

Carlton Gibson 11:39
So that's really cool. That was what because that's the that's the philosophy, right? Great Doc's and batteries included, you know, 1515 years into its lifetime. That's still what people say about, you know, we had some folks on recently saying, Yeah, well, it was the docs. It's the, you know, the fact that it's got everything with you.

Will Vincent 11:58
Can I just, I just say I feel like writing, like the definitive testing book on a framework, and then getting a job is like the biggest, subtle flex I've ever seen for a job. So, kudos, I love that. It's like, Why should we hire you to Django?

Karen Tracey 12:14
Well, it wasn't the definitive book, then because it barely come out. I think

Will Vincent 12:18
it's still I mean, and just to take a moment, I went to your chapter titles, like as a book author, like I love your chapter titles, like you have, you know, when you don't even know what to log using debuggers when problems are getting more information, and then what was my favorite ones? Yeah. When the wheels fall off, like the Jenga page, I love those things. Because, you know, it's, it's hard to liven up a technical book, but no garden.

Carlton Gibson 12:45
I mean, I didn't study computer science. So I studied philosophy. So, you know, I was self taught, and it was all print statements, you know, and I, you know, I could read it my way through a program and do print debugging the whole time. And when I found your book, it was very much like, Ah, this is the tooling that goes, that's, that's a step beyond this, and to learn the debugger. And you know, that it's just like a whole new power tool that you've, you've gotten it right. So it really did. It really did change.

Will Vincent 13:15
I wish you it's a program updated. I wish there was a modern definitive testing book. I mean, Adam Johnson has his, you know, he's gonna step beyond with, you know, speed up your Django tests. But I think there's still a spot for fully testing a Django project. If I did more Django books, I would do one on that. But it's a big, yours is the only book on it. It's a big topic. Yeah. It's like we're in a big commitment.

Karen Tracey 13:38
Yeah. I wrote that when I didn't have a job. So it was I mean, I was full time working on that when I did it. Well, what was I doing then? I was doing that I was, I was writing crossword puzzle those helping out on Django, users, I had to answer a lot of questions. You know, helping out with Django. And I, I use a volunteer to Cat Rescue, and I have, we track the cats in a Django database. So I was I wasn't full time on the book. But I was spending a lot of time writing the book. And I just can't conceive of doing a writing a book or even revising a book. With a full time job in the rescue.

Will Vincent 14:25
It's nice just every eight months, it's not a big deal.

Karen Tracey 14:29
Priorities. Yeah, there's just so much I would like to do that. I don't have time for Yes.

Will Vincent 14:39
Carlton, you have your decision?

Carlton Gibson 14:43
Well, I would so then. Okay, so you're using Django, you're you said you get involved in you know, helping on Django users and then you got involved in helping with running the project itself and the board and think the DSF and things like that. Good. Talk about that. That part of it because

Will Vincent 14:58
yeah, when you hear horror stories of the early board, you know, what was what was it like back in the day? Ah,

Karen Tracey 15:03
it was trying to remember it was a long time ago. It was probably not very, I got I don't know what it's like now, because I'm not on the board. But we dealt with requests for aid. I'm sure you've seen a lot of that of people asking for grants for this, that and the other thing. I think we did the around then was when we were working on getting the trademark and agreements finalized. And we had a lot of issues and back and forth with getting, how do we affordably get legal advice?

Will Vincent 15:45
That's still an issue. Yep.

Karen Tracey 15:47
still an issue. And accounting, accounting help. And funding? I think I, I think Django is in a better position now than it was then with getting funding

Will Vincent 16:07
woman. This is all pre fellows to because this is

Karen Tracey 16:11
pre fellows pre technical board pre. I mean, this was still back when there was the core team.

Will Vincent 16:17
Well, so what was the funding for? I mean, the servers, I mean, how I guess, how was how was it being used? I mean, I guess sponsoring conferences and stuff, or

Karen Tracey 16:28
I think it was primarily for sponsoring Django Girls events, those kinds of things that was needed for, we didn't have the fellows then. But there were, there was a sense that something was needed to make Django sustainable. A self sustaining organization. Like the fellows, because as an all volunteer organization, not funded by a big company, it's like, people situations change, their interests change. They, you can't, Django couldn't continue, if it was going to be the focus of, you know, just the core group of people working on it forever, that just wasn't gonna work.

Carlton Gibson 17:12
I mean, so play, as you know, I working in a fellow role, one thing that comes up is, it's the sheer amount of new tickets that come in, that's the main issue. So if you're a volunteer, open source contributor, you know, working on your patch, working on your thing, doing a little bit of, you know, new ticket comes in, but it's like this, this firehose of ticket reports and Marrison. I just spending the whole time, you know, paddling upstream against it, that's fine, because we were contracted to do that. But that's not sustainable for a volunteer, contributor at all.

Karen Tracey 17:49
Yeah, that was the kind of thing that I like to do when I was involved in an answer questions on the mailing list. Look at every ticket that comes in, is this valid, not valid, point them in the right direction? That kind of thing? And yeah, I can imagine it's even worse now than it was then.

Carlton Gibson 18:06
I see, I see lots of, you know, lots of comments from you in tracks, we still use the old track. And you know, there's every so often it comes up, why aren't we using GitHub? GitHub issues? You know, why don't we move that it'd be more accessible, perhaps because the tracks, a bit clunky. But I think the ultimate reason is that the history there, you know, there'll be discussions featuring you and others that really explain why it is that the frameworks the way it is, and if we just move to a different issue tracker, that knowledge is lost, and

Karen Tracey 18:35
unless you can import it, yeah. Which probably, I think the thing that kept us off of GitHub issues way back when we move from SVN.

Will Vincent 18:48
Yeah, SVN

Karen Tracey 18:51
was the ability I made, I don't know that this is changed, like anyone could create an issue or do something and track and move something along, or, or change the state or whatever. And we didn't have that capability in Git with GitHub issues, it didn't seem like

Carlton Gibson 19:07
to be honest, it still doesn't really have the level of project management, knobs and buttons that the tracks got. And so okay, it's difficult to learn the track, but it is very powerful in it. Yeah. The triage pipeline

Karen Tracey 19:21
has a lot of history there now, yes. why things are the way they are?

Will Vincent 19:27
Can I ask with your specific to the testing book? So you came to Django and Python with testing program experience in other areas? What how did that seem to you the the Python, Django approach or the tools, you know, then and now since you still use Django, like, what do you what are your takeaways like if you sat at 30,000 feet looking at like the pros and cons of the sort of Python Django approach to testing?

Karen Tracey 19:51
I don't know that I actually had a whole lot of experience with automated testing before I before I came Django back when back in the day of working for IBM, the testing we did was manual. Like there was a whole test organization, you'd throw your code over the wall to test and test would come back with with issues, we didn't do a whole lot of automated testing, in my experience. So my experience really is with Django. And actually, before I wrote the book, I was not big into testing for my own projects, Oh, yeah. Yeah, like because such a hassle. Django itself had the test suite. And I was involved in maintaining Django and I, I understood how to, I understood the value of Django as tests. And that sort of taught me that the reason you want a test suite is to be able to make changes and have confidence that you haven't broken anything. Whereas a lot of people, I think, come to testing thinking, particularly when you're writing feature, and part of it is supposed to be tests like to prove that your your code works. And that's not really the goal is more to make your code maintainable. Meaning someone else can change it later. And your tests will indicate to them whether or not what they've done is having some unexpected side effect of breaking, previously held assumptions. So my learning of my my learning of Django and writing that book was a lot of learning about how to test or the value of testing,

Will Vincent 21:39
I think that's the best mode in which to write a book is while you're learning and mastering it, because you'd have empathy for a reader in a way that later on, you have to work harder to get, like, just do it. It's obvious, right? Why doesn't

Carlton Gibson 21:55
there's there's one thing that you cover quite deeply in the book, which is kind of dropped away, which is Doc tests, which is this, this brilliant thing that Python has, where you can write a doc string, and if you put a little terminal snippet in, it will run the terminals, you can run it as a doctor's note will run the terminal snippet. And tell you if that didn't work, or if the output wasn't correct. I was wondering what, you know, if you like come sometime shed a tear for the lock at loss of Doc tests. So you think, anyway, of rescuing those from the, from the graveyard?

Karen Tracey 22:27
Kind of? I did. I wrote that whole chapter. I did include them. I mean, back when I was writing the book doc tests and unit tests were sort of on equal footing. They weren't there were not. There wasn't then a sense that Doc tests were going to be eliminated as they were eventually. But I did I did find the unit test framework much more powerful, I think. And just from a, I think, from a maintaining the tests point of view, I think they're easier unit tests and Doc tests. I didn't ever get into writing a lot of Doc tests in my own code. I think I did get some feedback that I downplayed them a bit too much. And I

Carlton Gibson 23:17
sometimes wonder if they might. One complaint about comments is they always get out of date. I wonder if there's some sort of Yeah, literate program in Doctor style mash up where you can use the doc tests to ensure that your comments stayed up to date.

Karen Tracey 23:34
Yeah, that's true. That is a big problem with comments is that they get out of date. Yeah, Doc tests. I do kind of regret that they're entirely gone. I mean, I think they do have a place. They could have a place. They don't have a place anymore. But there was a crusade to get rid of at some point. And they're all gone. Now there. Was

Carlton Gibson 23:56
he upset someone?

Karen Tracey 23:58
Yeah. And I don't I don't say I don't know that I really understood why they were so rigorously removed. Like, I think they could have they could have continued. I think there was a place for them, but Okay, fair enough.

Will Vincent 24:17
So, cactus group, you've been there. I think going on about 12 years. Now. I'd love to hear about projects you've you've worked on, you know, this is about as much as anything real world stories of Django and you know, interesting things that you've thrown Django at and how that how that worked or didn't work. I'm sure you have many to choose from. So that's that's a big question. Yeah, there's lots. What's the life of a jobbing developer is Carlton would say

Karen Tracey 24:44
Java over

Will Vincent 24:47
right. That's the phrase Carlton? Yeah, no, exactly.

Carlton Gibson 24:49
You're joking, joking development and not just

Will Vincent 24:51
like, you know, for fun or like a book writing developer like a jobbing developer like getting paid by a player. Yeah.

Karen Tracey 24:58
So I started with cactus Like it was really small and it got bigger, and then it got smaller and bigger. But we've worked for we've worked with various projects over the years, and I really enjoy the direct contact with people who are gonna use the software. Or that was, that's the primary thing that I really enjoy over like working for IBM, where it's a small cog in this huge, huge wheel. And you don't really understand why you're building what you're building or hear from marketing, they need these features. Now, that doesn't make any sense. I don't understand that. Like, I really like the direct interaction with clients who are going to be we're using the projects over the years, and we've I've worked on smaller, bigger. There's one that's still that it's probably I think it's out on the website as a case study the survey for schools school surveys, we've it's a tool that's used to administer surveys to

Will Vincent 26:14
in Chicago State of Illinois. Yeah, yeah, there's a there's a case study. So I'll put that in the notes. Yeah,

Karen Tracey 26:19
yeah. So that, that is still running. And actually, the, I believe the Illinois School survey starts today. So that that's a funny project. And that it, the website associated with that goes from needing 24 web servers a day, to not being used at all, depending on the time of year. So over the summer, like it's completely dead, you could turn it off, and no one would know. Whereas this time of year, when schools are in session, there may be surveys running for the State of Illinois, Chicago, public schools, other places. So it's, that's an interesting project in the the periodicity of it, and having a set time where like, you could make massive major changes and, and get it all done, and not have to worry about migrating the data, because, you know, the data for the last year gets purged in the new year, you start completely fresh. So it's kind of an interesting, different sort of thing from a website, where you're, it's always up, and you need to, you need to maintain the data all the time, and it's always got traffic, and you need to be aware of that. So there's all sorts of different projects, some are small,

Carlton Gibson 27:40
just ask about the scale, I mean, GG, deploy that in a kind of traditional way, you know, servers, and, you know, one dB server, various servers in front

Karen Tracey 27:50
that has, that has an environment has at least two, at least two web servers running all the time, there are at least two database servers, a master or a primary and one read replica. Cache worker server for salary, rabbit stuff, so there's at least I think, five minimum servers they'd set up with, it's on AWS, it's got an Auto Scaling group, and set up to auto scale based on CPU of the web servers.

Carlton Gibson 28:30
And that handles that that flux between that smaller setup, and then you know, the peak demand for

Karen Tracey 28:37
Yeah, when it is in ag, when we know it's going to be an active use. And the traffic for this particular case of the entire state of Illinois starts surveys, you know, school starts at 8am, and the class is going to come in, you're going to get

Will Vincent 28:56
a massive millions of students, right, like a couple million,

Karen Tracey 29:00
you're going to get a massive influx at a particular time, we did find that the auto scaling could lag. So we usually set it up so that instead of so there's a scheduled action at the beginning of the day to bring up at least six servers, which allows for enough time to get everything up. If it needs 24 Like it doesn't, it doesn't fall off a cliff before it adjust to the fact that you've got that much server so we do have some time to actions that bring up a minimum that increase the minimum capacity at the beginning of the day. And then let it then let the auto scaling based on the CPU handle it during the day.

Carlton Gibson 29:44
Okay, and then I wondered that super, I wondered about whether your your original work on microkernels and client, you know, the relationship between mainframes and personal computers where that ties back into this sort of containerization and cubic cubing. Are these things microkernels is a is a hot phrase, right? And I wonder if you have thoughts in it, I'm sort of half being silly, but

Karen Tracey 30:10
I have. So there are so many aspects of web from deployment to, you know, configuration management of the servers deployment, the web framework itself, the front end, the JavaScript, my folk, my, my, my Desire to Learn More is more on the front end. That then on the there is a huge amount of Kubernetes interest at at Cactus and most of our current projects are deployed using Kubernetes, this older project is not using Kubernetes. And I don't know that we will ever move it to Kubernetes. But for the most part with Kubernetes, I'm like, okay, all that complexity, y'all figure that out? And give me the give me the commands to run or set up? DevOps.

Carlton Gibson 31:05
Okay, super. So could I ask them, which are the bits of front end that you find most interesting, most exciting, you know, in the in

Karen Tracey 31:15
the user, as I would like, to learn more about how to effectively design user interfaces that are a joy for people to use versus not? Okay, is what a lot of websites are not a joy to use. I'm excited about we're starting to experiment with HTML. I was

Will Vincent 31:39
gonna ask you about that. We have to ask it in every episode now. But we just, yeah, the last couple episodes, we spoke to some folks from Berkeley using htm X. And yeah, so wait, wait, what are your experiences with it?

Karen Tracey 31:51
We're just starting to use it. I, it's interesting to me, like it's, it's just replaced this part of a page sort of focus. If you go back to that, that survey thing we wrote the the survey taking part of it is all a single page. And when you press next, it just replaces that part, the question part of the page and submits the answers and replaces that. It was a requirement of the the original specifications that it not say that, you know, you're on page 80, and the URL not change as you progress through the survey, you're not supposed to see the page number you're on and reflected in the URL. So that was sort of dictated by the specifications, but it was required writing, you know, little JavaScript to do that. And it's cool that htm X would make that a whole lot easier to do. I like it. i There were several Django con talks about HTML x, it seemed like or the

Will Vincent 33:00
yeah, there's this year, there was, I think, three or several. Yeah,

Karen Tracey 33:04
I think there were three. And I found all of them interesting. I I do like approaches where you can take advantage of all the stuff that Django has forms authentication, so that you don't have to redo everything in the front end, do it twice. So I'm excited about HT Max, don't have a whole lot of experience with it yet have done like have added? What is it? The endless scroll pagination, where if you reveal the bottom of a list, it just pulls in more infinite scroll, I think it's very easy to do infinite scroll. It was very easy to do with HD MX.

Carlton Gibson 33:48
I think that's one cool thing about it is none of us have got a whole lot of experience with it. But there's lots of people excited about it using me. And one thing for me that it really laid out when I first gave it a go was I was able to be I was able to do things that I haven't sort of been, quote unquote, allowed to do for, say, five, six years haven't been allowed to do it this way. You know, you can't do it that way. And as that but I can do it that way. And it's really speedier, and it's just using the basics, and Oh, wow. I kind of added No, wow.

Karen Tracey 34:18
Yeah, I think one of the things have not been involved in a heavy front end project, that use React or whatever I would like to learn more about using React for sophisticated user interfaces, what I'm what I don't know, what I'd really like to figure out is if I can, if we can figure out how to use Django forms, and not like recreate all of the validation that you can put in a Django form and have to do it in both the front end and the back end. I don't know if that's going to be possible. But

Carlton Gibson 34:53
there's a front end framework called Alpine which is a bit like base a bit like view but much simpler is it's sort of bad. uptake, the tailwind people, the reason I got into the tail when people said if you would be using jQuery, then we recommend Alpine, you know, we should definitely be so. And it's sort of like that, for that level up from HTML where you really want to keep the state on the client. And one trick I was able to use was to send the data as form data rather than as JSON. Because you know, just create form object and add the, you know, in JavaScript and send it and reuse them my formula in Django, and that was that that turned out to work really well.

Will Vincent 35:33
It sounds like a top Carlton.

Carlton Gibson 35:37
If there's ever a conference again, yeah.

Karen Tracey 35:39
Are you ever gonna get back in person?

Carlton Gibson 35:43
But yeah, so I mean, anyway, I think I think there's a there's a really fertile territory around here around this area.

Karen Tracey 35:52
I have to look into that.

Will Vincent 35:53
Can I ask again, about crosswords? Because you mentioned it, but I mean, you've had what over 100 published in the New York Times, I mean, it's not just a hobby for you. I would write I think, I think I saw that you have over you have a lot in the New York Times

Karen Tracey 36:07
100. Maybe total? Yeah, yeah. So that was in the time when I didn't have a job. I was doing crosswords. And I have not. That did continue. After I had a job. I had one editor I worked with who had a curated list of constructors that he was working with, for the I forget now where that was, but he so instead of doing freelance it was it was scheduled, you have a puzzle do and it will get published kind of thing. I have not been constructing crosswords now for a few years. So that sort of also fallen by the wayside of one of those things I'd like to get back to you sometime.

Will Vincent 36:48
Can I ask just what was your approach? Because I've seen, like some documentaries on crossword puzzles, and people make them differently, like, how do you how do you get all the fit together? I mean, it is a puzzle, right? Like what what was your approach,

Karen Tracey 37:00
um, I wrote my own crossword builder helper kind of crosshair builder program that helped me in writing and grid I focused on. So there's two different There's main. In American crossword puzzles, there's basically two different kinds. One has a themed crossword where the long entries all shares the right theme. And then there's themeless crosswords where the long entries are basically, there's no overriding theme to the puzzle, but the long entries are going to be interesting, there's usually fewer words in them, and I focus more on the themeless crossword puzzles. So there you would start with what are just some interesting words to have in a crossword puzzle. And interesting usually means unusual letters like Jays and Q's and x's and z's, you know, how many of those weird oddball letters could you pack into a puzzle? So you start by place, you start by with a thing, unless you start with one or two long entries, maybe that you want to pack into a puzzle, and then figure out how to place black squares, right? Following the rules of no feud, and you know, no, no word less than three letters and symmetry and how do you place black squares so that you are likely going to be able to fill it like you, you're not going to put a Q at the end of a word, like if you'd want to think about where where you're particularly where your special letters are, there may be some constraints on where you want, want the words to end and start and end. And then I would focus on the most constrained area of the grid and see what is possible to put in there and pick the best set and then move out to the left and by doing that you constrain you make another area of the grid more constrained? And then focus on that are you going to be able to fill that part of it? The the program, and other programs, my program and other programs would do autofill like here's a here's a set this fills

Will Vincent 39:23
a source of options or

Karen Tracey 39:26
it is like you can say it you know, just fill the grid and you see you got word lists and you could fill the grid and but you might look at that and say there's a lot of junk entries in there. You know, things that are three letter acronyms or abbreviations or Yes, stuff that is just not interesting.

Carlton Gibson 39:48
You've got an aesthetic unit standard to uphold here.

Karen Tracey 39:51
Yeah. Yeah. And it's not like you can in some cases, you might say well, Just remove those entries from your word list and just never include them. But then it's probably okay to have one or two of them in a grid. And just having them available makes it more possible to have something that is a great grid. So it's very hard to like you need to ideally, I guess maybe you could automate the whole thing if you could rank your word list or give assignments of weights value to the to the entries, but there's just, I mean, that's a huge task.

Will Vincent 40:32
And that becomes like a search problem, like,

Karen Tracey 40:35
yeah, it is a search problem, like what are the solutions to fill the grid? And what is the highest right?

Will Vincent 40:43
Score is

Karen Tracey 40:45
ranking you crosswords, that's going to be your best

Carlton Gibson 40:47
your crossword sort of the property then of the newspaper, which published them? Or could you put together a compilation?

Karen Tracey 40:55
They are the property of like the New York Times and the syndicates that I worked for that you sell the whole thing? Okay. So they appear in compilations of The New York Times crossword puzzle

Will Vincent 41:07
we have my wife loves them. So we have all those books. Yeah, one

Karen Tracey 41:11
of the editors, I worked with the New York Sun, he did create a compilation of my puzzles and another constructors, and turn that into a book that he did give us part of the royalties for. So depending on that outlet, you may have some ability to continue getting paid for it, but mostly you just sell it, and

Will Vincent 41:40
very cool. Very cool. Okay,

Carlton Gibson 41:42
I had one more kind of question about software defects. So we talked about, you know, your preference for front end to end working with creating you nice user ui, and that's something that you're interested in designing good UIs. And then we, we cut into HTML, and react and talking about those things. But I wonder if it do you think UI design is more for people? Is it software? Is it if it's more of a design thing? Right? It's it's not Oh, if I do it in this way,

Karen Tracey 42:12
me aware of people, I think there's definitely a technical aspect to it as well. I think all of software is more people oriented than is generally understood. Even just writing readable and maintainable software, like the person writing it today is not going to be the is not necessarily if it's going to be successful, it's not going to be the person maintaining it tomorrow. So just being aware that the code is not just for the computer, ever, is an important aspect of programming. Even if it is you maintaining it, yeah, cuz you're not the same. Right? You're not the same you. I mean, you I come back to code that was written years ago, or even just months ago. And I'm like, who wrote this? I did. But like, things change.

Carlton Gibson 43:16
If you're holding, you know, it takes time to load it into your your mind, right? You get into that that point where you're really holding the whole logical structure in your brain and to reload that can take? Yeah. Even if it was just yesterday. Yeah.

Will Vincent 43:33
Well, that that's my favorite programming quote of all time is Ryan Dahl, who created no JS. And he said, The only thing that matters is the experience of the user. Yeah, having just built node. So it's sort of a full circle, like, you know, because to your point about, you know, why is the UI that I'm, most my friends are non technical. So they'll be like, Oh, this website's terrible. Why is it terrible? And I usually say, because they don't care about you. You know, it's a it's a government website, or it's a corporation. It's not the focus. Yeah, it's like, it's bad, because you're going to struggle through it. But but you know, it is on the learning journey, right? Like, I got into software, cuz I want to build websites. And I was like, oh, some are good, some are bad. I didn't know why. And then I became enamored with the tools. But then, you know, at some point, you come back to well, tools or tools, they're not the end goal. And the end goal is making it better. And the two Carlton's question. That's a mix of psychology and then I think there is some hard truths around how do you actually make something navigatable for a user? I don't know where that line is, though. Sorry. I mean, watching someone right? Like that's, that's always my test for even startups or tech companies. Like let me get the CEO and see if you can go through the process for your main product, because I bet half the time you can't. Right, yeah. Especially.

Karen Tracey 44:53
Another thing you learn from building websites and having people use them is people Don't read.

Will Vincent 45:01
Not like my parents are like, no one reads and I mean, like novels. It's like no, they don't even like read read, they don't even read the error

Karen Tracey 45:07
message or they don't read. So to make it so that it's intuitive to use is very difficult, right?

Will Vincent 45:14
They turned like the Hulk, like ASAP and shut off all. All reasoning.

Karen Tracey 45:19
Why even notice it myself? Well, website and it doesn't do what I want I don't even bother to read the air and make it go away. If there's a pop up my initially I just make it go away I don't even want to read like why is there a pop up Get it Get rid of it that's not

Carlton Gibson 45:35
wrong squat you must never break the back button right? Because if you break the back side side of the window, yeah,

Will Vincent 45:42
well, that was done in the history of kind of UI stuff into it, which makes TurboTax I feel confident saying generally is an evil company. But when they were starting out, they're only measured was how fast can people file their taxes. And so they would go around to retirement communities, all these places, and they just rigorously were like, anything we can do to break, bring down the time. And they brought it down for I think, like 30 minutes to five minutes for these different sections. And it was just just put it in front of people and just see where they get stuck and you know, sit back and shut up. And that's kind of what it would it takes, right. Even a startup like startups I've worked at, you need to spend that time to go and watch real world users using it, because generally, they'll get stuck on things you didn't think of. Right? Like, we would always want to show a new feature at this education startup that we'd want to like go to classroom every week when in a classroom, we want to show off this new feature. And nine times I attend something else broke or was confusing. And we're like, oh, we need to focus on that, which we never thought of. But But it's, you know, putting in the time and it can feel like wasted time when you have a long queue of features and bugs. But ultimately, of course, you know, sitting with users and making like senior people sit with users, not just people who are told what to do make like the product manager make, like the CEO, sit there and watch a user struggle through generally kind of clicks, whatever you've been. Someone's been saying about the UI.

Karen Tracey 47:03
Yeah. Yeah, really understanding what the perspective of the people who are using it,

Will Vincent 47:11
which goes back to my point, like the UI is bad, because they don't care about you. Which, which I jokingly but also seriously, say to people, it's like, you know, right, a consumer or enterprise product, you will hunt for that button, because there's money involved to consumer product. If it's not right there, you won't. So something that's free, the UI is always going to be better than pick a company to rag on into it.

Karen Tracey 47:38
Yeah, I don't know if it's they don't care about your that they don't have the they're, the programmers don't have the knowledge of your perspective. Like, whenever there's a long chain of of things in between the end user and the person writing the code. I fear there's a there's a loss of context and understanding around what what is required, what is needed, what would make it good.

Will Vincent 48:06
What, from you, I sorry, I just say I can give your quote to you, Carlton, which is separate from UI, all production code is just, like just barely good enough to work, you know, no more

Carlton Gibson 48:18
than so you've you've interrupted to say, what was it exactly gonna say? The budget often isn't there for the developer to spend time building the UI at all, you know, we got the database working and we got it. So we got to format the form just about takes the data the unit tests passed. Can I actually make the fall? Nice, no, no move on now the and that kind of really bare bones development environment, Armen is quite frequent, I think.

Karen Tracey 48:48
Yeah, the focus is often on. We need this to do this. And if it can do that task,

Will Vincent 48:56
right, he hits the spot.

Carlton Gibson 48:57
Yeah, he suspects on it off, you know, next project.

Karen Tracey 49:01
We have clients who have budgets, I mean, and then deadlines and we do the best we can

Carlton Gibson 49:08
think people are doing the best they can in this situation there are right

Will Vincent 49:11
well, we're almost out of time. Is there anything else we haven't asked you about or that you want to bring up while while you're on any other interests or projects or thanks so so Carlton and I doing this podcast regularly we know each other saying so that's why it's now it's sort of a game to like interrupt each other with those, like I kind of know each other nobody's gonna say you can probably guess what I'm gonna mutter. So it's like love like bingo between us to keep it interesting Carlton, right.

Carlton Gibson 49:40
You just like teasing weeks that repeat myself?

Will Vincent 49:43
What's it like? Well, you know it is it's because I have to edit these so I have to listen to them all to 3x Than you so I think that's why can I go up? Yeah. Anyways, well, Karen, thank you so much for taking the time to come on. I'm really want to have you

Karen Tracey 49:58
I hope I didn't babble too much.

Carlton Gibson 50:00
I'm not massively interesting, and I just love to chat to you and hear your story. And you know, again, thanks for everything you've done for Django. And thank you for your writing that book all that time ago, because, as I say, it really didn't make a massive difference to me. You know, I've still got it on the shelf.

Karen Tracey 50:16
Yeah, I think there are, I think it still has, I think one of the questions was, what's still true and what's different, I mean, the specifics and the details, the error message may be different. But the I think it tried to focus on doing things in small steps, and validating what you got and understanding when, like, I think one of them is breaking things on purpose, like, understand what it's going to do when things don't work, you know, so that you can understand what he's saying, when things don't work. And you don't know why it doesn't work, like

Will Vincent 50:48
none of the happy path coding.

Karen Tracey 50:52
Well, you can do the happy path coding, but then also, like, make it fail on purpose and make sure that, that it's showing you the right, you understand what it says when it's breaking what it means. So I think there's still stuff in there, that's valid. No, I don't know how it still stands, right it is to

Carlton Gibson 51:10
the only two chapters which don't like that sort of dated with the doc test chapter. And then the interface testing one because I think use a different framework than selenium and selenium became much bigger afterwards. So that, but the underlying principles, they're still account, but the rest of it is still kind of, basically up to date. 10. You know, this is one of the amazing things about Django is, you know, you've got a whole project, you fire up, you know, your own cascade, delete to your models, and it just sort of runs. And the same with your book is, you know, like, you explain the the debugging page, like the, you know, the chat, and that's still exactly the same, that's, you know, it's hardly changed in

Karen Tracey 51:50
people, people come in to Django and don't know, don't understand all of what you can get out of that page. Like, there's, there's a tendency to see the top and say, like, okay, it's broken, and hardly even read the error message and just go back to the code, like, you can actually dig in here and see why it's broken. And that can, that can make things a lot better in fixing whatever the underlying problem is, like, you don't have to go back to the code and just like know, it's broken somewhere, you can see it's broken, specific place because of these values and variables and stuff. Yeah,

Carlton Gibson 52:22
um, but inside that discussion, you also talk about reading a stack trace, and you know, and things like that. And it's like, this is just gold dust, to be honest, it's such as good book, and it's really stood the test of time, so I can keep flashing about it forever. I love it.

Karen Tracey 52:44
Are we gonna ever get back into like, in person conferences?

Carlton Gibson 52:48
I hope so. I hope so. I mean, I was thinking the other day like, I really miss Django con. You know, I just, I just had this moment. I'm

Karen Tracey 52:56
not a social person, but I miss having get togethers of people. Talk about random things. Of interest, it will come

Carlton Gibson 53:06
it will come. We just have to hold on until

Will Vincent 53:09
Karen, thank you again. We are at Jango chat.com, chat Django on Twitter. And we'll see everyone next time. Bye. Bye. Thanks.

Carlton Gibson 53:17
Join us next time. Bye bye