Latest / Talk Python To Me / #427: 10 Tips and Ideas for the Beginner to Expert Python Journey
Transcript
- 0:00Getting started in Python is pretty easy.
- 0:02There's even a t-shirt that jokes about it.
- 0:04I learned Python. It was a good weekend.
- 0:06But to go from knowing how to create variables and writing loops
- 0:10to building amazing things like FastAPI and Instagram,
- 0:13well, there's this little gap in between those two things, don't you think?
- 0:17On this episode, we welcome Eric Matthews to the show.
- 0:20He has thought a lot about teaching Python
- 0:22and comes to share his 10 tips for going from Python beginner to expert.
- 0:26This is Talk Python To Me, episode 427, recorded July 19th, 2023.
- 0:33Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:49This is your host, Michael Kennedy.
- 0:51Follow me on Mastodon, where I'm @mkennedy,
- 0:53and follow the podcast using @talkpython.
- 0:56Both on fosstodon.org.
- 0:58Be careful with impersonating accounts on other instances.
- 1:01There are many.
- 1:02Keep up with the show and listen to over seven years of past episodes
- 1:05at talkpython.fm.
- 1:07We've started streaming most of our episodes live on YouTube.
- 1:11Subscribe to our YouTube channel over at talkpython.fm/youtube
- 1:15to get notified about upcoming shows and be part of that episode.
- 1:18This episode is brought to you by GlareDB.
- 1:23GlareDB is an open source database for querying distributed and disparate data.
- 1:28Connect your data sources and use the Python tools you already know to ask questions and
- 1:34integrate data across data sources.
- 1:36Get started today at talkpython.fm/GlareDB.
- 1:39And it's brought to you by Sentry.
- 1:41Don't let those errors go unnoticed.
- 1:43Use Sentry.
- 1:45Get started at talkpython.fm/sentry.
- 1:47Eric, welcome to Talk Python To Me.
- 1:50Thank you.
- 1:51It's very nice to be here.
- 1:52It is very nice to have you here.
- 1:53The last time we were sitting around talking was at a beautiful cocktail bar
- 1:58at the tail end of PyCon 2023 in Salt Lake City.
- 2:02Not a bad place to wrap that up.
- 2:04No, it was very nice.
- 2:05What a fun event.
- 2:06We're going to talk about how people go from being a beginner-ish.
- 2:11That's a pretty broad term of what a beginner is in Python and programming.
- 2:16And sort of moving towards, you know, how do you take that journey, maybe more deliberately,
- 2:22a little more quickly, to the expert side of the software developer spectrum?
- 2:26It's going to be a lot of fun.
- 2:28Yes.
- 2:28Yeah.
- 2:28And so before we get into that, though, let's just start with your story.
- 2:32How did you get into programming Python?
- 2:34How did you end up writing books?
- 2:36All those things.
- 2:37Oh, boy.
- 2:38I have to be careful because it's a long story and I like telling it.
- 2:41I was fortunate in that my father was a software engineer in the 70s and 80s.
- 2:46And so when I was growing up, we had a kit computer in our basement before most people had home
- 2:52computers.
- 2:53So I got to write my first program as a basic number guessing game.
- 2:58When it was all about the go-tos?
- 2:59Yes.
- 3:00Line 10.
- 3:01Go to 10.
- 3:01What is your number?
- 3:02Yeah.
- 3:03Exactly.
- 3:03Yeah.
- 3:04I always had an interest in programming.
- 3:05And so I got to watch in real time the development from basic to logo for teaching kids to C to
- 3:12Pascal, Fortran, and all that variety of languages that led up to Python.
- 3:16My journey into Python was I was using Java in the early 2000s.
- 3:22And I thought I'd be a Java programmer for life.
- 3:24And a friend told me that, hey, you should check out Python.
- 3:27Your Java programs would be about a third as long as they are.
- 3:30Your programs would be about a third as long as they are in Java.
- 3:33And I couldn't really believe that because it's a pretty big claim.
- 3:37But I tried to end it.
- 3:38Yeah, that's a bold claim.
- 3:39Yeah.
- 3:39And it worked.
- 3:40And I was amazed.
- 3:41And people talk about this, but it was just plain fun.
- 3:44There was something more fun for me about writing Python code than Java.
- 3:48And I have never really looked back.
- 3:50That's a bit of an exaggeration.
- 3:52I do keep my eye out for other languages.
- 3:54I don't always assume that Python is always going to be the best for me.
- 3:57And I certainly use other languages as appropriate.
- 4:00But my core, I need to do something.
- 4:02I don't have a particular reason to choose another language.
- 4:04I do everything in Python.
- 4:05Yeah, I'm very similar in a lot of ways, actually.
- 4:08My background was in C# and C++, not Java.
- 4:12So a little bit different, but more similar than different, right?
- 4:16And I recall coming to Python and thinking at first, like, it's kind of a weird, interesting,
- 4:22but weird language.
- 4:23It's white space stuff.
- 4:24I don't know.
- 4:24Curly braces are pretty tried and true.
- 4:26What are we doing with all this?
- 4:27And before I really became super comfortable with Python and just like, yeah, that looks at
- 4:33it.
- 4:33It feels great.
- 4:34It feels right from how I perceived programming should be.
- 4:38I went, worked with it for a while, went back and why are all these symbols on the page?
- 4:43Like how it's just in the way of reading.
- 4:45And, you know, I used to thought I had to have the parentheses on the if statement, but it turns
- 4:50out you don't.
- 4:50So why does this language make you write the parentheses?
- 4:52And, you know, all those things, you're just like, what?
- 4:54What a hassle.
- 4:55Not even the static typing, just the, just the syntax is more syntaxy.
- 5:00And I'm kind of interested in how your experience with that was.
- 5:04Yeah, I'm going to save that for a little bit because it's going to come up in,
- 5:07in the points that we go over.
- 5:09I'll share though that for my background, that's one of the big piece that, that plays
- 5:13into all this.
- 5:13I, I went into college, into undergrad, focus on chemical engineering because I had a really
- 5:20good chemistry teacher in high school.
- 5:22And I thought I wanted to apply what I knew about chemistry in my intro chemical engineering
- 5:27classes.
- 5:27We were doing problems about running nuclear power plants.
- 5:30And I was like, gosh, I don't want to run a nuclear power plant.
- 5:33And I really enjoyed my physics classes because they were just playing about understanding.
- 5:37how the world works.
- 5:38So I ended up doing an undergrad in physics and I tutored throughout undergrad because so
- 5:43many people struggled with math and science, the two subjects that I loved the most.
- 5:48And I found that most people who struggled, it was because of how they were taught, not
- 5:53the subject material itself.
- 5:54And so I got a strong interest in teaching and I wanted to be a particle physicist, but
- 5:58I didn't want to be a student forever and get on the PhD track right away.
- 6:02So I started teaching and I loved teaching.
- 6:04I found that the challenge of reaching every person in a classroom was as hard as hard and
- 6:10satisfying as hard science.
- 6:12And so I just stayed in teaching.
- 6:14So I taught public school, fifth grade through high school for about 20 years.
- 6:18And I would, I was a hobbyist programmer throughout all of that.
- 6:21And so I taught intro programming classes whenever I could.
- 6:24And in the early 2010s ish, I was looking for a Python book that I could give my more motivated
- 6:29students and just kind of stand on the sidelines and answer their questions and let them go at
- 6:34their own pace.
- 6:34But everything either made too many assumptions about what you already knew, or it was written
- 6:40for kids and kind of spoke down to you.
- 6:41And so that's how I ended up writing a book because the book I wished to teach from did not
- 6:46exist.
- 6:47Sure.
- 6:47I know how that feels.
- 6:48Yeah.
- 6:48Yeah.
- 6:48What's the title of the book?
- 6:49Share that with everyone.
- 6:50That is Python Crash Course.
- 6:51No starts, right?
- 6:52Yes.
- 6:53From no starts.
- 6:53And it's been the bestselling introduction.
- 6:57It's been the bestselling Python book for close to 10 years now, which is really satisfying
- 7:01because I kind of had a 10 year vision.
- 7:04I had the naive notion that I could write a book in the summertime and then revise it during
- 7:09the school year and it would be done.
- 7:10And it was two and a half years instead of that.
- 7:14So I had a 10 year vision.
- 7:16I thought if I'm going to do all this work, then I should support the book for 10 year period.
- 7:20And so it's been very satisfying to see it be meaningful to so many people over that.
- 7:24Yeah.
- 7:25That's really awesome.
- 7:26So your book is in like LTS, long-term support.
- 7:29Say that again?
- 7:29It's an LTS release of the book, a long-term support, right?
- 7:32Not one of those off-brand releases.
- 7:35Right, right.
- 7:36No, that's really great.
- 7:37And it's cool to connect with so many people.
- 7:39You probably go to PyCon and other events and people are like, oh, I read your book.
- 7:44And it really, you know, probably have stories to tell you about it.
- 7:46Yeah.
- 7:47It was amazing.
- 7:47You know, you go to PyCon or any of these conferences and you see a bunch of booths
- 7:51with people hiring or selling something.
- 7:53And I used to go to those booths and just have conversations.
- 7:56And a year or two after the book came out, those people started telling me, oh, hey, I
- 8:01learned Python from your book.
- 8:03And I was amazed at how quickly people could learn Python and then start to work at these
- 8:07companies and organizations.
- 8:08Yeah.
- 8:09Yeah.
- 8:09It's interesting.
- 8:10So they learn Python through your book and now they're working at Bloomberg or whatever.
- 8:14And now they're talking to you through these booths.
- 8:16Interesting.
- 8:16Got it.
- 8:17Yeah.
- 8:17And as a teacher says, I'm glad to say I've read that book and learned a lot from
- 8:22it.
- 8:22Yeah.
- 8:22Very cool.
- 8:23Yeah.
- 8:23I'm glad I worked for you.
- 8:24Yeah.
- 8:25I was going to say, you know, as a teacher.
- 8:26Yeah.
- 8:27I have always been happy for my students to end up better at whatever I introduced them
- 8:31to than I am.
- 8:32My focus has been on teaching for a long time.
- 8:35And so I learned my subject well enough to be able to do whatever I need to with them.
- 8:38But anybody who chooses to focus on one area over a lifetime is going to be better
- 8:43than I am at it.
- 8:44And so meeting those people at the booths who are honestly now probably better programmers
- 8:48are certainly within their discipline than I am.
- 8:50It's a privilege.
- 8:51Yeah.
- 8:52So along this idea of how do you go from beginner just starting Python to whatever we call intermediate
- 8:57or advanced or expert.
- 8:58It's an interesting, interesting topic.
- 9:01And I think it's one that really deserves some attention.
- 9:03I think it does too.
- 9:04I think I hear for so many times from beginners, like I'm learning the language or I'm learning
- 9:09this or I'm learning that.
- 9:11And now I just don't really know what to do to keep making progress.
- 9:15Right.
- 9:15Right.
- 9:15And you mentioned your situation where you are sort of a hobbyist programmer to some degree.
- 9:21Right.
- 9:21And you just compared it against people who are, you know, maybe scaling out some DevOps
- 9:25thing at like a huge tech company.
- 9:27Right.
- 9:28Those are really different ways you spend your day.
- 9:31Right.
- 9:31As a hobbyist programmer, you have something you're interested in.
- 9:34Maybe you, you poke at it a little bit, you work at it, but you don't have the real
- 9:39demands of it's, it's got to work at this crazy scale.
- 9:41And also that it something you can, can you focus your entire effort on all day.
- 9:46Right.
- 9:46Cause you're, you're teaching or you're, you're doing other things besides that.
- 9:50Right.
- 9:51As a hobbyist.
- 9:51Yeah.
- 9:51And I think that, you know, when we label ourselves or others, beginner, intermediate
- 9:57expert, beginner is the one label that is objective or I've never programmed before.
- 10:02I'm a beginner or I have never used Python.
- 10:04So I'm a beginner at Python.
- 10:05Although even that, if you're experienced in another language, it's hard to call yourself
- 10:08a beginner again.
- 10:09Exactly.
- 10:10And then, you know, when I've looked at say intermediate resources, it's a hard world
- 10:15to classify and categorize because what is intermediate?
- 10:18And I think it's good to recognize that in the early days of a language, say like mid nineties
- 10:24to 2000 for Python, the language was small enough that somebody could call themselves an expert
- 10:29at some point.
- 10:30I know everything that there is in Python and a language is so big and the ecosystem is so
- 10:34huge and it covers so many domains that it's hard for anybody to objectively call themselves
- 10:39an expert in Python.
- 10:41What does that even mean?
- 10:42And so it really is about relative statement.
- 10:44Yeah.
- 10:44How do you get out of those?
- 10:46I'm just learning the language and now I'm using it.
- 10:48Those, that evaluation is interesting.
- 10:50Yeah, it is.
- 10:51And I think one, you know, it's a good point you bring up about when Python was smaller.
- 10:55There's this teacher that was a joke.
- 10:57It says, I learned Python.
- 10:58It was a good weekend, you know, which there's a truth to that.
- 11:02And it's, it's also cute, but at the same time, I've been doing this for many years and
- 11:06I'm still learning Python all the time, right?
- 11:09Yes.
- 11:09How do you square those two things?
- 11:11How can those both be true?
- 11:12And part of what that, the difference is, that's not obvious, I think to beginners, but
- 11:18it's obvious to you.
- 11:19When that person said, I learned Python, it was a good weekend.
- 11:21They meant they rocked the for loop.
- 11:24They can create a class and they can create a function, you know, that's, they can do if statements
- 11:29and they now write and instead of double ampersand.
- 11:32That is one interpretation of what Python is.
- 11:35But then you look at PyPI with its, I haven't read the numbers in a few weeks or something,
- 11:41but it's close to half million packages.
- 11:43If you completely, truly learned a new package every day, you're still falling behind, right?
- 11:50Continuously, every day, just nonstop for the rest of your life.
- 11:54You're like, ah, Molly, I'm more behind than I started 20 years ago, right?
- 11:57In a sense.
- 11:58And so what is Python?
- 12:00I think when people say, I want to be good at Python, I want to learn Python, I want to
- 12:05be an expert in Python.
- 12:06You need to understand that there are these different layers or tiers of what that means.
- 12:12And you can, you can be focused on one or another.
- 12:15But right, it's, it's when people are comparing, like I've done this much and I've got, I'm
- 12:21an expert at Python.
- 12:21Like, well, are you an expert at the language?
- 12:23Are you an expert in FastAPI?
- 12:24What are you an expert in?
- 12:26Right.
- 12:26And so I think just kind of setting the stage with there's different meanings to what I'm
- 12:32good at Python is.
- 12:33Yeah.
- 12:33And I'll, I'll say right now that I have a hard time classifying myself.
- 12:37I'm definitely not a beginner.
- 12:39I wouldn't necessarily call myself an expert, but I don't even know about intermediate somewhere
- 12:43between intermediate and expert.
- 12:45And I've been writing a weekly newsletter at mostly Python.
- 12:49It's on Substack.
- 12:50And I started writing a newsletter because I wanted to get out of that LTS you're mentioning
- 12:56about the book where all my writing is about a book.
- 12:59It's always about the same material.
- 13:01And so writing a weekly newsletter forces me to pick a topic each week and then be able
- 13:06to explain that well.
- 13:07And I think a lot of people think that somebody in my position just knows all this stuff and
- 13:12just write something up each week.
- 13:13And really it's a whole bunch of research every time because there's nooks and crannies around
- 13:18every topic in Python that I didn't know about after 20 years in the language.
- 13:22I mean, it's really enjoyable to fill out that understanding and then explain it well to other
- 13:26people.
- 13:26Yeah, it really is.
- 13:28Maybe final thought on this.
- 13:30Tony out there points out and says, adding on to what we were saying, and an expert in
- 13:34Python for data science doesn't necessarily look like an expert in Python for web and so
- 13:38on.
- 13:39Yeah, and I was going to add basically something similar that I would consider myself an expert
- 13:43in web development and API stuff and those kinds of things, right?
- 13:48I've been running production Python apps for a long time and really just polishing them.
- 13:53But put me in front of some machine learning situation or, you know, too much
- 13:59advanced pandas.
- 14:00And I'm like, well, I'm a beginner over here.
- 14:03And those are both also called Python, right?
- 14:05So there's just this, all these different contexts and spheres of relevance that I think people
- 14:11got to keep in mind, right?
- 14:13And it's probably good to hear them say like, you're an expert in some things, but not, it's
- 14:17not like you just know it all, right?
- 14:18Right.
- 14:19It's good to recognize that expertise in one area is oftentimes transferable.
- 14:22You aren't immediately an expert in the new domain.
- 14:26But what you've learned in one domain is oftentimes makes it easier to gain expertise in another
- 14:32one.
- 14:32Absolutely.
- 14:32Like if the data science side, right?
- 14:34You're still good at Git.
- 14:35That's not a new thing for you, right?
- 14:38You're not like, why?
- 14:38What is this source control thing?
- 14:39Like you can still completely rock that.
- 14:41But maybe you're not embracing the vectorization of style of programming and so on.
- 14:47This portion of Talk Python To Me is brought to you by GlareDB.
- 14:51GlareDB is an open source database for querying distributed data.
- 14:55Here's how it works.
- 14:56First, you connect your data sources.
- 14:58GlareDB makes it easy to connect to your data, no matter where it's stored, with integrations
- 15:03into many popular databases, data warehouses, and more.
- 15:06This includes Snowflake, Postgres, MongoDB, BigQuery, and object storage.
- 15:11Now you can query everything.
- 15:13You use the full power SQL to query your data across these many different data sources, join
- 15:19data across production databases and analytical warehouses without limits.
- 15:23Finally, you can use the tools you already know and love.
- 15:26Visualize and query your data using tools you know from Python's data science stack.
- 15:31With just a single import, you can query Pandas and Polars data frames using just
- 15:36SQL.
- 15:37You'll be asking questions, extracting insights, and driving decisions with your data without
- 15:42waiting for an ETL pipeline to move data around.
- 15:45So if you have distributed data and disparate data sources, and you love open source, you
- 15:50owe it to yourself to give GlareDB a try.
- 15:52Visit talkpython.fm/GlareDB to get started.
- 15:56The link is in your podcast player show notes.
- 15:58And please use the link to let them know that you came from us.
- 16:01Thank you to the team at GlareDB for sponsoring the show.
- 16:06Maybe this is a good time to start talking about the ideas.
- 16:10So what I did is I said, you know, Eric, you've got this cool book.
- 16:14How about you try to extract some ideas that you've learned from writing the book and working
- 16:19with people for this whole topic of transitioning from beginners towards the expert side of programming.
- 16:25So let's go through the list.
- 16:27Sure.
- 16:27I like, first of all, I like that structuring.
- 16:29I kind of forced me to think specifically about what I can say.
- 16:32I want to clarify.
- 16:33This isn't a countdown.
- 16:35A lot of times lists are like, here's the top 10 things you should know about Python.
- 16:38So these are ideas for specific things that people can do to move away from wherever you
- 16:44were as a beginner and more into that intermediate and expert and be comfortable with justifying
- 16:49that.
- 16:49So for this kind of list, I start with the most important things first because everything
- 16:54else builds on that.
- 16:55And so when I think about what do people need to do to move away from beginner and towards
- 17:00being fluent and comfortable and competent and able to solve a variety of problems, the
- 17:05first thing is when you're learning, know your goals.
- 17:08Why are you learning in a program?
- 17:09And so we see this all the time.
- 17:11If you follow conversations about learning Python, I want to learn Python.
- 17:14Okay.
- 17:14But should I focus on?
- 17:16Well, what are your goals?
- 17:17Why are you learning it?
- 17:18What do you want to do?
- 17:19And I think the answers to that tend to be, I just like programming.
- 17:23I'm curious.
- 17:24For a lot of people, it is about money.
- 17:26People know that software development jobs can pay well.
- 17:30And I think it's quite appropriate and reasonable and important to name that if that is one of your
- 17:36goals and there's nothing wrong with that.
- 17:37Right.
- 17:38And also it could be career, but not money in the sense that.
- 17:41I have a decent paying job now, but I don't like my job.
- 17:44If I could just have the same money, but actually work on programming all day, that would be awesome,
- 17:49right?
- 17:49Yes.
- 17:50Yeah.
- 17:50The money thing comes up for me because I'll say one of the things I'm proud of as an author
- 17:55is I've replied to pretty much every single email anybody has ever written to me about the book.
- 18:00I think that's part of why the book has done well, because I notice I look for patterns.
- 18:05And so if people start to write about the same thing, then I adjust the book a little bit to
- 18:09address that.
- 18:10And so it keeps my email volume reasonable, but also it means it's still meeting the needs
- 18:14of readers.
- 18:15But it also means I've had interactions with thousands of readers.
- 18:18And one of the things that comes up in anything that goes beyond a, can you help me fix this
- 18:23one problem?
- 18:24I oftentimes ask like, what are you learning this for?
- 18:26What's your, what's your story?
- 18:28And a lot of those people are doing career transitions.
- 18:31It's a mix of people looking for better pay.
- 18:33And oftentimes that's tied in with to support my family.
- 18:35Those larger life decisions other than just, you know, it's never greed.
- 18:39It's never, I want to be rich.
- 18:41It's always, I want to, to live reasonable life.
- 18:44And what you say, people being tired of a different line of work and looking for something where
- 18:49they can have more power, more, more independence, more control.
- 18:52You know, when you say know your goals for most people, their goals, it's not one goal.
- 18:56It's a balance of those.
- 18:58And recognizing where your balance sits is really important because it guides the rest
- 19:03of your learning and what you do.
- 19:04Yeah, it absolutely does.
- 19:06Somebody who's just plain curious.
- 19:07Go ahead.
- 19:08Sorry.
- 19:08Well, yeah.
- 19:09And I think when we're talking about beginners, there's a lot of people who get pulled into Python
- 19:15without an explicit intent of becoming a software developer.
- 19:19In fact, like they would maybe start out by saying, I don't want to be a software developer.
- 19:23I'm a biologist.
- 19:24I'm an economist.
- 19:25I'm a philosopher or whatever.
- 19:27But I need a little bit of programming because I learned that if I do these six lines of
- 19:32Python, like magic happens way better than if I had to force it through Excel or something.
- 19:37Right.
- 19:37And I think a lot of the beginners are in that realm of like, well, I'm here now.
- 19:42I'm still not a programmer.
- 19:43Don't call me one of those.
- 19:45But I use programming for my thing.
- 19:47And that's also a pretty interesting angle, I think.
- 19:50Yeah.
- 19:51And I think that's a really, really good thing for people to recognize.
- 19:53It is interesting to have this conversation about labels and beginners and intermediate.
- 19:57Because how do you know when you're no longer a beginner?
- 20:00One of the clearest signs is when you have used programming to solve a real problem that you have.
- 20:06And you can throw in like with a level of understanding rather than copy pasting.
- 20:11But for a lot of people...
- 20:13Or now ChatGPT also.
- 20:14Yeah.
- 20:15Yeah.
- 20:16That's a super interesting dynamic to throw into all of this.
- 20:19But that is the end goal.
- 20:20It should be the end goal for most people.
- 20:22Not just to know how programming works, but to use it to solve a real world problem that you or somebody else has.
- 20:29And so as soon as you're doing that, you can start to consider yourself moving out of the beginner place.
- 20:34Yeah.
- 20:34You might still feel awkward, but you're doing it.
- 20:36Really interesting comment that I think is worth highlighting.
- 20:39And Foxo says, I'm an anesthesiologist.
- 20:42You cannot imagine how much Python has helped me with different tasks.
- 20:45Amazing.
- 20:46That's really cool.
- 20:47Thank you for sharing that.
- 20:48Yeah.
- 20:48Yeah.
- 20:49Yeah.
- 20:49Yeah.
- 20:50Okay.
- 20:50So tip number one, know your goals.
- 20:53Like, why are you here?
- 20:54Because that'll help guide you somewhat.
- 20:56Yes?
- 20:56Yes.
- 20:57I'm taking a few notes about throwing things in there later in the list.
- 21:01Beautiful.
- 21:01All right.
- 21:02I agree.
- 21:02I think it's important to know your goals.
- 21:04And there's a lot of reasons why people get into programming, right?
- 21:07And so...
- 21:09Yeah.
- 21:09Last thing on that is if somebody is just plain curious, as far as teaching and learning,
- 21:13if somebody is just plain curious, that's their main goal, you have a lot more flexibility
- 21:17in the examples you present to them and the pace at which you present material, as opposed
- 21:22to somebody who says, you know, I really want to do a career transition as soon as possible.
- 21:25That person needs a much more grounded and practical and timely approach.
- 21:30Well, and you also might look out and say, okay, web framework do I need to choose?
- 21:34What database experience do I need to get?
- 21:36Because I'm looking at Indeed job listings and I'm trying to hit the largest set of those
- 21:42rather than what project am I trying to work on or what am I curious about?
- 21:46You're like, I need to start checking the big boxes.
- 21:48Let's check those boxes so I can get a job in six weeks.
- 21:50Yep.
- 21:51All right.
- 21:51Tip number two.
- 21:52Yeah.
- 21:52Tip number two.
- 21:53What do you got?
- 21:53Have a project in mind.
- 21:55And so whatever your goals are, having a specific project in mind helps put everything else in
- 22:00context.
- 22:01If you are learning about a for loop and you have a project, I'm going to name one, one of
- 22:07the projects that I've worked on.
- 22:08I live in Southeast Alaska.
- 22:09And one of the impacts of climate change here is an increasing frequency and severity
- 22:14of landslides.
- 22:15And so Southeast Alaska is a rainforest for anybody who isn't aware of that.
- 22:20It's not all snow in Southeast because we're right next to the ocean.
- 22:23And so we're still getting as much rain as we always have, but it's coming instead of
- 22:27light rain throughout the year with some periods of heavy rain, we're getting a lot more nice
- 22:31weather.
- 22:32We just had two or three weeks of no rain, which was really unusual here.
- 22:36But we'll get heavier fall storms that can lead to landslides.
- 22:41And so I had a project that monitored a local river's level to correlate that with landslide
- 22:47risk and helped develop a warning system.
- 22:50And so a project like that in mind, that's a big project.
- 22:55And so if somebody is just learning Python, that's hard to say, like, here's everything
- 22:59you need to know to build that project.
- 23:00But if you're teaching a for loop and you know that somebody is interested in a project
- 23:05about monitoring climate, then you can make your for loops about processing data related
- 23:09to rainfall, river levels, things like that.
- 23:12Yeah, absolutely.
- 23:13And Python is really interesting in that you can, it's pretty good at the IoT thing as well,
- 23:19which opens up a lot of, you know, we've got CircuitPython and Adafruit and all those
- 23:23areas to play with as well, which is a whole different kind of project.
- 23:26Yeah, yeah.
- 23:27And so there's an infinite number of projects.
- 23:29And so if you have a project in mind, being clear about that with yourself and with anybody
- 23:34that you're learning with or from is really helpful as far as tailoring what you're
- 23:39learning to your purposes.
- 23:40I'm curious.
- 23:41It's always easier to teach somebody who has a specific goal in mind than somebody who
- 23:46is just vague.
- 23:46Just teach me something.
- 23:47Yeah.
- 23:47Well, because it's focused.
- 23:49Yeah.
- 23:49Right.
- 23:49I find a lot of people try to boil the ocean metaphorically when they're trying to learn
- 23:54these things.
- 23:54Like, well, I saw somebody saying, well, all these CS topics are really hard for me.
- 23:58Like people keep telling me all these CS things I need to know.
- 24:01And do I really need to know them?
- 24:03Well, maybe eventually, but not all at once.
- 24:06You know, like, what are you doing now?
- 24:09How big is your program?
- 24:10You really need testing.
- 24:12Maybe you do.
- 24:13Maybe you don't.
- 24:13Do you really need classes?
- 24:14Maybe you do.
- 24:15Maybe you don't.
- 24:15Do you need generators?
- 24:16Do you need anything?
- 24:17Like there's all these things that you probably could say, don't need them now.
- 24:20Maybe in a year or two, I can.
- 24:22I will need them.
- 24:23Then I'll be motivated to learn them.
- 24:25And so when you have these projects, you can say, I need these five things or I need these
- 24:29four things.
- 24:30I need to know them.
- 24:31And then my project is working, right?
- 24:34Instead of trying to say, well, what do I start with even?
- 24:36Yeah.
- 24:37And one of the criticisms of many learning resources, and I'm a little sensitive to this
- 24:42because I've written many of these examples, is when people do a for loop and the for loop
- 24:46is about like kinds of pizza or something or toppings of pizza.
- 24:49And people look at that and say, why do I need this?
- 24:51I don't care about pizza toppings.
- 24:53Okay.
- 24:54You need that because the person creating the resource has to have something, some kind
- 24:57of context for the example.
- 24:59And so when I'm teaching a class in person, I don't come up with, all right, we're going
- 25:03to do pizza toppings.
- 25:04I ask people in the class, hey, what are you interested in?
- 25:06And then we pick something that somebody in the class that day mentions.
- 25:10And then there's relevance right there.
- 25:13You don't have that if you're learning on your own, but what you can do, if you do know your
- 25:18own project, you work through the example about pizza toppings, but then you write a loop
- 25:22that relates to the project that you want to work on.
- 25:25And so that knowing that project is really helpful, regardless of how you're, you're learning.
- 25:30Yeah.
- 25:30Let me pull up another comment.
- 25:31I think this is worth covering for people as well.
- 25:33So Bishnielder says, for me, it was all good while I was learning programming Python.
- 25:37But as soon as I was out there in real life, looking for jobs and looking at the requirements,
- 25:42it drained a lot of energy out of me.
- 25:43Suggestions.
- 25:44What do you think?
- 25:45Oh boy.
- 25:46I don't think there's an easy answer to that.
- 25:48And I think it's important to be honest about that.
- 25:51Personally, I have never worked as a full-time programmer.
- 25:54And that puts me in a weird spot for talking about things like career transitions.
- 25:58I have helped thousands of people make career transitions, but I don't sit in the interviewee
- 26:05chair.
- 26:05Not very often.
- 26:06Yeah.
- 26:07And having spent a good part of my life as a teacher, teacher hiring and teacher, the
- 26:12structure of employment for teachers is so vastly different than programming.
- 26:16Yeah.
- 26:16The timeframe of teacher teaching jobs is so weird.
- 26:19It's like, yes, there's a time sort of once a year often that you can apply or change jobs.
- 26:25And otherwise you can't.
- 26:26It's not exactly true, but generally true.
- 26:28Yeah.
- 26:28I'm in an interesting position now where I'd kind of like to work as a professional programmer,
- 26:32but honestly, I have to spend 10 to 20 hours a week supporting the book.
- 26:36That LDS stuff is ongoing.
- 26:39I know.
- 26:40I got a bunch of courses and stuff.
- 26:41I know.
- 26:42Yeah.
- 26:42I was just redoing some videos that had a mistake in them that somebody noticed.
- 26:46So anything I do is on top of that work.
- 26:48And so I can really only consider part-time work and then it becomes a, is this worth
- 26:53it?
- 26:53So to be more direct, I don't think there's an easy answer to the grind of looking for work.
- 27:00And as a network thing of once you have a job, it can be easier to find the next job.
- 27:04The couple of things I'll share for people is if you, so we talked about solving real world
- 27:09problems.
- 27:09If you have a story that you can tell about how you have, you have made something better
- 27:15through programming, what employers are looking for is that yes, you have capability for programming.
- 27:20You can pass whatever lead code tests or screenings are necessary, but also have you use what you've
- 27:26learned about programming to solve something.
- 27:28And so the stories I always come back to are people who are working non-programming jobs and
- 27:33start to learn programming and then use that to solve something in their work that they weren't
- 27:38expected to solve.
- 27:39And that becomes a huge selling point in interviews.
- 27:41My favorite story is a guy who was working for, I believe it was UPS.
- 27:45And this was quite a while ago.
- 27:46I feel comfortable telling that story, partly based on time, but they were working for one
- 27:50of these large delivery companies and they were aware of people getting fired in warehouses
- 27:55for damage to the goods that were supposed to be delivered.
- 27:58And so the person was learning Python and they wrote some data analysis and they were able to
- 28:03pinpoint that the damage was coming from a manager or management group that was not
- 28:09training end line employees well enough.
- 28:11And so that was really interesting story because the people being fired were not the people who
- 28:17are causing the damage.
- 28:18They caused the physical damage, but it was more systemic.
- 28:22Yeah.
- 28:22Yeah.
- 28:23And so that person saved their company millions of dollars and they got like a $5,000 a year
- 28:27raise.
- 28:27What they really did was they used that story in interviews to gain an actual programming
- 28:34position at a different company.
- 28:36And so it's hard when you're starting out.
- 28:40And so all I can say is look for the selling point for yourself and know that once you do
- 28:45get your first break, it becomes easier to stay on that path.
- 28:49I have one more thing to add.
- 28:50A lot of times when people are looking for their first programming job, they have experience
- 28:54somewhere else.
- 28:55I realized some people are young.
- 28:57They learn programming.
- 28:58That's kind of their totality of work experience.
- 29:01But a lot of people maybe studied something else and became a programmer like you studied
- 29:04physics.
- 29:05Embrace that, right?
- 29:06So imagine you studied, I don't know, logistics.
- 29:09Instead of trying to look for a programming job because you don't want to do logistics,
- 29:13look for a programming job at a logistics company.
- 29:15Because then you could say, I have programming skills, plus I have an expertise in your area
- 29:20of specialization.
- 29:21And once you intersect those things, you are in a much smaller set of competitors, right?
- 29:27Like I'm looking for a biology job.
- 29:29There's a ton of people doing biology.
- 29:30If I'm looking for a programming job, there's a ton of people doing programming.
- 29:33How many are doing biology and programming maybe in the specific area that you're focused
- 29:40in, right?
- 29:40That all of a sudden gives you an opportunity.
- 29:42But it also means you need to look somewhat differently for jobs, right?
- 29:46You don't go apply to FANG the same way that everyone else thinks they should apply to FANG.
- 29:50Look for these small companies because not only will they appreciate it more, you'll get a
- 29:55better chance to grow because you'll get a bigger responsibility to write more broad software.
- 29:59And the interviewing process is not nearly as terrible, I think, for small companies, right?
- 30:04Right.
- 30:05It's a chat with a couple of people and they're like, we think you can do it.
- 30:08Give it a try for a week.
- 30:10Whereas places like the large tech companies, right?
- 30:14They've got these pretty horrible, here's your take-home exercise, write it.
- 30:18We'll consider it if it works out well, maybe amongst the other thousands, right?
- 30:22It's like a really different experience.
- 30:24I think that first step in the door, that first job is the one that is hard to get.
- 30:28Yeah.
- 30:28I'll throw one more piece in there and it's a quick thought.
- 30:31And that is, you know, contributing to open source projects is something we need to be careful
- 30:35about because oftentimes it's privileged work.
- 30:37You have some extra time and you can do that.
- 30:40But one of the real benefits of making meaningful contributions to established open source projects
- 30:46is it throws you all the way into professional workflows of managing, you know, using source
- 30:52control and just the bigger piece, communicating with a larger team.
- 30:55So as I've gotten more into open source, for me, that scratches that itch of wanting to work
- 31:03as a professional programmer.
- 31:04It's hard to simulate.
- 31:06Yeah.
- 31:07It's hard to simulate proper CI, CD, merge conflict, PR discussions on your own little
- 31:13hobby project.
- 31:14That's for sure.
- 31:14This portion of Talk Python To Me is brought to you by Sentry.
- 31:19You know Sentry for their error tracking service, but did you know you can take that all the
- 31:24way through your multi-tiered and distributed app with their distributed tracing feature?
- 31:28Distributed tracing is a debugging technique that involves tracking requests of your system,
- 31:34starting from the very beginning, like a user action, all the way to the backend, database
- 31:38and third-party services.
- 31:40This can help you identify if the cause of an error in one project is due to the error in
- 31:45another.
- 31:45Every system can benefit from distributed tracing, but they're especially useful for microservices.
- 31:50In this architecture, logs won't give you the full picture, so you can't debug every
- 31:55request in full just by reading the logs.
- 31:57Distributed tracing with a platform like Sentry gives you a visual overview about which services
- 32:02were called during the execution of certain requests.
- 32:05Aside from debugging and visualizing your architecture, distributed tracing also helps you identify
- 32:11performance bottlenecks.
- 32:12Through a visual like a Gantt chart, you can see if a particular span in your stack took longer
- 32:17than expected and how it could be causing slowdowns in other parts of your app.
- 32:21Learn more and see some examples in the tracing section at docs.sentry.io.
- 32:26To take advantage of all the features of the Sentry platform, just create your free account.
- 32:31And for all of you Talk Python listeners, use the code TALKPYTHON, all one word, and you'll
- 32:36activate a free month of their premium paid features.
- 32:39Get started today at talkpython.fm/sentry-trace.
- 32:44That link is in your podcast player show notes and the episode page.
- 32:47Thank you to Sentry for supporting Talk Python To Me.
- 32:52So we're number two.
- 32:54We'll cover, get a project.
- 32:55Yeah, we can go through some of these a little faster.
- 32:57Yeah, no, of course we can.
- 32:58What's number three?
- 32:59Number three is don't limit your learning to what's needed for your project.
- 33:02So it's important to have a specific project in mind to give context for what you're learning
- 33:07and give purpose and steer you towards feeling success and knowing like what's good enough.
- 33:14But always be ready to expand your toolbox and your understanding and it'll serve all your
- 33:18projects in the end.
- 33:20And learning is fun.
- 33:21Learning in good ways is fun.
- 33:23Learning with good resources, with good people.
- 33:25You want to learn FastAPI, here's your FastAPI worksheet.
- 33:28The answers are in the back.
- 33:29Yeah.
- 33:30I have a kid in middle school, so we shouldn't talk about worksheets.
- 33:34But a quick example is I'm working on a project called Django Simple Deploy that automates
- 33:41deployment for projects in Django.
- 33:43It's not just for beginners.
- 33:44When Heroku collapsed its free tier a couple years ago, we saw a bunch of very experienced
- 33:49Python web people en masse go look at other platforms.
- 33:53And we saw them talking about how difficult it is to go through each platform's documentation
- 33:59and get a simple app deployed just to see the process.
- 34:02And so this tool is a core command, manage.py simple deploy.
- 34:07And then you name the platform and it configures your project for that platform.
- 34:12And then you can push it.
- 34:14And so it's set up as a core command that then calls out to a platform-specific command
- 34:20and configures your project for those commands.
- 34:22And so when I first wrote it, my first pass was just a bunch of classes that they work together
- 34:26because I wrote them and they're all nice.
- 34:29But I had learned about abstract-based classes but never had a purpose for using one.
- 34:33And so when this project is becoming, as this project is becoming more refined, I need to enforce a structure so that the platform-specific code works with the platform agnostic code.
- 34:44And so if I hadn't, or I should say this the positive way, because I had done some general learning about more advanced object-oriented principles,
- 34:54I have some sense of how to enforce that structure as the need arises.
- 34:59So it's good to have a project in mind, but don't limit what you're learning just to that project because you'll become a better programmer and you'll do your projects better.
- 35:06Sure.
- 35:06One of the ideas I think is really powerful is that inspiration is perishable, right?
- 35:13If you are inspired about something, you might not be that inspired in a couple of weeks.
- 35:17And that doesn't mean it's not cool anymore.
- 35:19That just means, you know, you moved on, your focus is elsewhere, whatever.
- 35:24And so, yeah, sure, you need to learn the things you need to learn to do your project or to check some boxes.
- 35:29But if you find something, you're like, I am really interested in that.
- 35:34Like, you know, leverage that inspiration.
- 35:36I don't know about other people, but for me, I'm like two or three times more productive in learning and writing code and all sorts of things.
- 35:44If I'm like really on fire about something versus like, ah, I guess I'll get in there and like fix that bug.
- 35:49And like something that I'm not inspired about is MailChimp just changed their API and deprecated their, you know, shut off their old one.
- 35:56So now to have people on my mailing list, I got to go rewrite that.
- 35:59There's no, what I get in the end is I get to just keep having them on my mailing list.
- 36:03There's zero inspiration there.
- 36:04But if I ran across like, oh, there's this new feature in Python 3.12, or there's this new package that I found on PyPI that's awesome.
- 36:12Like, and I just really want to like leverage that.
- 36:15Right.
- 36:15But while it's, while it's there, take advantage of it.
- 36:18All right.
- 36:18Number four.
- 36:19Yeah.
- 36:20Number four.
- 36:20What do we got?
- 36:21Read good code.
- 36:22And this is one of those things that I wish I had been told a lot earlier in my programming career than I was.
- 36:29I went a long time, decades, just looking at code that was presented in the classes and books I read and then writing my own code and then only reading what I needed to in order to do my projects.
- 36:41And then at some point, I forget if I saw a suggestion to do this or if I just started to do it out of curiosity.
- 36:47I think it was probably around the time when a lot of code became very visible through platforms like GitHub.
- 36:53But if you're using a library like, say, Pandas, that is out in the open.
- 36:57And so rather than just using Pandas functions, you can go look at the code that runs that function.
- 37:06So Pandas has, I shouldn't say Pandas because I'm just starting to get more fluent with that, more comfortable.
- 37:11So I'll say like matplotlib.
- 37:13So if you're making a scatterplot, fig.scatter or something like that, you can go look at that scatter function and see what it does.
- 37:19You see the full set of arguments that it can take.
- 37:22You see all of its capabilities.
- 37:23And you see how the people writing and maintaining matplotlib take your information and turn it into a plot.
- 37:30And when you look at that code, you're seeing professional quality code.
- 37:34It can be overwhelming.
- 37:36There's probably going to be parts that you understand and parts that you don't.
- 37:38But the more you look at it, the more you understand.
- 37:40And you start, your code becomes better because you're seeing high quality code.
- 37:44It's good to recognize that those people writing that did not write that polished code the first time they wrote the scatter function.
- 37:50So don't think, I'm a bad programmer because my code doesn't look like this.
- 37:55The polished code that we look at from large, popular, well-established frameworks has been well-refined.
- 38:00And so it's something to aim for.
- 38:02Yeah, it totally is.
- 38:04It's one of those things that's hard to get experience with if you're kind of not yet working as a professional developer.
- 38:10Or even if you are, but you're a one to two person shop where you don't collaborate a lot.
- 38:16Right.
- 38:16Right.
- 38:17It doesn't have to be that you're not working as a pro, you know, working as part of your job in that, right?
- 38:23It could be that you just don't have enough collaboration or enough people.
- 38:26Yeah.
- 38:27Yeah.
- 38:27And a good thing.
- 38:28So good advice.
- 38:29It could be hard to know where to look.
- 38:30All right.
- 38:31So if I look at the Python source code giant, I have no idea where to look.
- 38:34Look at the most recent commits.
- 38:35So just pick a commit, look at the files that were changed and get some sense of what people are doing to modify the language and these larger libraries.
- 38:44Look at the newest issues.
- 38:46What are people discussing about what they're trying to work on and how they're trying to solve that?
- 38:50And maybe look at some of the longest open issues.
- 38:52What are the hardest problems that people are wrestling with in some of these projects that we all use?
- 38:58All good advice.
- 38:58I would say the larger the open source project and the more popular, maybe harder it is to read, you know, because it has to be more polished and more optimized and more, you know, it's just it's got that extra layer of, well, it's going to make it harder to read, but it'll make it 2% faster.
- 39:17And people will appreciate that.
- 39:18So we're going to do that.
- 39:19Whereas there's a tier below that of open source things that are professional level, but not yet kind of beyond approachable.
- 39:28Yeah, I did two newsletter posts recently about exploring recent Python repositories to get at this exact issue.
- 39:35So the idea, if you're looking at contributing to Django, it's hard.
- 39:38Django community is doing a lot of work to make it more approachable for people wanting to contribute.
- 39:43But it's absolutely true that it's hard to contribute to and get into larger, well-established code bases.
- 39:49So I use the GitHub API to find, say, all the Python projects that have pushed to GitHub in the last three weeks that have at least 10 stars.
- 39:58And those are the fresh projects that are getting attention.
- 40:00We don't have all this long-term stuff.
- 40:03And so I ended up actually contributing to one of those projects because it's just what you described earlier, just pulled me in and fascinated me.
- 40:09And it's so nice to have some concrete contributions to a project that is in that fresh stage.
- 40:14Yeah, that's fantastic.
- 40:15All right, what's the next one?
- 40:17Know your tools.
- 40:19I laugh at this one because I think about this is one of the reasons I transitioned into an equal focus between programming and teaching.
- 40:28I used to, my priority was 98% teaching and 2% programming.
- 40:32And now I'm probably 60% program, 40% teaching.
- 40:36Tools for teachers are terrible.
- 40:39Teachers, public school teachers still write most of their lesson plans in Microsoft Word.
- 40:43And that sounds like, oh gosh, they just have to like write out onto a blank page.
- 40:48But what it really means is we as programmers are used to working with structured data.
- 40:53And so if we have a workflow and we're writing something and then we update the structure of our information, we don't have to go back and rewrite everything.
- 41:01We have tools that manage restructuring projects.
- 41:04If you write three years of lesson plans in Word and then you figure out how to teach better and you want to restructure all your lessons, there's no automated way to do that.
- 41:13It's a mess.
- 41:13And so I'm grateful as a programmer to have things like IDEs, formatters, linters, Git, any version control system, GitHub hosting platforms.
- 41:23And so my core advice here is to, as you're becoming more established as a programmer and as a Python programmer, start to recognize what are the tools that you personally find value in?
- 41:35What is your favorite IDE?
- 41:36What is your preferred formatter?
- 41:38What's your preferred linter version control system?
- 41:41And then just take a little time to focus on that tool itself.
- 41:44So if you've been using VS Code for six months, spend three days and just read about configuring VS Code.
- 41:50You'll almost certainly come up with some things that make your day-to-day work more efficient, more effective, more enjoyable.
- 41:56Every time I've taken time to do this, I've come out better for it.
- 42:00Yeah, whether it's VS Code or PyCharm, they both have a ton of options that you can pick from.
- 42:06They're discoverable or less discoverable in different ways.
- 42:09Like PyCharm makes it kind of obvious what all the things it can do, but there's so many things that people are like, well, I'm just going to stick to my lane and just stay over here and do the thing.
- 42:18VS Code is a little less discoverable.
- 42:21But maybe it makes it even harder to take full advantage of it because it's like the command shift P to pull up the palette and then like, well, there's a huge list.
- 42:28What'd I do with this?
- 42:29Yes, yes.
- 42:30But they're being really good with your editor.
- 42:33I know some of the things that are coming as well on your list, this adds on top of it, but it makes a huge difference.
- 42:39It makes things like being comfortable navigating your code feel better, testing your code, changing your code, right?
- 42:46Doing some of these workflows you talked about, like Git and PRs, all of that stuff.
- 42:51All of those things are in those tools, plus way more.
- 42:54That's not even talking about the extensions or plugins that you might go after, right?
- 42:58And so, but it's easy to see like, well, I've fired it up and then now it's an editor, right?
- 43:04It's a thing and then, oh, it has cool autocomplete.
- 43:06And then just kind of forget about the hundred other things that it can help you with.
- 43:10Yeah.
- 43:10And particularly with IDEs, they do a lot for us.
- 43:13And that can be a good thing and it can be a bad thing.
- 43:16I have steered a lot of people back towards simpler editors like Sublime Text and even Genie is a fantastic one that a lot of people don't know about.
- 43:24Because the tools like VS Code, PyCharm, whatnot, when everything's working, what they do for us is fantastic.
- 43:31When things stop working, if you don't know what it's trying to do for you, it can just make things much more confusing.
- 43:36And particularly that comes down to things like tools that build virtual environment for a new project for you.
- 43:42So if you understand what that's doing and it stops working, you can go troubleshoot it.
- 43:46But if you don't know what it did for you and now like it says this module is not found, it can be a mess.
- 43:52And so, yeah, you can.
- 43:53Virtual environments seem to be just like, they just go wrong so often.
- 43:58Yeah.
- 43:58I'm not in the pure, I've created one on the terminal and like I've acted, like that's solid.
- 44:04But in the tooling, it's like, sometimes it finds it, sometimes it doesn't.
- 44:08Sometimes it really doesn't want to find it.
- 44:10You know, like it's nuts.
- 44:12Yeah.
- 44:12Yeah.
- 44:12And so I'm glad you brought that up.
- 44:14So the core advice there for me has always been people have a tendency to want to go find another editor or IDE that's going to manage that better.
- 44:22And what I tell them is, no, it's going to manage it differently and you're going to run into the same issue and then you're going to need to solve it.
- 44:27So when that stuff happens, taking the time to learn what your editor is doing for you and then be able to troubleshoot that, that's going to serve you well in the long run.
- 44:36All right.
- 44:36What's next?
- 44:37Learn how to test your code.
- 44:40And I wrote here, you won't sleep more, but your sleep will be more restful.
- 44:44I went probably 20 years programming without ever writing a test.
- 44:47And I always had this notion that it was difficult.
- 44:50It was separate from programming.
- 44:51And the first time I wrote a test, it was so much easier than I thought.
- 44:54And so cool to see my program run automatically and have the output validated.
- 45:00I love testing.
- 45:01It's probably my biggest interest these days beyond deploying Django projects.
- 45:05And I love it because, you know, when we write code, we want it to work.
- 45:09When we have a project, we want our project to be successful.
- 45:13And so testing validates that.
- 45:15Testing gives you confidence that your project is working correctly.
- 45:20And if you fix a bug, you just fix it once.
- 45:22So testing is its own podcast for some people.
- 45:25So I'll just say that testing is easier than a lot of people think it is.
- 45:29Go use pytest.
- 45:30I used to teach unit tests because it's in the standard library.
- 45:33But pytest has become well established enough.
- 45:36It's one of my favorite Python packages of all because it's one of those few that serves
- 45:41pure beginners and experts equally well.
- 45:44It's the best way to be introduced to testing.
- 45:47And if you're testing professionally, there's no tool better than that.
- 45:50That's the Zen of Python, right?
- 45:52That it's really serves beginners well, but also experts well.
- 45:55I think that's one of its special capabilities.
- 45:58Yeah.
- 45:58I will encourage people.
- 46:00And Michael, I'd be curious if you agree with this or not.
- 46:03I'd encourage people to not necessarily look at unit tests right away because unit tests are
- 46:08brittle for newer projects.
- 46:09I really like end-to-end testing.
- 46:11And that is where you run your project, you get some output, and then you run tests against
- 46:15that output.
- 46:16And that is not testing the implementation of your project.
- 46:19That's just saying, does your project work?
- 46:22And so the project I've been pulled into recently is one called git-sim, git-sim.
- 46:26And you run it against your own project, and it gives you a visualization of all your commits.
- 46:31And so for people trying to understand how git works or how git is working for their particular
- 46:35project, you run git-sim merge, and it shows you visualization of what that merge would
- 46:41look like.
- 46:41And so that project is newer, and it had no tests.
- 46:44And so I helped write the initial test suite.
- 46:47And I told the person, like, we shouldn't test your implementation because you should
- 46:52be free to change how you're building this new project, but we should absolutely start
- 46:56to test the images that you're generating so that when you do change your implementation,
- 47:00you know whether the images that your users are going to see are the ones that you think
- 47:05that you've been seeing and you think they're going to see.
- 47:08And so that's really nice because you don't have to aim for 100% coverage of your code.
- 47:13You just start to get that big picture.
- 47:16Yes, my project is still doing what I think it's doing.
- 47:18That makes for better sleep, and all of your non-computer activities are more enjoyable because
- 47:23you have more confidence that things keep working.
- 47:25Yeah, I'm with you on not going too far down the unit test side.
- 47:29I used to write tons and tons of very low-level focus unit tests.
- 47:34And when I was on a team, I always had a hard time having everybody have buy-in.
- 47:39Some people would.
- 47:40Some people wouldn't.
- 47:41They'd go do something that would break the test.
- 47:43You're like, you broke the bill.
- 47:45They're like, oh, yeah, I guess I did.
- 47:47You're like, you realize that we don't all participate in this.
- 47:51It just becomes a hassle for me, chasing after, trying to patch up the tests as you make these
- 47:58changes.
- 47:58And as you're lower level in the world, that's just a more constant problem.
- 48:04And it also requires more effort, right?
- 48:07So maybe that effort is worthwhile.
- 48:08But if you're new, maybe it's not.
- 48:10And so I'm a little bit more on board with just like, let's do the main things at kind of
- 48:16top to bottom in the app.
- 48:17And if that stuff hangs on, we got a real good chance.
- 48:20And over time, my experience has been, for the most part, things blow up hard.
- 48:26They don't just like, oh, there's some little subtle problem.
- 48:29Generally, not always true, but generally, like if I screw something up, a lot of tests start
- 48:34failing, even when they're these high-level things, because something's pretty, pretty messed
- 48:38up.
- 48:38And in that regard, that other person probably didn't intend to change the output or the overall
- 48:43behavior of the app in well-known ways.
- 48:46They just changed some implementation detail, and they weren't being sufficiently rigorous
- 48:51with their software lifecycle.
- 48:54So yes, I'm on board.
- 48:56The web equivalent, the easiest web equivalent that I can think of is if you've got a website
- 49:01and it has a sitemap, your website should have a sitemap for all of your data-driven pages.
- 49:06Just go get the sitemap and request every page.
- 49:09Does it give you a 200 or does it give you a 500 or a 404?
- 49:12Because 404s and 500s should not be found in your sitemap.
- 49:16Right?
- 49:16But that's a really easy test, right?
- 49:19Like loop over that, call every one of those with your, you know, self.client.get or whatever
- 49:24your HTTP test thing looks like.
- 49:26And just call all of them.
- 49:27That's one thing you could do that's in that category.
- 49:30And as an author, I wrote tests for most of the code in Python Crash Course.
- 49:34And so Python Crash Course was first written, I think, on Python 3.5.
- 49:38And so it's been through like, what, six or seven iterations of Python and all kinds of
- 49:42iterations of the libraries that the projects use.
- 49:45And so whenever a new issue comes out or new, sorry, version comes out, I just run tests
- 49:50on most of the code in the book.
- 49:51And it pulls the test pulls the code from the GitHub repository for the book and just runs
- 49:56it with the new versions.
- 49:57And that's been part of how I've been able to maintain the upkeep and maintenance
- 50:02on a 500 page book that covers a lot.
- 50:05Yeah.
- 50:06Yeah.
- 50:06That's awesome.
- 50:07Yeah.
- 50:07Let's keep going.
- 50:08There's a couple of good comments and questions in the audience, but I think we're on, we're on
- 50:13a schedule.
- 50:13So let's keep going.
- 50:14Yeah.
- 50:14Yeah.
- 50:15Last comment about testing.
- 50:16I love it because I think that when you test your code, you learn things about your code
- 50:20that makes development better as well.
- 50:21So it's not just, does it work?
- 50:23It's also gives you insight into, into how your code is working.
- 50:27I'm looking forward to exploring more.
- 50:29All right.
- 50:29Next point.
- 50:30Know what's good enough for any given project.
- 50:32As a teacher, students would say like, am I done?
- 50:35Am I done?
- 50:36Is this good enough?
- 50:37And I watch other teachers say like, don't ask me that.
- 50:40Always work harder.
- 50:41And I always tell the students, that's a great question.
- 50:44What is good enough?
- 50:45And so whatever your project is, knowing your benchmark for what's good enough and when
- 50:49it's done, when you can move on to the next thing is really helpful because you'll never
- 50:53write perfect code, but you can certainly write good enough code.
- 50:56Yeah.
- 50:57And there was a really popular article, blog post, something like that, that was, you're
- 51:02not Facebook.
- 51:03You're not Google.
- 51:04You're not Microsoft.
- 51:05You're not LinkedIn.
- 51:06Something along those lines.
- 51:08Right.
- 51:08And the admonishment or the advice there was, you might read about how somebody like Google
- 51:14has this, all these containers doing all this scale out and failover and geo location.
- 51:21Your app that manages like reporting for managers at your app, at your company, there's five managers
- 51:28and they do it once a week.
- 51:29You don't need global scale out techniques.
- 51:32You don't need the zero downtime that containers offer.
- 51:36You don't need load balancers.
- 51:38Like none of that stuff applies to you.
- 51:40And so, in fact, I would say if you start applying those things to it, you make your application
- 51:45harder to deploy.
- 51:46You make it harder for other people and your team to work on.
- 51:50You make it less good for that situation.
- 51:53But at Google scale, the opposite is true.
- 51:56It's less good if it doesn't have those things.
- 51:59And so it's not just, well, this is a crappy project.
- 52:02So it gets crappy level CS attention.
- 52:05It's a small project.
- 52:07So it can be written and managed and worked on in a way that allows for, you know, optimizes
- 52:14for small teams, not worrying, not optimize it for uptime and all those kinds of things so
- 52:20that you can make it work better in that situation.
- 52:22And so I totally agree.
- 52:24Knowing what is good enough is super important.
- 52:27But what is good enough, it's not like a spectrum.
- 52:30Like I'm at the really good level.
- 52:31It's like you've got a, it's a multidimensional thing.
- 52:34Like you're at a good level for the context that you're in, the situation you're in.
- 52:37Hey, you're walking right into bullet point or tip number eight, I think it is.
- 52:41We are.
- 52:42Yeah.
- 52:43And that's embrace refactoring.
- 52:44And so my notes about this was that good enough is situational.
- 52:48So when a project proves its worth, like say you have an idea for a project, you build it
- 52:52out, you get an MVP functional and you've reached your good enough to see whether the idea works.
- 52:58If nobody ever uses it, it doesn't catch on.
- 53:01It worked.
- 53:02It was interesting, but it's just not catching on.
- 53:04You move on, move on to something else.
- 53:06But if that product has started to gain interest, now good enough moves.
- 53:11And so maybe it needs to be more efficient.
- 53:13Maybe it needs more testing.
- 53:14Maybe it needs to be deployed in a different way.
- 53:16And so refactoring tied in with that idea of what is good enough is the road for evolving
- 53:22a project.
- 53:23And all of these projects that we're talking about, the well-established ones, the Googles,
- 53:26the Fangs, those projects are constantly shifting bars of what is good enough.
- 53:31And they're constantly being refactored in very careful ways to reach those new goals.
- 53:35Yeah.
- 53:36I love refactoring.
- 53:37Your tools.
- 53:37Yeah, I do too.
- 53:38I think it's fantastic.
- 53:39So many people who are getting started will tell me things like, I'm not sure how to get
- 53:45started.
- 53:45I don't know what the best way to do this is.
- 53:47I'm thinking about it and I've tried something, but it didn't, I wasn't sure.
- 53:51So I went back to thinking and the best way to get started is just give it a shot.
- 53:56Just create something.
- 53:57You'll learn what of that is working and what is not ideal.
- 54:00And more importantly, something that's awesome about software is it's plastic, right?
- 54:04You can change it.
- 54:05Plastic in the soft plastic way.
- 54:07You can evolve it as you learn more about it.
- 54:10You're like, oh, I thought that should have been a separate module, but this should be just
- 54:14part of that class.
- 54:15So we're just going to move that in through refactoring and not feeling like you have to
- 54:20have a full visibility of what you're working on to get started.
- 54:23I think that that's, maybe it sounds counterintuitive, but I feel like that's kind of an expert perspective.
- 54:28It's like, I think I need to go that way.
- 54:29We're going to start down the path that way.
- 54:31And we're going to evolve and sort of course correct as we go rather than completely stressing
- 54:37about how do I get started?
- 54:39How do I see the whole end line before I start writing it?
- 54:42And this is part of why this is not a countdown because, for example, if you have even a small
- 54:47set of tests that test your final output, refactoring is easy.
- 54:51It's fun because if your tests break and you don't like the idea, you can go back to where
- 54:55you started.
- 54:55Another fun thing about refactoring is the whole concept of code smells.
- 54:59And I think becoming an expert, there's a lot to be learned from the code smells.
- 55:05And the idea of the code smells is the code works, but there's something a little bit
- 55:08off.
- 55:08It kind of makes your nose turn up.
- 55:10You're like, oh, oh, okay.
- 55:12Yeah, I guess it works, but oh, right.
- 55:14You know, it's just, it's just kind of an ooh.
- 55:16And that's, there's a lot of lessons of how things get out of control and they get into
- 55:21a bad state and how do you fix them?
- 55:23And having that intuition, I think is great.
- 55:26So some of the code smells are like long method, method with too many arguments.
- 55:30One, probably my favorite is code comments because you hear you should comment code
- 55:35all the time and there should be places that need a comment.
- 55:38There should be comments or help, help strings, whatever.
- 55:41But a lot of times code comments are deodorant for these code smells, right?
- 55:47It's like, oh, this is kind of gross.
- 55:50Let me make a comment about why it's gross.
- 55:52Or this is poorly named.
- 55:53People won't know what this is.
- 55:55So let me make a comment about what it is.
- 55:57And like halfway through that comment, you should realize like, oh, what if I just named it?
- 56:01The thing I'm trying to tell people, it kind of does.
- 56:04Then I don't even need a comment because it has a really good name that is its own thing,
- 56:09right?
- 56:09And so four names, too many parameters, all these things are deodorant.
- 56:14And you're trying to like justify how gross this part of your code is.
- 56:18Maybe you could just apply some of these refactoring techniques to make them better.
- 56:22Not going into a whole refactoring detail, but I really, really like this idea.
- 56:27Yeah, I write a lot of exploratory code.
- 56:29So you're describing a lot of my work.
- 56:31But because I'm fine with refactoring and enjoy it and I'm comfortable with tests, that workflow
- 56:36works.
- 56:36And I think it can work for a lot of people.
- 56:38Yeah, sure, sure.
- 56:39Well, and those things don't necessarily start out that way.
- 56:42The long method didn't necessarily start out long.
- 56:44Grew and grew until it was a monster.
- 56:47Same thing with too many arguments.
- 56:49It probably started out with one or two, but then now we need this other one.
- 56:52And what about that?
- 56:53And then all of a sudden it's like, again, a monster, right?
- 56:55And so it's an evolution.
- 56:57And it's long because it works.
- 56:58And so at some point you pause and clean it up, make sure it still works.
- 57:02All right, number nine, write things down.
- 57:04Yeah, write things down.
- 57:05And I don't say that as a writer.
- 57:07Writing for me, I started writing when I was young because I saw somebody else write a journal
- 57:11and I was like, oh, I'm going to try writing.
- 57:13And so I've just written things all my life and most of it is messy.
- 57:17And some of it, very small amount of what I've written has been polished and put out in the public
- 57:22world.
- 57:22But I have found that almost everybody I talked to who writes in some way, not for public,
- 57:28but writes in some way, enjoys their work a little more and does a little better.
- 57:31My suggestions are things like keep an ideas notebook.
- 57:34Those are once you know how to build things, ideas come to you and you're like, oh, I could
- 57:39make that at some point.
- 57:40And if you have a place to record those ideas when you're not sure what to do, you can go
- 57:44back to it.
- 57:44Write comments, despite what Michael said.
- 57:47Comments in a professional, well-established project with many collaborators are different
- 57:53than comments for your own new projects.
- 57:55So whatever you're doing, write comments.
- 57:57So do put the information in that needs to be in there to work, let them be cleaned up.
- 58:02Yeah, I don't mean to say you shouldn't write comments, right?
- 58:04I just, there's a lot of times where the point of the comment is to justify why something's
- 58:09bad.
- 58:09If that's the case, it probably doesn't need to be bad.
- 58:13But if it's help docs, if it's like, well, here's the different stuff that you could pass
- 58:17and these are what we expect, there's certainly valid comments, no doubt.
- 58:20So write comments to yourself and others.
- 58:22And even if nobody else is using your project, if it's something that might be shared at some
- 58:25point, those are good.
- 58:26Learn to write documentation.
- 58:28If you write an ideas notebook, if you write comments, documentation kind of flows out of
- 58:32that.
- 58:32It just becomes a more polished version of what you're writing.
- 58:35Write questions down when you're not sure about something.
- 58:37GitHub issues are amazing.
- 58:39I haven't used project management software because GitHub issues are so useful.
- 58:44And so even if you...
- 58:46No Gantt chart.
- 58:46No Microsoft project.
- 58:48Yeah, yeah.
- 58:49Even if you don't ever plan to write anything public, write about the code that you're working
- 58:54on and write for yourself.
- 58:56And it will almost certainly benefit the work that you do.
- 58:58Writing helps you crystallize your thoughts and make sure you have them all coherent, right?
- 59:03All right.
- 59:04All right.
- 59:04Last one.
- 59:05Big tip.
- 59:06And this is a fun one to close on.
- 59:07Go meet people.
- 59:08It has long been said about Python that I came for the language and stayed for the community.
- 59:13People have talked about that for years because it's still true.
- 59:16Join online communities.
- 59:18Go to local, regional, national, international conferences when you can.
- 59:22Go to coffee shops.
- 59:23Ask questions.
- 59:24Tell stories.
- 59:24You will meet good people like Michael.
- 59:27And you, yeah, as we met at PyCon.
- 59:30So I think this is really good advice.
- 59:32I was thinking as I looked at your list that you are somebody who is not particularly metropolitan
- 59:38in terms of like tons of user groups and meetups, I'm guessing, where you live.
- 59:42It's probably a little bit of an extra challenge being in Alaska, right?
- 59:45Yeah, it's actually...
- 59:46I mean, I lived in New York City for seven years before I moved here.
- 59:49Right.
- 59:50As a contrast, right?
- 59:51So...
- 59:52Yes, yes.
- 59:53But most of my programming work, serious programming work has been done while I've lived here.
- 59:57And yeah, I don't know anybody else here who programs.
- 1:00:00And so for me going to conferences, I talk about programming the entire time at conferences
- 1:00:05because I never get to in regular life.
- 1:00:06Honestly, that's true for me as well.
- 1:00:08Even though I'm here in Portland and we have user groups and there are plenty of people who
- 1:00:12do programming, it's not that different for me, right?
- 1:00:15Because I don't go to a company where I have a team of developers.
- 1:00:19Like the people I work with, it's as real as this meeting with you and me here on a video
- 1:00:24screen share sort of thing, right?
- 1:00:26And I think this is the story of more people than just if you live outside of some big metropolis.
- 1:00:32Yeah, yeah.
- 1:00:33Quick story.
- 1:00:34First time I went to PyCon, I was intimidated because I was a teacher and not a programmer.
- 1:00:38And so I thought I would not find my place.
- 1:00:41And I walked into the hotel the first night and people pulled me right into conversation.
- 1:00:46And what I found was that roughly half the people who go to PyCon are primarily programmers
- 1:00:51looking for what to work on.
- 1:00:53And roughly half the people are people who care about some other domain than programming.
- 1:00:57And they're looking to use Python and programming to solve the problems they care about in their
- 1:01:01domain.
- 1:01:02And so it's true.
- 1:01:03Everybody has a place in the Python world if you are respectful and appropriate to other
- 1:01:07people.
- 1:01:08And so if you're shy or intimidated about going out to meet people because you're not sure of
- 1:01:14your place, just go meet people and you will find your place.
- 1:01:17And it's magic.
- 1:01:18Yeah.
- 1:01:19I think I'm hopefully I'm not misremembering this.
- 1:01:22I think almost half the people at PyCon this year were first time attendees.
- 1:01:26So if you're thinking.
- 1:01:27Oh, no.
- 1:01:28It was like 78.
- 1:01:29It was over half.
- 1:01:30It was like 80%.
- 1:01:31Yeah.
- 1:01:32Yeah.
- 1:01:32I was amazed.
- 1:01:33Yeah.
- 1:01:33I'm not sure how much of that's a COVID hangover sort of thing, because not there were not
- 1:01:38as many people who came as say in 2019.
- 1:01:42So maybe they were more icon curious folks than say the people who had been there for the
- 1:01:47last 10 years.
- 1:01:48Like, I still want to skip this one.
- 1:01:50I will see where it shapes up.
- 1:01:51But there's a really high number, whatever that that number turned out to be.
- 1:01:55And the equilibrium is that there's a ton of people at these types of events who are
- 1:02:00like, this is my first time here.
- 1:02:01So if you're concerned about going to these events and feeling like, oh, I'm going to be
- 1:02:05the one newbie and feel out of place, like probably the opposite.
- 1:02:09Yeah.
- 1:02:09You know?
- 1:02:10Yeah.
- 1:02:11You end up with lifelong friends.
- 1:02:12Absolutely.
- 1:02:13People are in a great mood.
- 1:02:14They're on their geek holiday.
- 1:02:15It's all good.
- 1:02:16Yes.
- 1:02:17It's pretty easy to make friends and have a good time there.
- 1:02:20So that could be PyCon or EuroPython or something like that.
- 1:02:24Or it could just be a local.
- 1:02:25There's a lot of regional Python meetups like PyCascades here in the Pacific Northwest,
- 1:02:30PyTexas, PyOhio, all these things.
- 1:02:33And none of those work for you.
- 1:02:35You know, there's forums like this, to be honest.
- 1:02:37Like part of the reason I created the podcast was to kind of get to know people better in a
- 1:02:42way that I knew wouldn't be possible for me.
- 1:02:45Right.
- 1:02:46My goal was, where do I go find the podcast to listen to, to do this?
- 1:02:50And then there was none.
- 1:02:50I was like, all right, fine.
- 1:02:51I'll create the podcast so we can do this.
- 1:02:53But my intent was just to listen to a podcast to kind of get to know people like this.
- 1:02:57It's a pretty one-way conversation as a podcast listener.
- 1:03:00Not 100% as people have seen in the audience.
- 1:03:03But it's still valuable to like eavesdrop in a sense on these conversations if you're a new
- 1:03:09person.
- 1:03:09Right.
- 1:03:09Absolutely.
- 1:03:10Yeah.
- 1:03:11All right, Eric.
- 1:03:11Well, what a fun conversation.
- 1:03:13Thank you for the awesome list.
- 1:03:16And hopefully you've inspired a lot of people out there to, you know, make forward progress
- 1:03:21on this journey that they're on.
- 1:03:23Well, thank you for having me.
- 1:03:24I've listened to you for a long time and really enjoyed your work and very happy to connect.
- 1:03:28Yeah.
- 1:03:28Same here.
- 1:03:28So final call to action.
- 1:03:30People are interested.
- 1:03:31You know, maybe tell them how to check out your book.
- 1:03:33Tell them how to put some of these ideas into action.
- 1:03:36My book is Python Crash Course from No Starch Press.
- 1:03:38Third edition came out this year.
- 1:03:40And so everything works.
- 1:03:41It's good.
- 1:03:42I keep it updated.
- 1:03:43If you buy it, you get a copy with the newest updates.
- 1:03:46Yes.
- 1:03:46I also write weekly at MostlyPython.
- 1:03:49And that's MostlyPython.substack.
- 1:03:51There are paid subscriptions, but there are also free subscriptions.
- 1:03:54And so the only advantage for paid subscriptions is that some posts are locked for six weeks.
- 1:03:59Everything I write, I want to be available to everyone.
- 1:04:03And so if you're curious about what I'm thinking about on a weekly basis, MostlyPython.
- 1:04:08Excellent.
- 1:04:08All right.
- 1:04:09Well, thanks again for being here.
- 1:04:10See you later.
- 1:04:11Thanks everyone for listening.
- 1:04:12Yes.
- 1:04:12Thank you.
- 1:04:15This has been another episode of Talk Python To Me.
- 1:04:17Thank you to our sponsors.
- 1:04:19Be sure to check out what they're offering.
- 1:04:21It really helps support the show.
- 1:04:22GlareDB is an open source database for querying distributed and disparate data.
- 1:04:28Connect your data sources and use the Python tools you already know to ask questions and
- 1:04:33integrate data across data sources.
- 1:04:35Get started today at talkpython.fm/GlareDB.
- 1:04:39Take some stress out of your life.
- 1:04:41Get notified immediately about errors and performance issues in your web or mobile applications with
- 1:04:46Sentry.
- 1:04:47Just visit talkpython.fm/sentry and get started for free.
- 1:04:52And be sure to use the promo code talkpython, all one word.
- 1:04:55Want to level up your Python?
- 1:04:57We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:05:01Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:05:06And best of all, there's not a subscription in sight.
- 1:05:08Check it out for yourself at training.talkpython.fm.
- 1:05:11Be sure to subscribe to the show.
- 1:05:13Open your favorite podcast app and search for Python.
- 1:05:16We should be right at the top.
- 1:05:17You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:05:22and the direct RSS feed at /rss on talkpython.fm.
- 1:05:27We're live streaming most of our recordings these days.
- 1:05:30If you want to be part of the show and have your comments featured on the air,
- 1:05:34be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:05:38This is your host, Michael Kennedy.
- 1:05:40Thanks so much for listening.
- 1:05:41I really appreciate it.
- 1:05:42Now get out there and write some Python code.
- 1:05:44We'll see you next time.
- 1:06:05Thank you.