Transcript: How Django Experts Think
Hello and welcome to another episode of Django Chat, a weekly podcast on the Django Web Framework.
I'm Will Vincent, joined as always by Carlton Gibson.
Hello, Carlton.
Hello, Will.
How are you?
I'm good.
And this week we were going to try something different.
I thought we could talk about how it feels to be a Django expert, or at least to be perceived as a Django expert.
Uh, because you and I both, with our various hats, are looked to by some folks as knowing what Django is all about.
And I thought we could talk about the reality of what that feels like to give beginners a sense of where this all leads, and maybe uh fellow experts who don't feel like experts, maybe they'll agree with some of the points.
Yeah, because that that's the that's the biggest bit, right?
Is fellow experts who don't feel like experts.
It's like there's two sides of it.
One is when you talk about beginners, I remember being a Django beginner and looking up to people who were like, you know, maintaining the framework, and they were superheroes.
And then and you know, years later I've suddenly find myself in the role of Django fellow and I'm maintaining the framework, and I'm but I don't feel like a superhero at all.
I feel like ah, I don't know what I'm doing 90% of the time.
Right.
Well, and it's and I think it's so there's two things.
I think one is programming is just not a field where you ever feel like you have mastery.
It's not you know, and there are a lot of fields that are where you're doing, you know, I don't know, Jiro making sushi, right?
After five years of making the same, you know, rice every day, he can have a high degree of confidence he knows what's going on.
But programming is just not a field like that.
It's infinitely complex, and the more you know, the more you realize what you don't know.
So it's this is the you know the imposter syndrome is you don't you you don't spend time on what you know because you can just automate it.
So it's not or even a surgeon, you know, a surgeon, I'm in Boston, a number of my friends are surgeons.
Surgery does change quite a bit, but you're doing the same procedure eight times a day for 20 years, you know, you get a high degree.
I mean, surgeons are confident and you know you could say cocky because they're doing the same thing again and again and again.
There's that joke.
What's the difference between God and a surgeon?
God never thought he was a surgeon.
Yeah.
Yeah.
Well, lots of things I can say about the medical profession.
But yeah, uh, but pro so programming is just not one of those fields.
Um, I would say the and I'm I'm this comes to mind because I'm increasingly asked questions by people who, in some cases, I think know more about Django than I do, and yet they're looking to me as an expert on Django.
And I do know some stuff, but I'm highly aware of all the things I don't know, in part because I'm I get a lot of great questions.
And so I thought we could talk about maybe let's like what is how did that journey from beginner to where we are now, and then we can talk about how it feels now because I think it's it's more that I I I know what I I know what I don't know, but I also have the confidence in the scar tissue to be like I could figure basically anything out that's web related.
I mean, this isn't quantum computing.
So and I kind of enjoy the hard challenges now because I I've seen a lot of the stuff at least once.
So I kind of like the super tricky things.
Yeah, I think there's something in that.
Is that the a couple of points that you made that will come back?
But this idea that um you could take wherever problem came up, you'd be able to resolve it.
I think that's where the the after you you've got the years of experience, it's like, ah no, well, you know, I could I haven't seen this exact problem before, but I've seen problems like it.
And I could, you know, if you gave me long enough, you gave me the budget, I could take it.
You don't have that total fear of I don't know anything, people are gonna find me out and I'll never solve it.
Because you've gone through that loop so many times that it's like, well, I'll get there.
It may take a day, it may take a week, it may take a month, but you know, almost everything we're dealing with is a solved problem.
I just don't know where it's been solved.
Yeah, and I don't know.
Like so there comes.
I remember being at a talk at some um uh iOS development conference, and and one of the uh people giving the talk was a very experienced developer, and they were like, look, ultimately, there is no problem that I cannot solve because you know they get down to there'd be some work, they get right down to the debugger and they'd they'd be patching a functioning C, you know.
And it doesn't get any lower level than that.
And it now in the web, you're not really doing that very often, you know, you don't get down that low.
You don't you very rarely do you even find a bug in Python that you have to work around.
Um you found one.
Yes, my first so okay, so 15 or something.
I've got my first ever bug filed in um Python.
So the you know, I've been using Django for all this time and finally found a bug in for Windows, 3.8 Python 3.8.0.
There's a bug with um async.io, blah, blah, blah, which will be fixed in 3.8.1.
Because I reported it was fixed the same day.
It was amazing.
But yeah, you know, in in all that time I found what you know, I've found one bug in Python.
Actual bug.
Yeah.
You found a few Django bugs though over the years.
Well, yeah, yeah, but Django's like
no, I know built upon Python's.
Yeah, built a point.
So like that the higher things up, so your your code is the most likely place where there's some bugs, but not your code, but one's code, is um the most likely place where there's some bugs because it's built on top of everything else and it's not as tested and it's not as used, and then below that Django, and then below that Python.
But normally the you you look in your own code for the bug, right?
Right.
Well, it and that is the case that it's I guess it's the confidence to know that you you can solve anything.
Um and you just sort of go, I mean, basically you kind of go, F you computer, I I will figure this out.
Yeah, and you remember throwing the hands up, you you know, you're I'm more we're more used to well, like yesterday um was it yesterday, I was dealing with you and I, there's something, an API permissions thing, and you know, a reader flagged it.
I looked at it for an hour, I couldn't figure it out.
I asked you, you know, on a quick look, you couldn't figure it out either.
At some point it will be solved, it's probably something silly, but I don't know the answer right now.
But I'm also not beating myself up about it because I'll you know, I'll go take a walk, I'll sleep on it.
Uh it's solvable, right?
But when I was a beginner, you know, I I think the difference is how and how you get stuck.
So for me now, I don't get like stuck stuck for a week on something because I have more I I can fix things faster, but also I know where to ask and how to ask when I'm truly stuck.
So I remember being stuck on just like installation things with Django or I don't know, solar, you know, all these things that don't even seem like what I'm actually trying to do that just are path variables when I was really starting out.
Oh yeah, so you know, which still I hold, you know, I just oh my god, path variables kind of freak me out.
Environment variables and all the rest of this stuff.
Well, you're like bash, you have to be a bash expert before you can even get going.
We see we're back, this is back to episode one, right?
What is Django and how hard it is to learn Django?
But I I think part of it is knowing when I've knowing what a good faith effort is on my part before I, you know, put up the white flag and ask for help.
Uh so like for example, on this specific thing, I'm gonna give it a couple days, I'm gonna look at it, uh, and then I'm gonna ask people because I know someone will be able to quickly spot it.
Uh, but I think it's it's having the reps to kind of know when I've done what I can and I need to ask for help versus, you know, because I no one wants to like ask for help all the time.
Like if someone's asking me for stuff, I don't want someone to ask me something because they've been they don't they haven't made an effort, right?
It's clear to me when someone hasn't made an effort.
Um, and you know, I'm better at Googling than they are, probably, but it's sort of like where is that line between I've made an effort and I can explain, you know, I think this is the problem, it's something like this, you know, that kind of tees up if I'm gonna ask of someone else, that's better than just being like this code doesn't work, which you know, I I get that from people, and that's fine if if I sometimes don't respond.
But you know, so anyway, so asking for help is a skill that comes along with being
but phrasing your question as well, knowing where to look.
So, you know, you you're trying to run, let's say you're trying to run a WebSockets um app on top of channels using Redis with uh you know some a
grocery bag of
front-end CDN in front of you, you know, a load balancer and a web server, and you know, and then you put up on the channels repo, oh this isn't working, you know,
this is a content.
And it's like yeah, and it's like uh this isn't addressable, this isn't uh this isn't a bug I can help you with.
So it's knowing how to ask a question as as well, and really trying to pin it down, and that's something that beginners can can focus on is have I have I explained this so that somebody can reproduce it, so that somebody's got a chance of helping me.
Right, and putting, you know, putting putting the logs, putting the error messages, saying this is my thesis, this is kind of you know my logic to get to this point.
Yeah, because nobody wants to just be tossed a whole bunch of code and have to, you know, that's I mean that's work work.
That's that's not fun for anyone.
Um so that's a that's a big part of it.
Uh I mean what else?
It's I think it's also like how do you get to this point?
I mean, I I'm you know, over my career as an educator, I want to eventually be able to show people how to build probably like 10 different apps with Django, DRF, and other things, because I do think it you just need the reps to see the patterns, to see that everything is crud.
And then you reach this point where it it becomes a little it's not that it becomes a little bit boring, but I think it's like any job after every five, six years you have to reinvent why it's interesting for your for you.
And coding is especially like that because it's you know, we've talked about this in other episodes.
I I feel like I could you and I could build a prototype of almost any site quite quickly, but we know what it takes to make it in production, and you know, that's a big step function leap.
And so that makes it maybe less exciting to just build stuff because you go, oh god, I'm gonna have to maintain it, and there's bugs, and yeah.
You know, and a lot of it's the UI, it's not the list view or the detail view that you build, and then you get, oh, I get a bit bored building a Django detail view.
Well, you know, okay, is there a different level of abstraction you can work at?
Can you the why is it repetitive?
Like in that case, can you create a class which you know encapsulates that what's repeated and then gives you a higher level pattern?
Right, and that's why I think it's these subtle things when I see the the give me pleasure in meaning in code now, right?
Where I see a problem and if there's an elegant solution to it, even if it's especially in some ways, if it's just a tiny little thing, I go, Oh, that's that's clever.
I like that.
I you know, e even if it's some iteration of you know a detail view and a permission or something or list view, because and this is a a talk maybe next year I'll give I mean everything is crud, and then you have list view, detail view, and sprinkle an auth, and that's like big, big picture.
That's that's it.
Yeah.
I mean, we can I'm happy to dive deeper, but I think maybe a couple years in you go, okay, it is all crud with a foreign key and list view detail view, you know, and then it's just sort of waterfalls from there.
But I mean at the end of the day, uh you know, so part of that too is when people ask me, sometimes they're stuck on a work thing or they want to work on or they have an idea for an app and they're they're getting all these complicated layers of permissions and this and that, and I'm like, but could you just use you know, could you just use a detail view, right?
Or someone was asking me something about a hospital app with all these different permissions and logins and that, and I was like, well, could you just use login and if the login doesn't work, they go to sign up?
Like, I think that would work.
Yeah, we're gonna do that.
So it's like so you know, you come full circle on the simplicity.
Yeah, I mean, okay, yeah.
So what uh what's what's the episode about?
The episode's about being an expert.
Yeah, and it's learning where the patterns are, right?
So, oh, it is just a detailed view here, and oh, if I just use this permission, you know, if I just use the stuff that Django provides for like user passes test or something to control the access here, that will work.
That'll do.
Well, is there that saying that you know, like a truly expert programmer, or there's some like graphic of, you know, given a problem, like a beginner will just like dive in, intermediate person will I don't know, start stack overflowing, and like a true programmer will sit back, go for a walk, think about it, and be like, I've seen this before, and just you know, kind of nail it without getting so busy in the weeds, but it is that pattern recognition.
And I think, I mean, that's what's that's what's fun.
I mean, I guess that that is sort of what is what does it feel like to be an expert, assuming either of us is an expert.
It's seeing the patterns and going, yeah, I've seen this before, I see this as a flavor of something common.
Because again, it's if it seems brand new to you, it's not.
It's just you don't have the context.
This is why algorithms are so fun, actually.
I'm I'm probably gonna write it.
I've sort of half written an algorithms book because I find algorithms fascinating in that they're taught when you have no context, like your second undergraduate course, and you're kind of like just memorize them and repeat it.
But then as a professional, you go, oh my god, like these are so useful if you know that they're there and can reach for it.
Because, you know, whatever performance thing you're trying to do, it's probably an algorithm question, but you need to kind of know the algorithms, but you need that mix of seeing the problems and then knowing there's a whole dictionary of uh answers out there to to use.
Yeah, I say I mean, okay, so I am constantly reading computer science books, um, have been for a decade, but when I started it was all like the bash cookbook and classic shell scripting and all these things.
And these days it's you know, mathematics books or algorithms books or data structures books or you know, these these kind of things.
Why?
Because they're dry, they're really dry.
Um you know, but they help me get to sleep, so anyway.
But the point is that those things are.
I thought that's what uh Aristotle and the original Greek ones were.
Well, exactly.
That that that kind of thing as well.
But um those kind of texts are the ones that have the really transferable value.
But it's only you know, 10, 15 years in that it's like, yeah, okay, I really, you know, I really I really like reading those sorts of things.
When I started to, you know, pick up an algorithm book, it's like this is totally meaningless to me.
Because I was never I was too busy trying to just wire some stuff together to ever think about the structure or the you know, the you know, could uh is there a simpler implementation or you know, the more interesting stuff.
Yeah, well I strongly feel it.
I mean, I am I am gonna publish this book at some point.
I think it can I think I don't think I don't think it doesn't have to be that way, because I think I I think you don't have to make it a pure applied math book, which is what you know they are and make sense 15 years in.
What you really want is you want sort of a quick guide and a sense of understanding, oh, that this would be served by a greedy algorithm, this would be dynamic, this is um you know, to sort of be able to look at a problem and understand what bucket it falls into, and then you can dive in and find the right one.
I think that's the biggest takeaway beyond knowing that there's a ton of algorithms.
I mean, for example, like when I explain algorithms to non-programmers, I usually put it in the context of so there's searching and sorting algorithms.
But at the end of the day, you almost always want to get to a binary search.
So it's really all about sorting algorithms, I would say.
Which I don't have never heard anyone say it like that.
But my take is that it's basically all about sorting.
And then what's really cool is you have comparison sorts and you have non-comparison sorts, so you say, well, if I don't have to be a hundred percent correct, I can be, you know, a multiple faster in my uh sorting.
So it's like, well, do I you know so you can ask sort of the architecture questions of like, well, is speed more important or is accuracy more important?
What are the trade-offs?
And that's kind of what I would like to be able to get beginners thinking like that, even if they don't have all the math and everything memorized.
Because that's how that's how you and I would think about something, right?
So it is all trade-offs, right?
We say it all depends.
It all depends, yeah.
But how do you get to that point where it you can make a good decision?
Right, but I think, yeah, okay, but I think this is where you do need just an amount of exposure.
So you know, for for instance, I don't know, the design patterns book.
So OLP has sort of fallen out of fashion from when I started, but you know, it was always worth as a junior sort of slogging through the design patterns book or slogging through the refactoring book in order to give yourself a vocabulary to talk with.
And then you come up to a problem, you'd be like, Oh, this is a bit like the composite pattern.
And then it would give you something to go and look up, and it would give you a solution.
You'd be like, Okay, I can model it like that.
And it it may not have been the best software in the world, but it gave you a an answer.
And the same with some algorithms.
If you know some algorithms, or you know, you know, it you know, if you're a beginner, the algorithms aren't the place to look.
The place to go and read is the the is the standard library um uh manual, and just go through each of the modules and sort of have a look and see what functions are available, and then and there is a great um book.
Um, what's it called?
The Python Standard Library by Example.
It was um Python Module of the Week was the blog that it was originally based off, and then it became a book, Python Standard Um Standard Library by Example.
It's a great book, and it it's a really good way of learning some Python and to see what's available, and all of a sudden it's oh you know, I need to do this.
Oh well, look, there's a pretty print module, and you know, you can use it to preprint.
Or there's a diff module, and you you know, which it doesn't know about, you'd never you'd never even know to reach for it.
How how do you how do you know to reach for it?
Like for let me give you an example.
So I come from a liberal arts family, and my family, people read the dictionary for fun.
You know, so what you're describing of going through the Python like standard library, that's like reading the dictionary for fun.
I mean, I I read the dictionary for fun.
Honestly, I don't read the Python Standard Library for fun as much.
But it is a similar thing.
I think the question is more, you know, okay, if you're not already wired for that, usually it's in the context of there's some problem that comes up, maybe it's around time, and then how do you how do you get to the right resource?
You know, this is where um, you know, you know, because time time is complicated, Python has some nice packages for it, but probably what you're gonna do if you're a beginner is you're just gonna go on Google, you're gonna find a medium post or something else or Stack Overflow that gives you some code that sort of kind of works, and you're not going to understand it, and it may not be the right solution, but it's like a band-aid and then you move on.
And I think that's fine as a learning tool, but I guess we would encourage people to like go a little bit deeper, like see how Python, see if there's a built-in thing in the language, see how it's created.
Yeah, we at some point you've got to fill in the gaps, right?
At some it's uh okay, you know, you can Google, you can find a thing, you can paste, copy it off Stack Overflow, paste it in, and you can do that 50, 100 times, and you begin you're getting there, you're learning stuff.
But at some point you've got to fill in the gaps.
So this is where things like the um, you know, if you're talking about Python, there's this book Fluent Python, which do but you know and it's it's massive, it's like a thousand pages.
And I I read it on my mobile phone in um on, you know, I never read it, I just knew it was taking a long time, you know.
But I was long, I was on bus.
I have it, yeah.
It's a doorstop.
But I was taking long bus journeys and I was reading it, it took me months, you know.
Okay, fine.
But I was learning oh, there's really cool stuff.
Like, ah, interesting, interesting, interesting.
And then I saw it in the physical copy, and it's like, wow, that's a doorstop.
But it's such a good book because it kind of fills in the background of what everything you need to know.
And then when you come out of it, you're there's another couple.
I mean, Fluent Python was one.
There was another one that's a lot of different things.
Well, there's Effective Python.
I mean, I have actually a a blog post on what I think are the best Python books.
We'll we'll link to.
There's well, there's Python Cookbook.
Yeah, which is Learning Learning Python, that's the um Mark Lutz.
I mean, I would say for well, so for beginning Python, to me, the top ones are the Python crash course and automate the boring stuff.
There's other ones, those are the two kind of top ones and then if the next step up I would say it's Fluent Python and the effective Python by uh Brett Slatkin is very concise but just kind of mind blowing in its quality.
Okay.
But you know the thing is there's only so many non-applied books that you can read.
You kind of need to balance you know okay here's the theory and then here's let's build an Instagram clone in Python and Django and sort of apply and pick things up I mean this is what I think about as an educator.
I think about getting someone there fast and then getting someone there you know I almost want to write a book that's like I could do a whole book on a blog app where it's just like chapter one basic version chapter two like it have 10 chapters and each time do it differently from scratch with more complexity you know sanitize inputs with bleach do this do that but I think you kind of need it needs to feel familiar before because if I just gave a complicated solution it wouldn't have any context for someone.
Yeah no that's exactly it you've got to you've got to like not Aristotle's got this line knowledge has to be worked into the living structure of the mind and that's exactly it for programming you can't just pick up the you know the advanced solution and understand it.
That's the trouble with like the the Django cookie cutter type um project starter projects unless you are already there they're too big they're too all encompassing you can't grasp what's going on and even if you do grasp it's probably got nine lots of things that you don't want that you're not entirely sure how to cut out and
yeah well and this is you know coming coming to you know first principles and simplicity as you uh advance in your career I mean I see more and more yeah just a basic authentication flow I could teach it five differ
ent ways and it might be the most beneficial thing to to do that like let's just keep doing it a little bit more complex or a little bit different each time.
Same thing with with a CRUD app it's you know at the end of the day I mean this is the the mindset that you and I have you know CRUD app it's like okay what's the very first thing I think about it's like okay what are the mo what's the schema uh get the models right and then okay where's my list view where's my detail view is there anything kind of tricky I need to do to get context data, save, you know, maybe maybe not and then you know toss in the templates, the URLs and good to go.
But I can say that because I've I don't worry about well how do I set up Postgres?
How do I configure my app structure?
You know all these little details I guess it's the details that I I view as just very downstream from you know the schema and the architecture side but you can't really get there until you've done it a bunch of times.
Yeah but all yeah and all that stuff that's where the difficulty is it's like you know a beginner can start off they can create a model they can you know they might go a bit slower but they'll get all that and then it there comes a point where the cumulate the accumulated knowledge that you have to have to get this thing actually production worthy.
Yeah yeah is just too much and that just takes time and that that's just time on the coalface.
Right.
And it's I mean it's I say it's frustrating that it's not there aren't more resources on it.
And I kind of understand why because I mean I wrote an entire book on this Django for professionals but it could be 10 times as long uh as it is it's almost 400 almost 400 pages.
You know there's a lot of sections where I sort of take you as far as I can go and then say well and here's where to go further.
But I guess it's that it's that 8020.
I mean in that book anyways I tried to give you the 80 and show you where the 20 is it's I don't know it's deciding how much you want to polish the rock that you're that is your your app.
Yeah but and also for something like a book if you want there's no point going all the way to the complete finished thing because that that stuff changes.
Whereas if you you stick to the core stuff which is relatively stable it's like okay this is going to be more or less the same in you know a year, two years time.
Whereas if you go right to the thing, yeah it's like oh but that's not the same that's not the same that's not the same.
Right.
Well and this is why the you know foundational stuff becomes more and more appealing you know all the way to like just pure applied math.
I mean things that don't change that are I don't know eternal have more and more appeal.
Yeah exactly so which so which am I going to learn?
Am I gonna spend time learning the latest framework or am I going to turn um spend time learning computer science fundamentals or you know programming language fundamentals.
It's always going to be programming fundament language fundamentals because that new fancy framework will have disappeared by the time you know and but was those fundamentals they they haven't changed ever.
Right but I think the problem uh the way it's taught in my opinion is that they give you all the what you and I are excited about, they give that to you in your first like three or four courses and you have no context for it.
And it's a little bit in one ear ear out the other whereas I think there should be some sort of mix or well and actually what happens is that you have a lot of people who in computer science programs half the you know an undergraduate level half the folks have spent a number of years building CRUD apps and whatever and they have a little bit of the context so they can see how valuable it is they have that repetition and then half are true beginners and it's just like what is this as a teacher you know you have to balance both those which is hard but I I I'
m a big favor uh big fan of context and theory together.
Um well I just wanted I wanted to raise one more thing right because you you you um talked at the beginning and this just ties back with what you were saying you talked at the beginning about um how how it feels um and how beginners feel and how and and how experts are more yeah feels the same well no but how experts perhaps um are more real realistic about what they know maybe and there's this there's this thing that I was just looking up it's the Dreyfus model of skill acquis acquisition where you start off as a novice and you move to an advanced beginner and then you
become competent and proficient and finally an expert and one thing that there is at the beginning of that of you know the novice advanced beginner stage is you perhaps think that you're more advanced than you really are.
Yeah.
And I think you know once you get to a certain point you start to realize how little you do know and at that point you're you're gonna you're gonna be more successful just because you're you don't plow through blindly you're you're more kind of aware.
Right.
I mean I've seen that you know you'll see tweets and stuff that's you know a year or two in it's like I don't know anything five years in I know everything and then ten years plus the rest of your career it's like I don't know anything.
Yeah so it's yeah but I I so I guess I just want to for beginners I want to say that it's it's a constant beginner mindset profession.
It's just the challenges change a bit and the things that excite you you know things that excite me it's not building a prototype of something because I know I can do that.
It's these more foundational things are much more interesting.
Uh but they certainly wouldn't have been when I was starting out um and it's ultimately this knowledge as you said of that you know expert almost anything we're dealing with can be solved right and it's especially the older I get you know life is not like that.
So it's sort of nice that code is like that that there is some sort of solution.
But like yeah and to but to keep this um there's this great book that I recommend to everyone called Zen Zen Mind Beginner's mind and it's about keeping the the the the mind of the beginner keeping open keeping um you know aware of your that you're not done or not being self-satisfied that you're there and for me coding at its best is you know a very Zen experience in that way because it's like yeah I'm I'm really pushing my limits constantly and it's a lot it's an ongoing challenge and it's an ongoing practice
you know like Tai Chi or like tea pouring or like calligraphy or like any of these other arts that they practice in the Eastern tradition.
So you know it's kind of programming is meditation you know
yeah yeah like let go of it all we don't know anything.
I guess uh last point I would say is I I find that you know what so what is it like being I'm almost 40 now I mean you're you're 40 what forty 41?
42 next month.
42 well you're 41 I you know what I again I'll I'll use a doctor example right so doctors are highly educated but they're kind of used to knowing what they're talking about.
And it's interesting to see how I feel like programming keeps your my mind pretty plastic in that I'm constantly being humbled.
I constantly have a beginner mindset.
I I just don't have any laurels to rest on.
I don't I feel like I'm only as good as my next code and maybe not doctors but that's unusual as far as far as professions but I think it's you know I appreciate the challenge because it does uh it keeps me kind of childlike right it keeps me constantly frustrated but also engaged and interested in a way that other careers at least for me I would be bored and I don't know calcify a little bit I think.
Yeah no exactly for me that's the you know that's the appeal.
Yeah.
All right well I hope that's helpful for people.
A little bit of a different episode but I think I wish I had heard something like that when I was starting out so if it resonates uh let us know at uh chat chat Django on Twitter we're at DjangoChat com and we'll see you all next week.
Bye bye bye bye