← Back to Show Notes

Transcript: Django Testing and Debugging - Karen Tracey

Will Vincent

Hello, welcome to another episode of Django Chat.

I'm Will Vincent, joined as ever by Carlton Gibson.

Hi, Carlton.

Hello, Will.

Will Vincent

And this episode, we're very pleased to have Karen Tracy from Cactus Group join us.

Hello, Karen.

Carlton Gibson

Hello.

Will Vincent

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.

Um 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

You're scaring me.

Will Vincent

Well, I mean, specifically, I'm thinking about the fact that you were on the DSF board back in the day and helped with some uh matters.

And um, Django's not that old, but it's been around for a while, and there's 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 you're doing today.

Um, but maybe we could start with you know your background.

I know you have a formal background and how you got how you slid down the slope of computer science into Django.

Karen Tracey

Yeah.

Um I started, I mean, I chose computing as a as a focus in college, so I'm more of a traditional came into programming and computing via school.

Um that was a long time ago now.

Um I think I was fortunate in the timing that uh I was getting into choosing a career back when personal computers were just coming out, the internet wasn't a thing yet, uh, 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 guy's thing.

I think I was fortunate in the timing that I didn't uh 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 uh this is something my family does.

Right.

So I think I was very fortunate there in how I got into it.

And um 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 um yeah, that's how I got into computing.

Carlton Gibson

Can I come the uh to the question that the thought, you know, but you said because I read an article a little while ago that said something like, you know, in the early days of um computer and computer science, computer engineering, there was um women were very much involved in that.

And then there was uh there came a sort of time where it it it switched.

I was wondering if you've if you've got a take on that.

Uh, you know, because it it seems, you know, now with Django Girls and the these initiatives we're trying to bring it back, but it's still very male dominated and I kind of wonder why.

Karen Tracey

If you look at the history of it early on, you know, before he was older than me, there were women involved in, you know, um rewiring, you know, back when in the days when you had to unplug and plug wires into computers.

Women were involved, I think.

Yeah, I don't know, I I wasn't I don't I'm not a historian, I don't know the 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.

Yeah, okay.

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 the marketing was all targeted at boys.

Right.

And it it became much more of a this is a a boy thing, and that 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

Well, I I thought it was yeah, I 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 called them computers, like because they were the computing before they had so there's a long obviously history of that.

Um 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 a little more menial, which I think is inaccurate, but it was very, you know, more detail focused.

Um who's I guess who's to say, but it's a sh it's a shame.

Um it doesn't make any sense to me from an objective point of view why that would be the case.

Karen Tracey

No, me neither.

Will Vincent

Anyway, so you had the background, you went into um computing.

So what was I don't know what 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

Oh, well, back in school, let's see, the first thing we learned was Fortran, then we did Pascal, then 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.

Because I uh I got involved in a research lab at Notre Dame, and that's what led me to to stay there and get a master's and a PhD, and we were doing um research into how mainframes and personal computers were gonna talk and interact with each other.

And we ended up uh 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 see.

So I had uh four good years of that was all I did was see pretty much.

So um

Will Vincent

so kids these days, right, they just don't know what they're they're missing.

Karen Tracey

But I so uh over time, like when I would go back to I'm gonna jump around here, I guess.

I the 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.

Uh and I should try and see, you know, interview for interviews, make sure you could, you know, 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, my the language I gravitated to do things in, even though I hadn't used it in decades, was C, which I found interesting.

Um I did use

Will Vincent

I was gonna say, was that like, you know, so you have all this experience in a PhD, but can you reverse a linked list on a whiteboard?

Did you have to do all that?

Karen Tracey

I did not.

Well, I did interview a couple of times with Google and those were days of yeah, pretty much whiteboard coding.

Um and I'm very grateful now that I did not get a job with Google because I don't think I would have enjoyed it particularly.

Cactus didn't have that kind of interview.

Will Vincent

So is Cactus what you ended up you went directly to to Cactus after um Yes.

Okay.

Will Vincent

Um that was right when it started, right?

Because we we we we've had them on and

Karen Tracey

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 the co-working space.

Um I that was I joined in 2010.

I think they were a couple of years old at that point.

Yeah.

Will Vincent

Okay, so

Carlton Gibson

go on, and that but that would be about the time when you wrote your book.

So and the reason I meant uh jumped to your book is because it's massively influential when I for me when I was picking up Django, because I needed I had the sort of introductory material, and then I had you know your testing and debugging book, which was like

Karen Tracey

my book?

Carlton Gibson

Yeah, yeah, yeah.

No, I mean it was as

influential to you.

Carlton Gibson

Yeah, you know, really like I've still got it.

All the other

Carlton Gibson

all the other books have gone, you know.

I don't need that anymore.

Carlton Gibson

I don't know.

I've still got your book, and it it's like you know, it it's you know, um the unit testing framework, doc tests, um, the debugger, you know, you know, print logging.

Log logging, you know, is such a hard thing to pick up and such a hard thing to get right in Python.

And then your book was just like, you know, walked through in such a good way.

So, you know, that's one of the reasons why I'm super excited to have you because it's like, wow, Karen, she wrote that book.

Karen Tracey

Honestly, I hate Python logging.

Yeah, no, it's so hard to configure properly.

Yeah, uh, so that was I it was after I had finished the book that I started working for Cactus.

Um so I got out of school, I went to work for IBM for about a decade, and 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 uh what got me to Django was I wanted a I wanted to be able to see my database of published puzzles from various um outlets, the 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, the the way I could see it in my crossword builder programs was little bits 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 the 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 to learn as was a cool language, and I knew very little about web protocols.

Um back in my IBM days, I knew like I knew we knew the I knew the details, the bits and bytes of the TCP protocol, IP protocol.

That was the level at which I were to the operating system, the middleware, um the web.

I didn't want to learn how to I 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.

Karen Tracey

Pretty much 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 I need to do.

Yeah.

So that that's really cool.

Carlton Gibson

That was what because that's the that's the philosophy, right?

Great docs and batteries included, and you know, 15 years into its lifetime, that's still what people say about, you know, we had um some folks on recently saying, you know, what you know, it's the docs.

It's the you know, it's the fact it got it's got everything with you.

Will Vincent

Can I just I just say I I 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 interview.

So kudos.

I love that.

It's like why should we hire you for Django?

Karen Tracey

It wasn't the definitive book then, because it barely come out, I think.

Will Vincent

Um but still, I mean, and just to take a moment, I wanted to add 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, like when problems hide, getting more information.

And then what was my favorite one is yeah, when the wheels fall off, like the Django debug page.

I love those things because you know it's it's hard to liven up a technical book.

Um, but anyways, no carlton you were gonna ask a question.

Carlton Gibson

I mean, I I didn't study computer science, so I studied philosophy.

So um, you know, I was self-taught and it it was all print statements, you know.

And I, you know, I did I could reason my way through a program and I did I do print debugging the whole time.

And when I found your book, it was very much like ah bam, this is the tooling that goes that's that's a step beyond.

And so and to learn the debugger, and you know, that that's just like a whole new power tool that you've you've got and it really so it really did um you know, it really did change my programming.

Will Vincent

Update it.

I I wish there was a a modern definitive testing book.

I mean Adam Johnson has his, you know, he's gone a step beyond with you know, speed up your Django tests, but I think there's still a spot for fully testing a Django project.

Um if I did more Django books, I would do one on that.

Um, but it's a big yours is the only book on it.

It's a big topic, yeah.

It's like when it's a big commitment.

Will Vincent

Yeah.

Karen Tracey

Um 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.

Um well, what was I doing then?

I was doing that.

I was I was writing crossword puzzles, I was helping out on Django users, I'd answer a lot of questions, you know, helping out with Django.

Um and I I use I volunteered at Cat Rescue and I have uh we track the cats in a Django database.

Um so I was I wasn't full-time on the book, but I was spending a lot of time writing the book.

Um and I just can't conceive of doing uh writing a book or even revising a book with a full-time job in the rescue.

Will Vincent

It's just just every eight months, it's not a big deal.

Karen Tracey

Priorities.

Um yeah, there's just so much I would like to do that I don't have time for.

Carlton Gibson

Ah yes.

Well, I would so then okay, so you're using Django, you're you you you said you get involved in um you know helping on Django users, and then you got involved in helping with the running the project itself and the the board and thing, the DSF and things like that.

Can you talk about that um that part of it?

Will Vincent

Because yeah, I want to hear war stories of the early board, you know, what was what was it like back in the day?

Uh it was

Karen Tracey

I'm trying to remember, it was a long time ago.

It was probably not very I I don't know what it's like now because I'm not on the board, but we dealt with um requests for aid.

I'm sure you still do a lot of that of people asking for grants for this, that, and the other thing.

Um, I think we did the around then was when we were working on getting the trademark and agreement finalized.

Um, and we had a lot of issues and back and forth with getting how do we affordably get legal advice.

Will Vincent

That's still an issue, yep.

Karen Tracey

Still an issue.

Uh and accounting accounting help um and funding.

I think I s I susp I think Django is in a better position now than it was then with getting funding.

Will Vincent

Well, this is all pre-fellows too, because um This was

Karen Tracey

pre-fellows, pre-technical board, pre I mean this was still back when there was the core team.

Will Vincent

Well, so what was the funding for?

Um I mean I the servers, I mean how I guess how is how is it being used?

I mean, I guess sponsoring conferences and stuff or

Karen Tracey

I think it was primarily for sponsoring Django girls events, those kinds of things that was needed for.

Um we didn't have the fellows then, but there would there was a sense that something was needed to make Django sustainable, you know, a a self-sustaining organization.

Um like the fellows, because as an all-volunteer organization, not funded by a big company, it's like people's situations change, their interests change.

They you can't Django couldn't continue if it was gonna be the focus of you know, if just if the core group of people working on it forever, that just wasn't gonna uh work.

Carlton Gibson

I mean, so just play as you know, uh working in the fellow role, one thing that comes up is is it's it it's the sheer amount of new tickets that come in that's the the main issue.

So if you're a volunteer open source contributor, you know, working on your patch, working on the old thing, doing a little bit of you know, new ticket comes in, but it's like this this fire hose of ticket ticket reports, and Maris and I are just spending the whole time, you know, paddling upstream against it, and that's fine because we're we're contracted to do that, but that's not sustainable for a volunteer contributor at all.

Karen Tracey

Yeah, that was the kind of thing that I like to do when I was involved in it.

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

But I see I see lots of um, you know, lots of comments from you in track, because we still use the old track, and you know, there's every so often it comes up why aren't we using GitHub um GitHub issues?

You know, why don't we move that to be more accessible, perhaps, because the track's 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 um yeah, unless you can import it.

Karen Tracey

Yeah, which probably I think the thing that kept us off of GitHub issues way back when we moved from SVN.

Will Vincent

Yeah, SVN before

Git, I think.

Karen Tracey

Uh was the ability I may I don't know that this has changed.

Like anyone could create an issue or do something in 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

it's still to be honest, it still doesn't really have the the the the level of um project management knobs and buttons that the track's got.

And so okay, it's difficult to learn the track, but it is very powerful, you know, and it yeah the triage pipeline.

Karen Tracey

There's a lot of history there now.

Yeah, there is why things are the way they are.

Will Vincent

Ca can I ask with your specific to the testing book so you came to Django and Python with you know testing programm 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 what do you what are your takeaways like if you sat at 3000 feet looking at like the pros and cons of the sort of Python Django approach to testing?

Karen Tracey

I don't know that I actually had a whole lot of experience with automated testing before I before I came to 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 project.

Will Vincent

Oh for your yeah

Karen Tracey

yeah like 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's tests and 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 a 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 it's 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 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

Like just do it it's obvious right why doesn't

Carlton Gibson

there's there's one thing that you cover quite deeply in the book which is kind of dropped away which is doc tests um 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 doc test and it will run the terminal snippet and tell you if that didn't work or if the output wasn't correct.

I was wondering uh what you you know if you I come sometimes shed a tear for the loss of doc tests I wanna you think any way of rescuing those from the from the graveyard

Karen Tracey

I do 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 were they were not there wasn't then a sense that doc tests were going to be eliminated as they were e

ventually but I did I did find the unit test framework much more powerful I think um and just from a I think from a maintaining the tests point of view I think they're easier unit tests than doc tests.

I think I did get some feedback that I downplayed them a bit too much.

And I

Carlton Gibson

I sometimes wonder if they um it might because one complaint about comments is oh they always get out of date.

I wonder if there's some sort of literate program in doc test style mashup where you can use the doc tests to ensure that your comments stayed up to date

Karen Tracey

yeah that's true that that is a a big problem with comments is that they get out of date.

Uh 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 them at some point and they're all gone now.

Carlton Gibson

They obviously upset someone

Karen Tracey

yeah uh and I 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

um 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 a that's a a big question to there's lots.

What what what's the life of a jobbing developer is Carlton would say

Karen Tracey

life of a jobbing developer.

Will Vincent

Right?

That's the phrase Carlton yeah yeah

Carlton Gibson

yeah no exactly you're jobing jobbing developer then

Will Vincent

not not just like you know for fun or like a book writing developer like a jobbing developer like getting paid by an employer.

Yeah.

Karen Tracey

So I started with Cactus like it was really small and then it got bigger and then it got smaller and got bigger um 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 small cog

in this huge huge wheel and you don't really understand why you're building what you're building or you hear from marketing they need these features and you're like that doesn't make any sense.

I don't understand that like um I really like the direct interaction with clients who are going to be work using um the projects over the years and we've I've worked on smaller bigger um there's one that's we still got that uh it's probably I think it's out on the website as a case study the the survey for schools school surveys that we've um it's

a tool that's used to administer surveys to

Will Vincent

in Chicago state of Illinois yeah yeah there is a there's a case study so I'll put that in the notes yeah

Karen Tracey

yeah so that that is still running and actually the uh I believe the Illinois school survey starts today so that that's a funny project in 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 um so it's it's that's an interesting project in the the periodicity of it and the 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 and 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

Can I just ask about the scaling there I mean do you do deploy that in a kind of traditional way you know servers and you know a 1db server and various servers in front and that kind of thing

Karen Tracey

that has an environment has at least two web uh at least two web servers running all the time there are at least two database servers a master or a primary and a one read replica um cache wor

ker server for celery rabbit kind of stuff so there's at least I think five minimum servers that's set up with it's on AWS it's got an auto scaling group and it's set up to auto scale based on um CPU of the web servers.

Carlton Gibson

Okay, so and that handles that that flux between that smaller setup and then the you know the peak demand for you.

Karen Tracey

Yeah.

When it is in act when we know it's going to be in active use and the traffic for this particular case of the entire state of Illinois starts surveys, you know, school starts at 8 a.m.

and the class is going to come in, you're gonna get a massive influence.

You're gonna 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 students, right?

Like 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 fall off a cliff before it adjusts to the fact that you've got that much servers.

So we do have some timed actions that bring up a minimum that increase the minimum capacity at the beginning of the day.

Yeah, okay.

And then let it then let the auto-scaling based on CPU handle it during the day.

Carlton Gibson

Okay, and then I wondered, that's super.

I wondered about um whether your your original work on microkernels and client, you know, and the the the relations between mainframes and and personal computers, whether that ties back into this sort of containerization and Kubernetes things.

Microkernels is a is a hot phrase, right?

And that I wonder if you could have thoughts in that.

I'm sort of half being silly, but

Karen Tracey

I have so there are so many aspects of web from deployment to you know configuration management of the servers, deployment, the the web framework itself, the front end, the JavaScript.

My foc my my my desire to learn more is more on the front end uh that than on the there is a huge amount of Kubernetes interest at at uh cactus and um most of our current projects are deployed using Kubernetes.

This older project is not using Kubernetes.

Um 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 or set up the C.

Carlton Gibson

Yeah.

Okay, super.

So can I ask then which of the bits of front end that you you find most interesting, most exciting, you know, in the in the uh

Karen Tracey

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.

Karen Tracey

Which is what a lot of websites are not a joy to use.

Um I'm excited about we're starting to experiment with HTMX.

Will Vincent

I was gonna ask you about that.

We have to ask it in every episode now.

But we just we just yeah, the last couple episodes we spoke to some folks from Berkeley using HTMX and yeah.

So what what what are your experiences with it?

Karen Tracey

We're just starting to use it.

Um 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 um 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, you know, the the question part of the page, you know, 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, you know the URL not change as you progress through the survey.

You're not supposed to see the page number you're on in reflected in the URL.

So that was sort of dictated by the specifications, but it was it required writing, you know, a little JavaScript to do that.

And it's cool that HTMX would make that a whole lot easier to do.

I like it.

I there were several Django Khan talks about HTMX, it seemed like, or the JavaScript.

Will Vincent

Yeah, this this year there was I think three or then several.

Karen Tracey

Yeah, 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 the Django has, forms, authentication, so that you don't have to redo everything in the front end, do it twice.

Um, so I'm excited about HTMX.

Don't have a whole lot of experience with it yet.

Have done like have added what is it?

Um, the endless scroll pagination where if you reveal the bottom of a list, it just pulls in more.

Will Vincent

Infinite scroll, I think, right?

Karen Tracey

It's very easy to do.

Infinite scroll.

Um it was very easy to do with HTMX.

Carlton Gibson

Uh 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 and using it and being like, ah, yeah.

One thing for me that it really lit up 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 a quote unquote allowed to do for you know, say five, six years.

I haven't been allowed to do it this way, you know, you can't do it that way.

And I was like, but I can do it that way, and it's really speedy and it's just using the basics.

And oh wow.

I kind of had a no wow.

Karen Tracey

Um Yeah, I think one of the things I've not been involved in a heavy front-end project that used React or whatever.

I would like to you to learn more about uh 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.

Carlton Gibson

But well there's a front-end framework called um Alpine, which is a bit like based a bit like Vue, but much simpler, is it's sort of um uptake.

The the tailwind people, the reason I got into it, the tailwind people said if you if you would be using jQuery, then we recommend Alpine.

You know, we you should definitely be so and it's sort of like that that for that level up from HTMX where you really want to keep the state on the 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 you just create a form object and add that you know in JavaScript and then send it and reuse then my form layer in Django, and that was that that turned out to work really well.

Will Vincent

Um that sounds like a talk, Carlton.

Carlton Gibson

Oh if if there's ever a conference again, yeah.

Karen Tracey

Yeah, are we ever gonna get back to in-person conferences?

Carlton Gibson

But yeah, so I mean anyway, I think I think there's a there's a really um fertile territory around here, around this area.

Karen Tracey

Um I'll have to look into that.

Will Vincent

Can can I ask again about crosswords?

Because you mentioned it, but uh I mean you've had what over a hundred published in the New York Times.

I mean it's not just a hobby for you.

I would right.

I think I think I saw that you have over you have you have a lot in the New York Times.

Karen Tracey

I had a hundred maybe total published.

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 uh 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 due and it will get published kind of thing.

Um I have not been constructing crosswords now for a few years, so that's sort of also fallen by the wayside of life.

One of those things I'd like to get back to sometime.

Will Vincent

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 to fit together?

I mean, it is a puzzle, right?

Like what what was your approach?

Karen Tracey

Um, I wrote my own crossword builder helper kind of crossword builder program that uh helped me in writing a 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 share some theme, and then there's themeless crosswords where the long entries are basically there, there is 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 J's and Q's and X's and Z.

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 themeless, you'd 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.

Will Vincent

Right.

Karen Tracey

Following the rules of no few, you know, no no word less than three letters and symmetry, and how do you place black squares so that you 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 you 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 auto fill like here's a here's a set.

This fills it

Will Vincent

like a thesaurus kind of of options or

Karen Tracey

it is like you can say it you know just fill the grid and you see you've 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 yeah stuff that is just not interesting.

Carlton Gibson

You've got an aesthetic you know standard to uphold here.

Yeah.

Karen Tracey

Yeah.

And it it's not like you can I in some cases you might say well just remove those entries from your word list and just never include them but then it's it's probably okay to have one or two of them in a grid and just having them available makes it more possible to to have something that is a great grid.

So it it's very hard to like you need to I ideally I guess maybe you could automate the whole thing if you could rank your word list or give assignments value to the to the entries but there's just I mean that's a huge task.

Will Vincent

And then it becomes like a search problem like

Karen Tracey

yeah it is a search problem like what are the solutions to fill the grid and what is the highest

Will Vincent

rate score or the

Karen Tracey

highest ranking.

No your crosswords that's going to be your bestwords

Carlton Gibson

sort of the property then of the the newspaper which published them or could you put together a compilation and

Karen Tracey

you know they are the property of like the New York Times and the syndicates that I worked for that you sell the whole thing.

So they appear in compilations of the New York Times crossword puzzles.

Will Vincent

Yeah we have my wife loves them so we have all those books.

Karen Tracey

Yeah one of the editors I worked with the the New York Sun he did create a a compilation of um my puzzles and another constructor's and turned that into a book that he did give us part of the royalties for so depending on the outlet you may have some ability to continue getting paid for it but um mostly you just sell it and very

Will Vincent

cool very cool.

Carlton Gibson

Okay I I had one more kind of question about software development.

So we we talked about you know um your preference for front end and working with and creating you nice user UIs and that's something that you're interested in designing good UIs and then we we cut into HTMX and React and talking about those things but I wonder if do you think UI design is more of a people you know is it a software you know is it if it's more of a design thing right it's it's not oh if I do it in this right

Karen Tracey

to be aware of people I think

there's a definitely a technical aspect to it as well um 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 gonna 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.

Carlton Gibson

Yeah because you're not the same you right

Karen Tracey

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 I mean things change.

Carlton Gibson

If you're holding you know it takes time to load it into your your mind right like to you get into that that where you're really holding the whole logical structure in your brain and to to reload that can take you know yeah even if it was just yesterday

yeah well

Will Vincent

that that's my my favorite programming quote of all time is Ryan Dahl who created Node 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 bad I'm most of 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.

That's not the focus.

Will Vincent

Yeah it's like it's bad because you're gonna struggle through it but uh but you know it is on the learning journey right like I I got into software because I wanted 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 are tools they're not the end goal and the end goal is making it better and yeah to 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 navig

able for a user I don't know where that line is though.

Karen Tracey

It's hard.

Will Vincent

But 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

another thing you learn from building websites and and having people use them is people don't read.

Will Vincent

Not like my parents are like no one reads and they mean like novels it's like no they don't even like read read.

Karen Tracey

They don't even read the error message or they did don't read so to make it so that it's intuitive to use is very difficult.

Will Vincent

Right they turn it like the Hulk like ASAP and shut off all reasoning.

Well I even notice it myself when I'm using a website and it it doesn't do what I want I I don't even bother to read the error message make it go away.

Karen Tracey

If there's a pop-up my my initial reaction just make it go away I don't even want to read it's like why is there a pop-up get it get rid of it

Will Vincent

and that's not wrong

Carlton Gibson

that's why you must never break the back button right because if you break the back button that's it your sight's out the window

Will Vincent

yeah well that was um in the history of kind of UI stuff uh into it which makes TurboTax I feel confident saying generally is an evil company but when they were starting out their only measure was how fast can people file their taxes and so they would go around to retirement communities all these places and they just uh rigoro

usly were like anything we can do to break bring down the time and they brought it down from 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 what it takes right even at a startup like startups I've worked at you 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 was that we'd want to like go to a classroom every week when in a classroom we'd want to show off this new feature and nine times out of ten 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.

Yeah.

Karen Tracey

Yeah really understanding what the perspective of the people who are using it.

Will Vincent

Which goes back to my point like the UI is bad because they don't care about you.

Which I jokingly but also seriously say to people it's like you know right a consumer or a uh enterprise product you will hunt for that button because there's money involved the 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 I don't know pick a company to rag on into it.

Karen Tracey

Yeah I don't know if it's they don't care about you or they 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

Well and Carlton separate from UI sorry Carlton I just say I was going to give your quote to you Carlton which is that separate from UI all production code is just like just barely good enough to work.

Yeah but no more

Carlton Gibson

the so you've you've interrupted to say what I was exactly going to say is that you know the the budget often isn't there for the developer to spend time building the UI at all.

You know it's we got the database working and we got it served we got a form up the form just about takes the data the unit test passed oh can I actually make the form nice no no no move on the pro no and that kind of really bare bones development environment is quite frequent I think.

Karen Tracey

Yeah the focus is often on we need this to do this.

And if it can do that task then

it's done.

Carlton Gibson

Yeah yeah it hits the spec, sign it off you know next project.

Karen Tracey

We have clients who have budgets I mean and then deadlines and we do the best we can.

Carlton Gibson

I think people are doing the best they can in the situation they're at right

Will Vincent

well um 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 I

Karen Tracey

don't think so

Will Vincent

so Carlton and I doing this podcast regularly we know each other's sayings so that's why it's now it's sort of a game to like interrupt each other with those like I I kind of know with each other's I know what he'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

you just like teasing me because I repeat myself

Will Vincent

well so do I so do I well you know what it is it's because I have to edit these so I have to listen to them all 23x than you.

So I think that's why I'm like well yeah anyways well Karen thank you so much for taking the time to come on I'm really wanted to have you on dabble too much.

Carlton Gibson

M massively interesting and I I'd just love to chat to you and hear your story and you know again the 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 did make a massive difference to me and you know has I've still got it on the shelf.

Karen Tracey

Yeah I think there are I think it still has I think one of your questions was uh you know what's still true and what's different.

I mean the specifics and the details and 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 gonna do when things don't work you know so that you can understand what it's saying when things don't work and you don't know why it doesn't work.

Will Vincent

Like none of the happy path uh coding

Karen Tracey

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

Carlton Gibson

it still stands out how hard it is to the the the only two chapters which don't like that are sort of dated with the doc test chapter and then the um the interface testing one because I think you used a di a different framework than Selenium and Selenium became much bigger afterwards.

So that but the the underlying principles there still account but the rest of it is still kind of basically up to date.

And the same with your book is you know like you you you explain the um 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

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 a 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 and I was 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 no it's broken somewhere you can see it's broken in a specific place because of these values and variables and stuff.

Yeah.

Carlton Gibson

And m but inside that discussion you also taught about reading a stack trace and you know and things like that.

And it's like this it's just gold dust to be honest.

It's such a good book um and it's really stood the test of time so I I can I can keep um flushing about it forever.

I love it.

Karen Tracey

Hopefully are we gonna ever get back into like in-person conferences?

Carlton Gibson

Oh I hope so I hope so I mean I I was thinking the other day like I really miss Django cotton you know I just I just had this moment

Karen Tracey

I'm not a social person but I miss having get togethers of people to talk about random things of interest.

It will

Carlton Gibson

come it will come we just have to hold on until it does

Will Vincent

well Karen thank you again um we are at jangochhat.com chatjango on twitter and we'll see everyone next time bye

Carlton Gibson

bye thanks join us next time bye bye