Django Chat

Python Crash Course - Eric Matthes

Episode Summary

Eric is the author of Python Crash Course, the bestselling Python book in the world. We discuss his background as a high school teacher, attending PyCon for the first time, and his current projects.

Episode Notes

Episode Transcription

Will Vincent 0:06
Hello, and welcome to another episode of Django Chat, a weekly podcast on the Django web framework. I'm Will Vincent joined by Carlton Gibson. Hi, Carlton. Hello. And this week, we're joined by Eric Matthes. Welcome, Eric.

Eric Matthes 0:17
Good morning.

Will Vincent 0:18
So I wanted to have you on for a long time. You are most notably the author of Python Crash Course the best selling Python book in the world the last few years. But you also are involved with Python Django teaching. So there's a lot to dive into. And maybe we could start with how'd you get into programming.

Eric Matthes 0:35
I got into programming in the late 70s, early 80s. My dad was a programmer, and he had a computer in our house before anybody else had PCs, is a little kit computer in our basement. And so I learned basic learn basic because I watched my dad tap keys in the basement and it looked like magic. So I asked him how the magic worked and he showed me and I really appreciate that early Beginning, huh?

Will Vincent 1:01
And then you and you grew up in New Hampshire, I believe. Yes. I just asked because I'm from Vermont. So I I like people from our neck of the woods.

Eric Matthes 1:09
Yes. I always hear I always enjoy hearing. Where are you from stories? Because I think of us from Boston.

Will Vincent 1:14
Yeah. Well, not even technically, in Boston. I'm a town outside of Boston. But yeah, all this, you know, it's sort of like when I left New England, and I, people didn't necessarily always know where we're Boston, or where they didn't know where Vermont was like, say, you know, or if I went overseas, I would say it's, you know, in between Montreal and Boston, kind of somewhere in there. Right. Or you go outside the New England and, you know, no one has any idea which, you know, Vermont or New Hampshire, which is which, right? Why should they, even Virginia, anyways, sorry. So you so you got a young start and then, but there wasn't formal education for computer science back then. I don't think right.

Eric Matthes 1:51
Well, I feel rather fortunate. So my dad was a software engineer in the 70s. And so learning basic was nice. One of my clear memories was building a number guessing game when I was young. And what I remember from that I don't remember anything about the programming beyond like line numbers and go to. But I remember getting up from the computer, having my parents sit down and play the game that I'd written. And when it worked. I remember this feeling of creating something that other people could use. And that has been a satisfaction that I remember to this day. And so when I introduce other people to programming I have it's in a classroom, I enjoy watching them get to that point of their first program that works that other people can see in for readers. I love hearing their stories of the things that they build working.

Will Vincent 2:45
Yeah, I think of that as the aha moment if you can, yes, not just get that but periodically have those as your teaching concepts. Like it actually worked. Maybe I don't understand how it worked, but it actually worked and I can share it with someone. That's what keeps someone kind of engaged. On the long lonely quest of programming,

Eric Matthes 3:03
yeah, and if you do it right, um, you know, when I was teaching math and teaching problem solving, I tell people that it's a creative act. If you're going to solve a problem that you haven't solved before, you have to have some spark of an idea for how to approach that. So for programming, for anything, where people don't give you the characters to type in, you have to have some of that same intuition. And so that that first program that you wrote, no matter how small your part of it was, it working is validation and an encouragement for my programming, I grew up when logo was being introduced to schools. And so I think we had probably some apple apple twos or something in our elementary school classroom.

Unknown Speaker 3:47
So that

Eric Matthes 3:50
when I got to high school, I think I had computer science classes. I remember clearly, I'm in college, I went for a BS in physics. And so that was it. In the early 90s, and so we had to take a variety of programming classes, it was C, Fortran, Pascal. And I didn't do a whole lot with those. But I got a decent grounding and all those concepts of what a variable is how it interacts with the physical memory of a computer. And I'm grateful for weather, I'm very happy that people these days don't have to start with those lower level languages if they don't want to. But I am grateful for having had that early, early background in how all this is managed and structured within a programming language,

Will Vincent 4:36
when it must have helped a little bit that you'd already programmed beforehand with your dad and otherwise, because I mean, this is the currently I think the great divide in a undergraduate Computer Science program, let's call it half of students have programmed before and maybe they're just you know, used to be PHP or they're banging around with something but they've got those aha moments. They kind of have some context even though they don't really understand why. So when they do learn the fundamentals, it Things, click for them and connect in a way that if it's the very first time you're programming, you don't really understand why you're at that lower level. Yeah, I think you agree with that statement. But I've, I see that as you know, if you have that context, initially, it makes it easier. But also you have the perspective to understand why you would bother going through, you know, data structures or whatever class that you know, weeds out people first or second course at the undergraduate level.

Eric Matthes 5:27
Yeah, I am always careful offering opinions on this because I didn't go through

that. So, but no one on this podcast, this just have it.

But you know, I did. Okay, so I studied physics, and I got there because I had a chemistry class in high school that I really liked, had an AP chemistry class, and the teacher focused on how we think so I learned critical thinking really well from a really good chemistry teacher. And so when I got to college, I started out in chemical engineering, because I liked chemistry, and I thought, okay, I want to apply this. And I got to my chemical engineering class. And it was all about like, running nuclear power plants. And I thought I do not want to run a nuclear power plant or a petroleum plant. And I found that my, my intro physics classes were all about understanding how things work. So that was my first real understanding of the difference between engineering and pure science. And so the gatekeeper classes for that was calculus and intro physics. And so these were classes that I loved. I mean, I just loved math and science for just understanding the world. And I had the good fortune of having good teachers who were supportive and having a decent intuition for these subjects. But I, I was surprised I think when I got to college, to see how viscerally some people hate these subjects, and I started tutoring, and it's interesting to tutor has a 1920 year old because you end up a lot of people going to tutoring or people older than you. And that's a really interesting position to be in. And as I was tutoring, I found that people liked this subject, but they didn't like how it was being presented. And they didn't like the obstacle that it was putting up in their lives, what they really want us to do. And so I think there's a good parallel between that, that kind of gatekeeping in math and science and the same kind of thing we see in computer science programs.

Carlton Gibson 7:27
I had a similar experience teaching logic to undergraduates, there was this kind of in the philosophy department at the University, I went to that sort of intro to logic because, yeah, you know, you have to do Symbolic Logic. And half the students there were kind of maths background, you know, they really just plow through it. They've got 100% in the exam, and the other half were they're doing an arts degree and they had no interest in logic at all, and they didn't want to know anything about it. And you could see, you know, you try, if you missed if you lost one particular step, they'd sort of never recover and it was difficult to lose, fill in the building, block and It was really, but it was this two kinds of people there's like I'm turned off against. It's not ingrained. I hate it. And it's like, but it's fine. It's easy. It's, you know, it's easiest hundred percent you're never gonna get. Yeah, in a way

Eric Matthes 8:12
that it was? Well, I appreciate the question because I do have a clear thought. You know, I think the people who learn programming before they get to college before they get to a CS program, when they get to their CS classes, they get to focus on the CS concepts. And people who have not learned to program they have to sort out all the things that go into programming programming environment. compiling set up your computer, actually writing code and taking all this guess concepts with that.

Carlton Gibson 8:42
There's too much

Eric Matthes 8:43
that influenced my thinking around like, how would I design a high school Computer Science program? I think there's a temptation for a lot of high schools to try to imitate a college environment and jump right into CS concepts. And if I were to design a high school CS curriculum, I would focus on all the things you can do just as a programmer, all the things you can build all the problems you can solve and leave the hard CS to when people get to, to university.

Will Vincent 9:11
Yes. I mean, it's almost mystifying why that's not obvious to people. And I can only assume that it's some degree of It's been so long since they own that mindset, or, you know, they just, there's Yeah, I mean, it's like pre select, if you can grind through a computer science curriculum, curriculum, and you find it interesting. You've already checked a bunch of boxes. So maybe just never occurred to you that people would wonder, Well, why would I do this? Or what's the, you know, what's the benefit for all this? So, I mean, I know you feel the same way. Like I feel, you know, teaching this stuff that in many ways, it's a benefit that I have zero formal background, or even teach in a formal environment because I'm not limited by any of those things. And so there's a understanding of the scope. have knowledge, feel like you can attack it in so many different ways? And just as you said, like start with the why, and you know, make it engaging, don't drill it and kill it. And I, I don't really understand why that's not more clear to people in the system. But perhaps they've just they grew up with that system work for them, you know, it just sort of weeds out other lines of thought, or something. I don't know. It's a little surprising to me. But I think the high school level is where you can have the biggest impact you get to you get to the collegiate level, and people have PhDs and there's a sense of this is the body of curriculum you need to know to be a computer science graduate, but the high school level, it's all I mean, that's actually, you know, maybe you jump ahead. So you've taught high school for many, many years. And one thing as an outsider I found interesting is hearing about well, what would it take to teach computer science to every American because that's right in in Britain, Carlton, it's just like mandated as a couple years ago and maybe insane,

Carlton Gibson 10:54
right, but

Will Vincent 10:56
you're trying at least Yeah, yeah. That's the goal. The goal is that

Carlton Gibson 11:00
Generation on, people are computer literate in a way that currently I mean developers are and the rest of the population kind of up.

Will Vincent 11:08
Yeah. Well that at least for I said, That's not even on the spectrum of the American. I mean, no,

Carlton Gibson 11:12
not everyone's gonna be a compiler writer, right. But everyone's gonna be able to script it, you know, something like Python or JavaScript, we have the script help us something or other. That's what that's the goal.

Will Vincent 11:23
Right? I'm gonna tee this up for Eric, because I mean, obviously, you're the domain expert. But one thing I've been struck by is, even if we had an, you know, the perfect curriculum, and even if we had a workforce of, you know, high school, teachers, salaried programmers who knew this stuff, there's still the issue of, well, we already have an existing curriculum. It has to it doesn't count as an elective. Is it a science class in many states, it doesn't even count as a science class. So it has to count as an elective. And while private schools and wealthy public schools have a bunch of electives, a lot of traditional schools don't even have electives. So there's just all these variables around if you had a magic wand. It's not enough to have the workforce and the curriculum and the hardware, there's still all this political stuff that needs to get done. Just cram it in, because it's gonna take the place of, you know, something else. So anyways, I tee that up to you with decades of experience in the system.

Eric Matthes 12:17
You know, you're going to ask about my experiences at Python. And it's been pretty is pretty funny to get into the programming world more seriously. Enough to finish out that story of how I came to write a book and whatnot. Mid 2000s, I was doing some hobbyist programming projects, as I'd always done. And I was using Java at the time. And I had a friend who said, Hey, you should try Python. And this person was not a programmer, not a CS person. He is just another hobbyist. And he, the line he said was your your programs will be about 30% As long as your Java programs about a third as long as like, okay, I don't really want to learn another language, but I'll give it a try. And so I had that classic experience of those mid 2000s of writing my first Python program be like, Wow, this looks really weird. But it really is shorter. And it looks beautiful. And it works. And I really haven't touched other languages much since unless there was a very specific project focused need for that. And so, what really brought me into more of more professional focus on programming, to be really honest, as my father died in 2011, and this is a month after my son was born, and I live in Southeast Alaska. And my parents had never been up here. And they were about to to visit for the first time. And I sent it with a smile on my face now because enough time has passed that I've processed that pretty well. But my father being a programmer, when he died and I was With my mom, that first week, she asked me to go through his computer and see if there's anything worth keeping or to tell her about. And getting to go through his computer was a really hard experience, but really healing experience and connecting experience. One of my takeaways was seeing all these projects that he was working on, they would never see the light of day. And so I realized that if I died that day, you go through my computer and find all kinds of unfinished projects that nobody ever saw any benefit from. And so that was a really transitional experience for me. And it made me start to focus on rather than doing a bunch of little hobbyist projects, which are totally fun, because you're always starting a new project and not taking it to all the hard work of polishing and making it presentable for others. I really started to prioritize having all these skills that I've picked up over decades of having the opportunity to learn a variety of things. What can I build that would be meaningful to other people. can I build that with help others. And so I started looking at how to address problems in education. And so that's what led me to Python. Because as a teacher at a small school, I get to go to conferences and bring things back to our school. And so when they said, Well, what would you like to go to, is actually like to go to a programming conference and see what I can pick up. Because most of us go to education conferences, and so is different decoder programming, a programming conference, and I was so intimidated, because I thought a programming conference will be a bunch of people who have spent their whole life programming and will look at me and say, What have you done. And that very first night at the hotel, waiting for Python to start the next day. I just went down and had dinner and ended up in random conversations with Python people and found that wow, half of the people are just like me. They've done other things. They want to use programming to solve problems and half of People are programmers first who are looking for what kind of problems they should use their programming skills to address.

Will Vincent 16:07
I found that but yeah, Python was interesting in that it was less pros than like Django con like Django con smaller. But I guess if you're already a Django, you're a little bit higher, whereas Python, I was also surprised it was a lot of people who are kind of interested in Python as opposed to professionally using it. Sorry to interrupt.

Eric Matthes 16:23
Oh, that's quite right, you should interrupt me.

But that first year is 2012. And Paul Graham, from Hacker News was the keynote. And his focus was like 10, hard problems that people should solve. And one of them was like University computer science. And somebody got up at the end and said, Well, what about high school, computer science? And he said, don't touch. k 12. Education is too hard. And that made me laugh. It also made me rage and say like these things can be addressed. So I think that when we when we talk about things like high school computer science curriculum in particular is just A huge I care from trying to be careful about words is a huge mess of things to heartwood cluster. Yeah, well, it's a huge mess of factors. You have salary issues, anybody who can do put together and implement a good CS program can probably go make two or three times as much money doing something else. It's a lot of work to manage teaching and stay on top of current technologies. Yeah, and then you have to look whether you have political support within your school within your school system, your state and then the country. So that that's a lot to untangle.

Will Vincent 17:42
So were you teaching programming at your high school when you went to the Python, are you yet or not? Yes,

Eric Matthes 17:48
yes. Um, I have been I was teaching for the last 15 years. Yeah, almost 20 years at a school of about 30 to 40 students. And so there's about 10,000 people in my town. And I was teaching at a small alternative school. And so we had three teachers. And so I would teach an intro programming class each fall if I could. And I couldn't always justify paying it into the curriculum. But it was a really interesting chance to explore how you can teach computer science to people. Yeah.

Will Vincent 18:29
And it was always Python that when you were teaching, yes, it was after you discovered Python.

Eric Matthes 18:34
I started that around 2008. So I had started using Python at that point. And I firmly believe Python is the best first language for people who don't necessarily want a CS

Carlton Gibson 18:48
background what you said before about not focusing on the CS concepts, but focusing right and using the programming skills Ray and I think you'll Can you say more on that? Because I think that that's the gold juice, right is if you could learn to do all these things, just piecing stuff together. Yeah, you don't get the fluency to take on the harder concepts.

Eric Matthes 19:12
Right. So okay, so where did Python Crash Course come from? So I went back to Python in 2013. So I spent a year just kind of taking in like, wow, okay, I could really do something with programming. I started working on some projects to address any efficiencies in education. And there are a lot of them. still ongoing? Yeah. So 2013, I gave a lightning talk about some of the ideas I had for how we could build some open tools to address problems and infrastructural problems in education. And a good part of that was around the concept that in the 70s or so, computer scientists got together and said, we're going to open source and things like text editors, like Emacs and vim are 40 years old now. And that's because I my take on that is people at the time said there are more interesting problems to compete on than building a good text editor. And so people open sourced those. And they've been maintained ever since. And those are dedicated tools. So if you're a programmer and you're in a text editor all day long, or ID, so you want any efficient tool, and if he's looking at teachers, and ask most teachers, how do you build your lesson plans, they're still in Word documents. And if they're not in Word documents, they're in some proprietary software that they're forced to use by their school or district. And so when people move on, all that work of their life's lesson plans is either mired in thousands of Word documents that you cannot do anything with, or proprietary system they lose access to or becomes obsolete. So I just gave a short pitch about How we take, we could take the open source principles and the to the true principles of access and rights modification and things like that not just free and build some some infrastructure. And so I gotta, I gotta cheer. And it's so intimidating to give a lightning talk at a conference with 1500 people and everybody's looking at their phones and laptops. And as a teacher, having 1500 people looking at phones and laptops while you're talking is really hard. But at one point, it said something to the effect of proprietary software will never create a revolution in education, in which people looked up and give a little cheer. Ding ding ding. Yeah. So Bill Pollock is the the owner of no starch press, and he is the audience and he came up afterwards and says something along the lines of my kid is bored in school, occasionally, and I hope you build what you're describing. And if you want write a book. Here's my card. And so I was not looking to write a book, because I wanted to build these these tools for education. But I went back to my classroom and I had been teaching programming. And I had a list on my wall in my classroom. The title of that list was what's the least you need to know about edge about programming in order to do interesting projects. And that list was the first half of Python Crash Course.

And I had been trying to

give students resources where they wouldn't be depending on me, to guide them through. Learn to program because I recognize that, you know, many students can learn at their own pace. But all the resources like resources I could find around them 2012 2013 they just made too many assumptions about what you already know. Things like how to use a computer, how to find hidden files, how to set up a programming environment, any number of things there are just too many assumptions so that even Well, my students couldn't do it as independently as I'd hoped they got through because I was there to teach them. But I recognized that they couldn't use these resources independently. And so that's where the, the the core structure of Python Crash Course came from making no assumptions about what people know. But also speaking to them as mature learners. Because the other resource that was available back then were Python for kids kind of books.

Will Vincent 23:31
One of the things I love about your book is the structure because I think about this a lot teaching and specifically that most most books still most Python books. I view it as what how do you teach someone their first language versus their third or fourth, third or fourth? You say, okay, we you understand, there's basic datatypes boom, let me dryly go through the list. Here's variables. Here's how you do functions. Here's how you do classes. And it's so tempting to teach it to a fellow programmer. That way, because that's how you would when you're on language, whatever. But for that first language like you and your book, you don't like you go to list right away, like you're not as dryly in that bucket of like, here's the data types. Here's the data structures, which, which I love. And I realized it's actually quite difficult to do when you know those things, because that's kind of probably how you learned it coming from Java. Yet, obviously, you had the experience of years of teaching it to normal people, where they don't give a toss about, like, what's a string, I don't know what a string is. So I love that you did that. And I aspire to do similar things to not just be wedded to, this is how I would teach it to an experienced person, but this is how it you know, Django? How do you teach Django to someone who has never done web development? A lot. You know, a lot of times there's an assumption that historically they came from PHP, they come from something else, but a lot of people it's their first time. So anyway, so I love that your structure is that I think it's actually quite challenging to do that. Well, because there's questions about like, when D functions come to they come before lists, are they you know, so I'm impressed by how you did that. And I'm curious about the thought of how that developed because I don't I know it wasn't an accident.

Eric Matthes 25:05
Yeah, yeah. It ties back to Carlton's question about

what do we teach people? What was going to grab them? Why did what do we want to show people who say I want to learn programming, but I don't know that I want to be a computer scientist. I look at why people want Why would a heist random high school student wants to learn programming, if they don't know they want to be a programmer is to do interesting things. And so when I looked at what my students wanted to be able to do, it tended to come down to something to do with games. People don't often think this but a lot of students are interested in data at a high school age, because they're trying to sort out their lives. And so things like how much money will I make from this job? What area of the country should I move to or the world That's safe, that has a good balance of life. People are impacted by health issues, poverty issues, crime issues. That information is really, really compelling. So to so far games, data science, and then a third is apps that everybody wants to build an app or know how they're built. And so in the Python world, that is Django and Well, I've appreciated your posts around flask or Django.

Will Vincent 26:29
It's, you know, I was told a bunch of people, you know, behind the scenes said, You're brave to wade into those waters.

Eric Matthes 26:34
Yes, yes. It needs to be weighted into because there's a lot of assumptions on on those questions. So, you know, Python Crash Course. I wanted to, I've always wanted to take people from an understanding of the fundamentals of programming, to how do I make my own projects, and so the guiding question for craft For Python Crash Course was was the least I need to know, in order to do these projects? So every time I had a question about Should I present this aspect of Python? Should I teach lists? Yes. Because you need them for any interesting project you're going to do. Should I teach dictionaries? Yes. Because you need to know that. Should I teach generators? No, because you can get away with lists for a long time. So that that was the the cutting floor question for what to leave in what to

Will Vincent 27:30
what to let fall to the floor. You know, I think it takes a certain amount of, I mean, certain expertise and confidence to leave stuff out. Because especially as a programmer, there's always a sense of, well, I don't want to not cover this thing. But if you cover it sloppily, you lose the reader. Or you're not curating it for them because they can go read Python. org if they're so inclined. Right?

Eric Matthes 27:51
Right. He had a thick classic. Oh, you don't need a book has all the information is online. Yes. If you get it right through it,

Carlton Gibson 27:57
you can go to you can open up The Python tutorial. It's not it's not a tutorial, right? That's exactly Will's case. You know, you already know two or three languages you, you know, you can read about the datatype. It's not, it's not how to program. It's not how to use Python.

Will Vincent 28:12
Well, I always ask people who say like some, some version of like, such and such as easy, like, everyone knows how to do that, uh, like, go find a random person with a new computer and have them install Python. Yeah, I 99 out of 100. They're not going to get all the way through. It's a Mac, even if they like, between installing it properly. Path virtual environments. It's, you know, so I think if people actually do that, they go, Oh, wow, like even that step, right? Because there's so many things like we as developers, like even my computer now, like, I am sort of like a if I had to set up a new computer from scratch. Like I had to set this up last year. And I decided not to just pored over all my old things, but to do it from scratch. It's just like, it was two weeks for me with all these little things and but I think people just forget, right unless you're Dealing with a beginner all the time. You just forget, you know how bad it is.

Eric Matthes 29:06
Yeah, and I think a lot of programmers grew up around other programmers, whether it was within their family or their community. And so they didn't notice that when they were setting up their own computer for the first time. There were 10 little things that they didn't know how to do. And there was somebody right next to them to say, Oh, just do this. And so if you if you didn't struggle enough, because somebody else took that struggle for you, you don't notice those blocks,

Carlton Gibson 29:29
but even things like opening a command line? Yes. And it doesn't matter which command line it is. It's like, well, what is this? And you know, everything you type is a syntax error, and there's no buttons to click and how do you learn that? Like we did, but how do you do it?

Eric Matthes 29:44
It's getting harder because the all the operating systems or I shouldn't say all Mac OS and Windows continually hide more and more of that. So when I started teaching programming in the mid 2000s Even students who hadn't done anything to do with programming knew what a file extension was. And at some point, they started hiding file extensions by default. And so now you tell somebody save that file, save a file as file, and they have no idea what a dot extension is. And so you have to explain things like that if you don't want to lose people.

Will Vincent 30:20
Yeah, I mean, I used to make I still make the analogy of an automatic versus a manual car. Whereas right, computers are automatic cars. And if you go manual using the command line, you're doing all these things, why would you do that you have, it's harder, but you have a lot more control and it can be more performant. But you know, who knows what a manual car is anymore,

Eric Matthes 30:38
right? But it's super satisfying. People underestimate how much learners and I've said high school students a lot, but I've, I always have thought of people old enough to not want kid focused resources. So when I say high school students, I'm including anybody from that age all the way through people that are 20 People mid career 30s and 40s and retired people, they all fit into that category of I want to learn programming. I don't have any kind of formal background in it. What do I do? One of the really satisfying aspects of the last few years for me has been that Python Crash Course really worked for people from 10 years old to 90, and getting that continuous stream of email from people in all those different demographics has been super satisfying.

Carlton Gibson 31:29
Yeah, that must be amazing. Yes.

Will Vincent 31:31
And I'm sure the, I mean, I as a question, what are some of the unexpected motivations of that age group for why they turned to programming? Like, what didn't you expect? You've mentioned a whole bunch of ones, but,

Eric Matthes 31:45
um, well, let's bring this back to Django a little bit. So, you know, the structure fight. Writing is hard. I thought I would write the book in one year. It was two and a half years. I thought I would do a draft in the summer. during vacation when my kid was to, and this device would map kid, revise it over the school year and be done. I didn't get the draft written that first summer. And so writing turned into 430 getting up at 430, writing for a couple hours, going teaching, doing family stuff, and then picking it back up at 930 or 10 at night. So that was long. But the book is also two books in one. So the first half is a classic introduction to programming. What are variables, data structures, functions, classes, and I included testing because I did not learn about testing software, probably until like 10 or 20 years into my hobbyist career. And as soon as I learned it, I was like, why didn't somebody show me this a long time ago. So that kind of thinking, what do I wish I had learned as an as an early programmer guided some of my thinking on what to include Food.


another piece of this is a reaction to seeing the way computer science is introduced in schools. And many times is introduced as here's this cool product, here's a game, it's a working game. Now, here's the code for the game, now modify this little part of the code. And look, you have changed the way this character behaves. And people love that. And it's great. But that just motivates you to learn.

And so, I with a book in particular,

I take it as people want to do projects, but they also want to be in control of their projects. So if you give them a foundation in how programming works, and trust them to have the discipline to get through that, if you teach them well, then when they get to their projects, they're gonna be able to run with it. And so that's been satisfying as well. And that that brings you back to Django. So, Will has a great question. How do you teach somebody who doesn't have any background in programming, how to jump into Django. I think one of the reasons that Python Crash Course has done as well as it has, is because I take people who have never done anything with programming. Give them a meaningful introduction to the language and programming in general. And then they build a web app and deploy it, and their friends all over the world can use it. And that's a pretty impressive accomplishment. And it's why I'm happy for people who are just learning to program today. You know, I made a number guessing game on my dad's unfinished computer, on Paul horn computer, in a basement in the 70s. That was cool. But there's no way anybody else could have played that. And now you can do a project like that. put it behind a Django app, deploy it, and anybody in the world can use it. And so when we talk about satisfaction of building something, building an early project. Even if you're doing a lot of following the the steps that somebody else wrote out, would you have to fear first Django project, the fact that something that you have built, has worked all the way through deploying is incredibly satisfying. And my hope is for people to go through that process and then step back and kind of look at the parts and say, Alright, there's a list. Alright, there's a dictionary. Alright, there's a piece, I have no idea what it's doing. And when people get to those questions, they say go read wills books, because

Will Vincent 35:32
Yeah, well, you covered quite a lot in just the the Django project. I mean, you you cover environment variables, which is something that actually I don't, I mentioned, but I don't cover until the professionals book. So it's a fairly it's pretty robust. The learning what it's learned Learning Library, is that the one

Eric Matthes 35:51
learning log? Yes,

Will Vincent 35:52
learning log. Okay. Yeah, it's I mean, I'm biased Of course, I agree. Like, I mean, you're providing the context for selling I mean, that's kind of with my Django for beginners book. There's, you've built five projects and the first couple I'm explicitly telling you what's happening, but saying, you know, you're, it's not going to click for you until the third or fourth time, but I'm gonna be you need to get it working. And then again, you have that context. And then you can see, oh, maybe I want to learn, like, I've used models, but what how exactly is that? And you know, what's the view? But you're kind of providing that context that someone who hasn't isn't new to someone who is new to web web development hasn't, doesn't have. So I do think there's some degree of like, it's fine to blindly follow for a while grain, rather than, you know, and I was in I was a motivator influenced by the rails tutorial, which when I was learning Django 2012 13. I wasn't able to find really beginner friendly resources, right yet, rails had the rails tutorial. Michael hurdle, hurdle, saying his name right. And the very first thing is boom, hello, world. deploy it, and it helped it Heroku was built for rails initially. But it was just like, boom, here you go. And so that's, that's what you do in my book, The first app is hello world, and you deploy it. And then you can share it. And I almost when I teach in person, I, I always say, here, add the Google Analytics code, just copy and paste this, send it to four friends. And guess what, you can spy on them? And find out if you actually looked at it. And then people's mind explodes, right? In the same way. Like I show people teaching them HTML, I show them had to face the New York Times. Great. Write a message, right? people's mind explodes, right? Yes. Like, oh, you know, there's a server and there's a client. Like, that's great. You know, so the same thing when they can actually track it. You can see the gears going like, Oh, my God. So yeah, I agree with that.

Eric Matthes 37:49
Yeah, I mean, a fun question for me is and this all comes back to power. All right. Why did I Why did I go into education if I got a BS in physics I graduated in 94 with BS in physics and I wanted to be a particle physicist. I was on this quest to understand the universe and but I didn't want to be a student forever I didn't want to wake up and be 30 and still be a student and so I took a couple years almost

Will Vincent 38:19
Carleton as you say that how many how many years were you getting a

Carlton Gibson 38:24
few a few

Eric Matthes 38:25
yeah that's right I did I did masters everything but project later on so

Will Vincent 38:31
what's an add all but dissertation right that's the next step.

Eric Matthes 38:34

Bye by went to teaching for a couple years, taught in New York City for I committed to teaching for for two years and then found that I loved it. I found that the the challenge, the intellectual challenge of trying to teach every kid in the classroom, trying to reach every kid was as hard as anything I'd found in science. It's pretty easy to stand up and present something and Okay, the kids who get it gray. But if you take it as your responsibility to find a way to reach every student, wherever they are intellectually, academically and in their, their own lives at home, that is hard. And I'm not sure that you can reach every kid. But the pursuit of that is as satisfying as anything I ever found in science. And then sharing, you know, what I love about science and, and math is, is an attempt to understand the world. And so helping other people understand the world is incredibly satisfying. So that's what kept me in teaching. And so I think of teaching as sharing power for sharing, understanding and sharing power. If you understand the world, people can take less advantage of you. And you can do more to control your world and the world of people around you. And so when we think about technology and things like apps, you guys are well familiar with the idea that the people who build The tools that we use, the apps that we use every day, have power over our lives. And so for me with Django, the magic of Django is if you can teach people Python in a reasonably efficient use of their time, and then teach them how to build a web app. If they never touch code, again, they have such a clear understanding of how the technological tools that they're using every day are built. And I like to think of pulling the curtain way. Seems like magic. When people are not programmers, and they use all these apps. Why can't Twitter do more to control abuse? Why can't social media do more to fight disinformation? Well, they can. It's a lot of political choices and economic choices about how to when you've written code that has some if statements in a Django app, you have a sense of how those people might approach that and if you want to build that you can So one of the joys about going to Python is half the talk to technical and half the talks are what happens when people who have this new power start to address the problems in their lives.

Carlton Gibson 41:09
No, I mean that for me that that that power to make changes that that's one of the things about makes being a software developer exciting is that you can write and you can build things. It's one of the things that, you know, I try and communicate to other people that this is what programming is all about, is shaping the world, you know? Yeah.

Will Vincent 41:31
Well, I love how you talk about math and science in terms of understanding the world because I often from I have a liberal arts background, and I often like the idea of, it's understanding people so you can say okay, history is what happened. Politics, you know, politics, government is what what were the institutions doing? to control it economics is well, how did the money impact and literature is what was kind of the psychology of people at the time. So you can come at the same events or situations from all these different lenses in the same way that the sciences, you know, there's like the math, there's the physics, there's chemistry, biology, they all intersect. And so if you have the holistic idea of trying to tackle the same thing, but just a different angle, it's helpful to me in terms of, I never thought of it quite as much in terms of the sciences coming together. But definitely in terms of the arts side and philosophy. Of course, Carleton as well, is another way of tackling the same issues. You know, I must say, Carleton, I mean, I, this is an aside, like I loved philosophy, the first couple courses I took, but it felt to me like you're arguing without any content to deal with and why I was a history major is because I was like, well, you're doing all these things, but he's actually like, what actually happened, right? It's not just abstract. That was what it was. Okay.

Carlton Gibson 42:46
Yeah, no, I mean, there's the this Plato discusses this. What's the difference between the philosopher and the Sophos, right? The Sophos uses the rhetorical tools uses the arguments for the sake of argument for making the weaker argument look stronger or that it's against It's It's It's not a quest for truth was the philosopher is the quest for truth. And the difficulty is, you know, they look like academic debates, they look, they can be dry and they can lose their connection to the world. But in philosophy itself is is that deeper quest?

Will Vincent 43:18
Fair enough? So we already sort of No, no, I, oh, we'll see. You've already indirectly answered this. But one question that I'm asked all the time that I might throw to you is, how much Python and what Python Do I need to really understand before I should dive into Django and web apps?

Eric Matthes 43:37
First half of Python Crash Course.

Will Vincent 43:40
Yeah, exactly.

Eric Matthes 43:41
No, that's, that's a good question. And I think that's a really important question to ask. I've had a hard time with that question when I'm when it's asked outside of the context of my book, because I've never liked to feel like I'm plugging my book. But that was my guiding question in figuring out what to include in the first half of that of Python Crash Course. Because one of my goals was to get people ready for a game project ready for data science analysis and visualizations, and ready for a Django project. And I think if you ask that same question of how much do people need to know for building games? How much do they need to know for doing introductory data analysis and visualization, and Django or flask or any number of web apps? I think you need to know what a variable is. This idea that it has a reference to information points to information, you need to know how about collections, is you need to know about lists. You need to know about loops iterations. You need to know about dictionaries because dictionaries the idea of mapping to pieces of information connecting bits of information you certainly need to know about functions and you need a password. As she should say, introductory level of understanding of classes, I think a mistake that people make in thinking about learning classes and object oriented programming, is they think they're gonna have to write a bunch of classes. And a lot of times the real value in learning about classes and object oriented programming is, you're probably not going to write too many classes yourself, but you're going to use classes that other people have created. So understanding that a class is a representation of a kind of a thing, or a concept. And then an object is an instance of that. An example of that, a specific element of that, of that kind is important. I struggled with that for a long time because I didn't learn object oriented programming. And I remember going to my dad and saying like, what is this I've been hearing about this for years, I've always avoided it. And he said, the classic it's just a thing that allows you to Combine information and actions. And I think that's still pretty relevant. It simplifies it. But it's the big point classes a way you can store information and define actions together. And you can represent real world things. And you can represent abstract concepts. So that's, that's just throw one more thing in there. And that's dealing with files and exceptions. I like those together. Because what happens if you open a file that doesn't exist? If you try to add just that word, try, oh, there's a try. Python word. That's important. And I also throw testing in there. And you could make an argument that people don't need to learn about testing right away. But it doesn't take much to throw the concept of testing your code in for somebody who's learned all that so far, and I think it's really important to, to put that in front of people. So that as they do start to get into meaningful projects, they're aware that Oh, I should start testing My code at some point, I have some idea how to do that. And it's not this big giant new thing that they have to, to deal with learning at some point.

Will Vincent 47:07
Yes, yes, yes. Yes. I mean, testing, I completely agree. I mean, in the, in my beginners book I introduced testing, I kind of just give it to people. I mean, I I actually separate thing I want to do a whole course on testing, but I do say, here kind of it is I'm gonna broadly describe it, but like, you should have it and it can run just to get it in their mind. Right. But I do think what you're saying about classes and in object oriented to me, that's the piece that you need to actually like truly understand that with it with Python before Django makes sense, because what a class based views What are mixing, right? I mean, personally, I'm an advocate of class based views over function based views. I mean, a source code uses it but I you should do both, but I often think of it as Okay, you can disagree with me, I often say like, you start with generic class based views, and I still like as a in my practice, If I can use that, shove things into there, I'll do that if I have to go to class base, you know, function base, and it's in terms of learning, you start with those just works. If you want to modify it, then you got to go to class C class based views, it's a little scary, maybe rewrite them from scratch as a function based view. And then you come back around to Well, I'll just rely on the work of others. And I'll modify that, you know, one little bit and have cleaner code. So you kind of need to cover all of it, but you were making a reaction to my emphasizing class face, you

Eric Matthes 48:30
know, I this is like, the flask versus Django.

Will Vincent 48:36
Please convince me otherwise. I mean, I want to hear more arguments for function based views because to me, it's, I think you'd need I think of it more as the the order in which someone should, should have ideas, a programmer would say, Well, I like a function based view, because it's all there in front of me and I don't want magic. And I would say, Well, everything is magic to a beginner. So I'm going to give it to them in two lines rather than 10. And then I'll backfill it later. After they've learned how to do a ListView, a detailed view a template view will then we'll do it from scratch. That's what I would say.

Eric Matthes 49:08
Yeah, I, okay. I have always thought of teaching programming first and teaching Python second. So every year, I look around at the language landscape and ask myself if I should still be teaching Python, or there's something better to work with and teach. I do the same with Django and other frameworks. And I do the same with aspects of Django, like function based views or class based views. My project, where is the last project in the book is the last thing that people are going to walk away with from this specific book. There's so much magic already in the Django project that I look for. What are aspects of this project that people are going to really understand and start to, to work with? And I think from What I've seen so far function based views are, are a little clearer for people to think about. Here's the function that takes something in the request parameter is that probably the most magical thing in there. But as far as people writing their queries, and they're just simple queries and these first projects, and then calling another function that that renders the, the page. I like how clear that progression is. And if I see a clear argument that says everybody's going to be using class based views all the time from now on, I would not keep I would switch over to class pays for used the scene that people are still using function based views include Who

Will Vincent 50:43
are those people?

Carlton Gibson 50:45
Because I think if you're teaching the web problem, right, the web Prop, the function based view approach is great. You're you're turning requests into responses. And so you say your request come in and you overlap. That's the web problem and class based views. Totally hide that until we go right into that And you see, oh, it's just actually a function based view. But you know, it's wrapped up in this stuff. And it's, but I think if you're teaching the web problem, that's the introduction got to be the clearest way. And then Okay, when the class based views come in for me, they come in when as soon as you're doing create views, or update views, or delete views use the generics because, you know, they're a bit weird. And you have to open Clasico space for us to remember what the parameters are, and not the rest of it, but just save you loads of typing.

Eric Matthes 51:27
But I think we'll have a different use case and different audience. And so what's a good writing principle? know your audience? And so I'm choosing function based views because it's the last project and the last thing, last chance I have to work with people in this book. And we'll you're you're doing that as the foundation for Okay, here's the first couple projects I'm going to show you. And then we're going to dig deeper into all of this. And so I think that that your rationale is pretty good.

Will Vincent 51:51
Yeah. Well, it's true that I tried to say, you don't have to know much Python to get through my beginners book. So I But yeah, it does make me think about the Carlton's point about the parallels between the requests. Yeah, it's something I think about, I mean, actually, something this morning I was working on is I've played around with and I'll probably hopefully I'll have this post out by the time this interview comes out of the idea of how many ways to do an a homepage or a simple page in Django. Right, as I think this is something that is really interesting Once you're at an intermediate level to understand all the mutations, but it's completely confusing and non non helpful to the to a beginner. So when I show someone how to do hello world, I say would you know, take as a homepage, I say, Okay, well, we're going to create an app, let's call it pages, we'll have a template, we use template view. And while the URLs good, but you know, you can cram it all into the project level file, you can use a string instead of a template. You can use a function view, you can use a class based view. You know, you can go to the extreme Carlton has this wonderful talk about how simple Can you Make chango to make it, I forget how many lines of code that is we'll link to that you gave a talk and we have a post on it. You know, we make it flask like. So I find that that's in terms of again, I always think of like, what's the order in which I present things to someone? Because I am not trying to prove to them that I know this code. Hopefully I know it. It's what's the progression? Given that everything is magic, everything is abstraction. How do I find that mix between context so they understand what's happening? They have a why, and the harder work of learning the fundamentals within that. So that's, I don't know if that resonates with you. But I can think of like, I think six different ways to do that, that homepage, and each one sheds a light on a different nuance around Django, because I often think of its batteries included, it has guardrails, but really you can do whatever you want, like an Apps are just like, a nicety. But once you start breaking those things down, right, if I showed that to a beginner and I've done this, like their head explodes, you know, right, because usually for beginner, what I want to get across to them is I want them to understand the interaction models, views, templates and URLs. To me, that is the single biggest thing to get over for beginner because it doesn't matter the linear progression of which you write them, you kind of need all four. And you just need a, me a bunch of reps before that clicked. But once that clicks, then it unlocks, you know, what is middleware? And so at least as I teach Django now, that's how I view it is I want to get someone over that hump. And the way I get them is kind of follow me and then I'll fill in the, you know, the details as we go.

Eric Matthes 54:31
Well, I think that's a good approach. I mean, you will go back to your goal is to help people get something up and running that works. And then you're going to start to dissect that. And so I think, for you having fewer lines of code and more magic, the beginning is totally appropriate, as long as you do. take people through a thoughtful dissection of what was working so they know what they need to understand. And there's some things to leave as magic. You know, we can I wanted to throw this point in, I just still shake my head and marvel at any notion of dismissing web developers as not real programmers. I don't understand where that comes from, unless they're people who just have written so many crud pages that that's where they think all of web development is, there is so much going on in a web development stack. And then you even can ask the question of like, what is this particular project addressing? So if it's a science based site, if it's a business site, any number of things, not many people can understand truly everything that's happening in that stack. And so there's so much room for us to be learning all the time. And so I think most maybe even all of us need to leave some things as magic or things that other people have sorted out and I could dig into someday if I need to, but I won't until I need to. I think that's totally appropriate. I think it leaves you this space. to work on the real world projects that most of us care to work on.

Will Vincent 56:03
Yeah, I think that's the key to not feeling overwhelmed is to understand that you don't have to master everything right now. It'll, you know, programming is fractal. And on top of that, I mean, the reason why I like web development is I think it's, it is a liberal art. There's, there's so many so much nuance to it, I mean, front end back HTML, it's, I mean, it's just endless, the number of things you can poke around, and maybe a little harder in a professional context, but certainly for hobbies, inside things, it's just never ending, which, because I guess, you know, I get stale if it's, I was, how can you teach calculus at the collegiate level, right? It's four or 500 years old, and it's the same thing you teaching for 30 years. Like, I find like, to me, that's the inspiring thing as someone who can make who can get motivated and interested about that, whereas the web is just like, well, it changes all the time. So I'd love to be bored, maybe a little more than Ram.

Eric Matthes 56:56
You know, we're probably getting towards the end of this. So I think a good way To wrap this up is to kind of remind people reassure people. Since we've been talking so much on learning how to use Django and learning Python. Our goal, I think we probably share this goal is to make people not need us. And so at some point, you know, people read my book, they read your books, they go with it and learning resources. But at some point, if you stay with this, you get to a point where you learn all this just from reading the documentation. And you still post questions to Stack Overflow, and you still ask questions of your your colleagues and peers. But you become proficient enough that you can dig into the internals, dig into the Django code,

Will Vincent 57:46
look at

Eric Matthes 57:47
other projects and see how they do it.

And so, we'd like people to buy our books and read our books and we enjoy watching them progress. But I think our goal is is a shared goal of having people not need us. And get to that place where, where they can sort things out for themselves and be confident in doing that.

Will Vincent 58:05
Carlton, I thought of you last night, I was literally to the reading the docs, I always try to think of what does it feel like to sort of kind of know Django? How do I impart that to someone and I view it as I have a sense of the spider the tapestry, but I don't have everything. I don't know everything. And so I was looking at. So why do you use versus Django admin? Because I just sort of blindly you know, I know Django admin, I use the start project and manage that py with run server and, and I know Carlton knows the answer to this, but I never really thought about it. I was like, Oh, yeah, like, I was reading something. And they're like, I was like, yeah, now go to the docs. And it's like, oh, well, you know, if you use, it loads in your, your settings. Module. And to me again, I that's exactly your point of like, even though I've been using it like I went and read the docs and a I found it interesting and B I found it helpful. And you know, I could read the docs till infinity and still learn stuff. Every time. So, of course, I was like, I know, I know Carlton knows that. So

Carlton Gibson 59:05
I've got it in front of me, I've got a document browser open. I've got 1234567899 open tabs for the stuff I've been working on before the podcast here, right? I have the docs open forever, all the time. And those that's not this, there's not this idea that you get to the point where you don't need the dog. So you don't need the source code. More and more and more.

Will Vincent 59:27
Yeah, it's just the resources you use change. While we are at a time, we have links to everything, we didn't even get a chance to talk about your Python flashcards. Are there any concluding thoughts or would you like gengo people to reach out to what how do you want to end this?

Eric Matthes 59:43
Yeah, I'm always available. I think the easiest places Twitter at eh Mathis and my email is not hard to find. I think one closing thought is if people are looking for any of these books, my books your books, anybody's one thing I get repeatedly is people who accidentally buy early editions because if they Beginners don't always know to look for the latest edition of a technical book. So if people are following up on any of these resources, make sure you're you're finding the latest edition,

Will Vincent 1:00:09
probably the second edition of your book. Yes. Great. Well, thank you so much for coming on. I want to do this for a long time. And I think it'll be really interesting to everyone.

Eric Matthes 1:00:17
Absolutely. Thank you for having me.

Will Vincent 1:00:19
All right, everyone. We're at chat Django on Twitter, Django chat calm. We'll see you all next week. Buh bye. Join us next time.

Transcribed by