Podcast Lookup

38 - Technical Training in Python with Trey Hunner

The Python Show

  • April 25, 2024
  • 48 min
Episode page
About this episodeThis week’s episode is all about Python technical training with special guest Trey Hunner! Trey not only does technical training, but he…

This week’s episode is all about Python technical training with special guest Trey Hunner! Trey not only does technical training, but he is also a content creator and author.

In this episode, we discuss the following topics:

* Technical training

* Great Python modules

* Life improvements with Python

* Automated testing with Python

* Learning strategies

* and much more!

Tune in today and listen in!

Links

* Weekly Python Tip Newsletter

* Python Morsels

* Follow Trey on X / Twitter



Get full access to The Python Show at www.pythonshow.com/subscribe

Transcript

From the publisher

This transcript comes from the podcast’s own feed, shown as the publisher wrote it.

38 - Technical Training in Python with Trey Hunner

00:00—
  1. Speaker 1

    Welcome to a brand new episode.

  2. Speaker 4

    Mike Driscoll, The Python Show.

  3. Speaker 1

    Hello, and welcome to The Python Show. I'm your host, Mike Driscoll. And today, I have the honor of having Trey Hunter on my show. Welcome to the show. Thanks, Mike. Yeah, it's good to have you. Trey is kind of an entrepreneur. He has his own business. He does technical training and writes courses and other types of things that you can learn Python with. And I don't know, do you teach anything besides Python? I don't.

  4. Speaker 2

    I don't typically. Sometimes I'll veer into Python. I mean, I dive deep into Django, PyTest, deeper into Python things. But occasionally I'll teach Git or some command line stuff. But usually that kind of comes along with Python, right? I don't usually teach that in isolation. OK.

  5. Speaker 1

    I've had some tech teachers on here. They mostly do Python, but some of them will teach, you know, another language as well. Yeah. I thought you only did Python, but I didn't want to, you know, I didn't want to pigeonhole me.

  6. Speaker 2

    Yeah, yeah. No, I know other things, but it's nice to be able to say, this is the thing that I teach. Come to me for this. Oh, you have questions on this other thing. Sure, we can talk about it. But, you know, honestly, that's not where I try to make my area of expertise land. Right.

  7. Speaker 1

    Yeah, yeah, that makes sense to me. So something I like to ask all my interviewees, so to speak, is just tell us a little bit about your journey into programming.

  8. Speaker 2

    Yeah. So I was, I guess, one of those kind of, you know, stereotypical journey into programming where I found it when I was young, which I was really grateful for. At the time, I didn't know I was programming. I don't know at what point I found out programming or coding was the name for some of the things I was doing, but A family friend had showed me how to make a website on the internet using, I don't even know what the software was called at the time, something visual, something equivalent to Microsoft Front Page back in the day. And then from there found GeoCities existed and other free places to kind of put your own stuff, hang out your hat on the internet somewhere. Yeah. And I played with that because I was, you know, a kid at the time. And when you're in a kid, you have not a lot of money, but an abundance of time, typically. And that's how I found JavaScript and, you know, CSS and all that jazz and eventually found out you could have stuff going on some server somewhere. And there's a back end to things, you know. The way I found that, I think, was trying to figure out how do I make an authentication, a username and password. You can't really do that fully in the front end. You need some kind of server for that. Found Perl from that, found PHP, decided I wanted a computer science degree just by default because I knew I'm interested in this thing. Computer science apparently involves programming. And at some point along the way, they found Python from, I think, a programming languages course. We did one week on Python. A friend asked over winter break, coincidentally, After that course, we're making an application in Python. Do you want to do some kind of freelancing over Winter Break for us? It was just going to be for those few weeks. And then it did not end over those few weeks, basically. I kind of continued my freelancing journey and have been doing that ever since, freelancing, consulting, and then eventually training. Training I fell into kind of by accident because my background is not teaching. And so that was kind of a fun... It's funny, I have an accidental background in teaching, though, in that I've always loved the joy of seeing someone else have that aha moment, because I love it myself as well. It's vicariously fun. And I think that probably inspired that years before I actually fell into that.

  9. Speaker 1

    That's nice. Well, you kind of kind of fell into my next question was how did you get into tech training? So why don't you just like tell us, you know, how did that how did that happen? Why did you go into that instead of keeping as a freelancer?

  10. Speaker 2

    Yeah, so that was, like many things, accident, luck. You know, luck as well as other things. But I had been doing curriculum development and helping run workshops for my local meetup, San Diego Python meetup. We would just host free workshops. I seemed to like writing the curriculum more than many people. Okay. Mostly because that kind of plan of having a vision of what is it we're going to teach, writing it all out. Not that the act of writing it was fun, but having written it is the fun part, right?

  11. Speaker 1

    Yeah.

  12. Speaker 2

    I was willing to suffer through the actual writing it. Sometimes writing it is fun as well, but- I'd also done a little bit of teaching in a tiny bit in college, some in high school by happenstance, because we had a teacher kind of quit who was the computer science teacher. And the slightly more advanced students at the time, they basically told us, well, none of the substitutes know how to teach this. You help them teach it. Yeah. And so I was kind of I wasn't made to teach so much as it was just kind of became part of what I was doing. And that was fun. And so I think there were there were multiple steps along the way that opened me up to this idea. But it was someone who actually finally asked me, hey, can you come into our company and teach a whole bunch of folks by just playing some videos on an online subscription service that we have and just being in the room? And I told them that that I'd actually been reading some books on learning at the time. And I told them that that sounded like not an awful idea, but not the greatest idea because you don't learn by watching videos. You've got to be writing code. And so I pitched them instead on the idea of I would spend a bunch of time making curriculum and then I would go in and teach that curriculum. And I would, of course, own the curriculum myself. And when they said yes to that, I realized that might be a path that I could go down is teaching and training. And it was kind of luck that I kept going from there. I never really went into, you know, training through a big company. And so I kind of learned things the hard way. Same with freelancing. You learn by realizing, oh, some of these things are very tricky in terms of getting contracts for some things versus others, big companies versus small companies. But the bumpy road from there started in around 2015 is when my training journey really started.

  13. Speaker 1

    Nice. So you mentioned you studied computer science and then you got into curriculum development. How did you learn how to create curriculum? Because that's not something you learn in computer science.

  14. Speaker 2

    Yeah, no, it isn't. Again, that's kind of a happenstance. I liked blogging. I don't even know if it was called blogging when I originally was doing it. I mean, blogging is an old term, but I'm not sure I was thinking of it as blogging or aware of the term. Oh, the e-zines, is that what we called them? The kind of like writing on a topic, pretending you knew the topic, right? Enough that you could tell other people, here's what you need to know about this. And if you're only a couple of weeks ahead of someone else, you can make an impact in explaining what you know. Uh, and I liked doing that even, um, you know, when I was in high school, I had, I owned free software reviews.com and I would put up reviews. I convinced a couple of friends along with me to put up reviews of free software packages and say, you know, they're available for windows or obviously Linux, a ton of them were available, but you know, windows and Mac, for example, there, there wasn't, um, shareware was kind of the thing at the time, or you download something and then it would try to convince you to upgrade. And I wanted to rank these things. What's the truly free one? What's the one that wants you to upgrade and everything in between? And that involved writing. So writing, whether it's fiction, nonfiction, stories, explaining something technical, I've always kind of enjoyed that process. I kind of wanted to be a writer when I was a kid, actually, before I found programming. So it's I think it's fun to try to get an idea that's in your head and see if you can get it into someone else's head in some way.

  15. Speaker 1

    Cool. Is there any resources you'd recommend for someone who wants to learn how to do curriculum themselves? Or is that just something you kind of have to do? You just kind of have to go trial by fire?

  16. Speaker 2

    That's a really good question. we're always tempted, right, to say the way that I did it is the right way to do it. I don't think the way that I did it is the right way, though. The trial by fire, it works, but you can also deliberately do this, I'm sure. I didn't really take that route. I do wish, in hindsight, that I had earlier read a little bit more on teaching effectively. In fact, this is something I still wish I had a better grasp on is... explaining ideas. And this is something I don't think people write about often because it isn't something that is generically studied and talked about a lot of times, right? It's how do you explain this type of idea? I think a lot of it is practice though, in the sense of you write something, you show it to someone else, you get the feedback. You need a feedback loop of some sort. And so even if you're reading, you're getting a feedback loop of the author is telling me something, oh, am I doing that? A little bit of a feedback loop. but showing someone else and then iterating. And I'm sure you knew this as well. Well, you've been writing for years as well. That iteration is really important.

  17. Speaker 1

    Yeah, yeah. It is. Practice, iteration, getting those good... Finding readers who are knowledgeable on the topic who can give you feedback.

  18. Speaker 2

    You want to be embarrassed by stuff you wrote in the past, right? If you're embarrassed by something you did five years ago, that means you've made progress.

  19. Speaker 1

    Yep. Yeah. You know, when you're writing code and you go and look at your old example from last year, you're like, wow, what was wrong with me that year?

  20. Speaker 2

    Yeah. So you were learning. Nothing was wrong with you. It's just that you're further than you are. And in fact, it's funny because we have this illusion in our heads of if you ask someone 10 years from now, how much will you have changed? They'll say, ah, not a whole bunch. 10 years ago, how much did you change since then? Oh, quite a bit. We think that we're not going to change a lot, but ultimately what's going to happen, hopefully, is five years from now, I'll look back at this and say, what was I doing at the time? Yeah.

  21. Speaker 1

    Yeah. Yeah. I think that's, I think that's something that's true, especially, I mean, as developers, a lot of us can go back and look at our old GitHub repository and be, you can, you can look at our, what we did in the last, you know, year, the last month. Yeah. Some of us can even go back to 2010. Maybe. Yeah.

  22. Speaker 2

    What was I doing 14 years ago?

  23. Speaker 1

    And you can see your progress, you know, that's not always true for people like, like in a cooking profession or, you know, a mechanic. Yeah. They, They can be like, yeah, I got certified for these EV cars now, but besides that, that's a lot harder to measure, I think.

  24. Speaker 2

    A great reason to stick your stuff under version control is just the fact that it's documented so you can go back and look at it later and see, learn from your past self. Sometimes you do something that you want to repeat, but sometimes you do something you want to repeat and you look at it and go, oh, but I don't want to do it that way.

  25. Speaker 1

    Yeah. Yeah. One of the reasons I started writing is I wanted a way to look back at what what I'd learned because I knew I'd forget some of that stuff. And so I put it I write it out for myself because I'm like, I solved this problem and I don't want to forget how to solve this in my future. Right.

  26. Speaker 2

    Yeah. And in fact, I've found I've searched for things. found a Stack Overflow question and found an answer from myself from five years ago that answers the question. And I do not remember ever having this problem before, but I get to thank my past self for having apparently had this problem and finding a solution somewhere for it and then documenting it.

  27. Speaker 1

    Yep. I've done that repeatedly on Stack Overflow and some of the Python forums. I'll go on there and like, huh. Yep. I guess I was smarter then than I thought I was. You're right. Yeah, at least about this one topic, right? Yes, this one little niche topic, yeah. All right, let's focus. What were your favorite Python packages right now?

  28. Speaker 2

    It's always a tricky one, because the one that comes to mind most obviously is I love Django. I make Django websites all the time. In fact, I was just... thinking about earlier what applications have to be written in Django that I use. Recently, though, well, actually, there's another one that comes to mind. My favorite package is also the one that I happen to be using because I wrote it. And I'm the only one that uses it, but I use it all the time. And one of those is literally a program that prints out 80 zero characters. It does nothing else. I think it's a one-line program. Just to see my terminal is this wide. Okay, hit control shift plus over and over until it gets the right size. That's not even on the Python package index. One that is that I use all the time that I made is it a countdown timer. When I'm teaching, I show a little timer on my screen and say, we've got 10 minutes for this exercise section. So people feel the like, oh, There's time counting down. I should really get to work here. And then a package that I don't use all the time, that I didn't write, that isn't some big package like Django either, Textual. I've been really having fun with. There's actually a project that I started last week that It has a name, but the name may not be what the name is in the future because apparently it's reserved on the Python package index because it looks like a typo of another package. But I think it's a mistake. I don't think it should be considered that. But currently call it UTF, kind of like UTF-8 or UTF-16. And it's a Unicode search engine. Engine's a strong word. It's a Unicode search.

  29. Speaker 1

    Okay.

  30. Speaker 2

    that is available in your browser. And it's meant to be an equivalent to Unicode Party, which is a little emoji search engine I made years ago. It's just a fully front-end app. And it's a mashup of that and utf8.xyz, which Seth Larson made. And I am a co-maintainer of, mostly because I think I opened two pull requests and he said, now this is your problem to deal with too. Because that's what happens when you have a tiny open source project that someone else contributes to. I did the same thing with Unicode Party and a friend of mine, but I wanted to mash those two together because sometimes I'm searching for emojis, sometimes I'm searching for other Unicode characters, and there's really no reason I should have to go to my web browser to do that. It'd be nice to do it for my terminal. And I realized Textual would be a great use case to have fun with making a Textual app. So I've probably spent four hours making it so far, and I just love that I've made quite a bit of progress without having to spend a lot of time. Part of that is actually the documentation, and part of it is just the fact that you can get a lot done with the library and very little code sometimes.

  31. Speaker 1

    Yeah, that's one of the ones I'm really excited about and have been playing with off and on for the past couple of years is textual. Yeah. I'm hoping that it stays strong and continues on because I'm planning to write about it a lot this year if I can.

  32. Speaker 2

    Yeah, yeah. I'm curious where it'll end up going in the sense that I also am really interested in Beware. And I know Beware has a kind of, what do they call it, an adapter maybe for textual in the sense that you can make a Beware app that also in theory could be a textual app, although I think it's kind of in nascent stages right now. I don't even know if it's in alpha, but something exists there. which would be really interesting to go in either direction. Could you make a Textural app and turn it into a GUI app or make a GUI app and turn it into a command line app? Any of those is interesting because then you could have multiple versions of the same application depending on the context.

  33. Speaker 1

    Yeah. And Textural has a web version, so theoretically... You could take Textural, I think that's Textural Web, and deploy that to your phone even, so to speak.

  34. Speaker 2

    Right, yeah. Or wrap that in something that makes it a GUI application on your computer, not just a web app locally. But yeah, they're all kind of... a lot of those adapters feel a little clunky today, but I don't think that's going to be the case in the future. There's always a threshold where once it hits the point of, oh, this no longer feels like a toy, now suddenly it's this real thing and everyone wants to use it. And I think that happened probably around this time last year with large language models, right? That like ChatGPT really started to become something that people felt wasn't a toy anymore. And it's really interesting to see that threshold hit. And so I'm kind of waiting to see when that happens with both Beware and Textual.

  35. Speaker 1

    Yeah, I keep waiting for Beware to, you know, I'm not knocking them at all, but I keep waiting for their, especially their Toga package to, you know, it's their mobile version. Yeah, yeah. Deployed to iOS and Android, for those who don't know.

  36. Speaker 2

    Yeah.

  37. Speaker 1

    But it's always been kind of an alpha state in my mind because they don't have more than a handful of widgets for iOS and Android.

  38. Speaker 2

    I think right now the focus is on, I'm speaking for Beware even though I can't, but my guess, based on their newsletter, because I read their newsletter every month or so, I think it's every month or so, it seems like the focus at the moment is a lot of the backend machinery involved to make sure that that is easily possible. Because before the goal was make it so that you can compile these things down to the you know, to JavaScript, for example, in the web browser, which now it's instead going to be WebAssembly and all that. So it's I think the kind of the focus is make the back end machinery really strong and then focus on the front end widgets. But you're right that until they get the front end widget stuff, no one's going to be excited about it. It's exciting in theory.

  39. Speaker 1

    Yeah, and I was really excited when I think it's Anaconda started supporting Beware so that they could have full-time developers on it. I think they have about two or three now. So I'm really hoping that that'll go, you know, accelerate development in the next year or two.

  40. Speaker 2

    Absolutely.

  41. Speaker 1

    Anyway, I think something that we should talk about are some life improvements you've done with Python, if you have any.

  42. Speaker 2

    Yeah, it's funny. It's a tricky thing to think about because there's the line between what is a life improvement, what is a work improvement, and also what counts as an improvement? How big does it need to be? And so some thoughts that I had here, some things I thought of on this question are I actually have a script that I run once a year, and I forget about it. It's one of those things that might be an answer to this question, but I didn't forget about it because I ran it recently because it helps me do my taxes. Oh, nice. And it is, you know, at the moment tax season we're recording this or near it. So I find that really helpful. It's just kind of massaging data that's in the format that I typically have it in to the format that I need it in to really help me, you know, send that stuff to the IRS and all that. And I tweak it every year a little bit as I kind of add new categories or tweak my, you know, my business expenses are categorized in a slightly different way. But over the years... very little tweaking has to happen every year. In fact, I don't think I tweaked it at all this year, but maybe I will next year. That's one example. But I also mash up Python with other things. If I can automate something without writing code, that's great. And so I use tools like Zapier quite a bit. to, for example, I have an email that sends to myself every day to ask what happened during the day. It's kind of a daily journal. It syncs with a text file in Dropbox and there's a little bit of a Python script that runs on both sides of that kind of syncing to take the reply in the email that I send and make sure, kind of clean it up a little bit before it goes in the text file. I also used to use Python for searching for audiobooks on different platforms that were DRM-free because I have... I was going to say an irrational, but it's not irrational. I have a hatred of Audible, and I think it's a well-founded hatred. And so I was looking at other platforms before I eventually found Libro.fm, which I pretty much use exclusively now. Before that point, though... there were like two or three different platforms I'd want to search for an audio book on. And I didn't want to have to bring up each one in a new tab, find the search bar, copy paste the name in. So I basically made a little web scraper script for that. And that was really helpful. Just little tiny things that whenever there's something I need to do over and over, it's nice to have a little script. Oh, another one I thought of. I read a lot of audio or listen to a lot of audio books. And I use Goodreads, which I do not like, but I haven't switched to an alternative yet. It's good enough, right? Goodreads is good enough. So I click the, I add it to my read list button there, whatever it's called. That, thanks to Zapier, syncs that up to a Google spreadsheet and And I think I have a little bit of Python there just to clean up the title. So just little tiny bits of Python to like replace the little weird HTML escaping with a proper apostrophe, that kind of thing. It gets sprinkled into life.

  43. Speaker 1

    Yeah, yeah. Yeah, for a while there, I had some scripts that were helping me with my book stuff. But most of those have been automated by other processes outside of Python. But at the time, it was really useful because it could convert restructured text to Python. to markdown to uh epub yeah using outside tools that was really fun yeah oh that

  44. Speaker 2

    makes me think of another one that i have that's kind of unique it's uniquely sloppy uh which is fine sloppy code as long as it's working code for me and if it's not working code i'm the only one who runs it so i fix it when it's not working but yeah um it looks through a directory. I should really make this open source at some point. It's probably useful for someone for something. But it looks through all these Markdown files of either my Python exercises or my articles, whatever the repository might be in has, and looks for Markdown link anchors. Because I tend to do not here's the text, here's the URL, but here's the text, and then here's the anchor, and then I put the URL at the bottom. There's kind of two ways to do links in Markdown. And it looks for the anchors and tries to look for all the anchors, the beginning of the link anchor that doesn't have an end in the current document I'm working on. I give it the file name there. And it looks through all the other files looking for matches of, oh, do you have other anchors with the same name? Count them all up and try to figure out what's the most likely URL that you were going to link to. So it's kind of my own personal like, AI system it's not AI though it's just literally counting what's the likelihood of this URL being the one you want to link to and it works for at least 80% of my anchors because I repeatedly link to the same pages over and over that sounds like a handy little script yeah after I write an article or something I just run it throw that in it's got some missing ones I fill those in it only saves me a couple minutes but multiple times a week that's pretty handy

  45. Speaker 1

    Yeah, I'm not very good about internal linking to my own articles. And I've been trying to get better about that the last couple of years. But that sounds like a helpful tool.

  46. Speaker 2

    I've heard that people don't tend to click those links. And I think that's probably true. But I really like having the links there for those people who are curious enough to go, oh, wait, what is that thing? I don't understand that. And then they can click it and go, you know, find out something else. And it's not even links to my own content. Sometimes it's links to... other people's content. Actually, I wrote an article that was published this week on time complexity in Python. But before, in fact, even after this article, I will probably continue to link to Ned Batchelder's talk on this topic quite often because he explains some things that I don't in that article. And so there's certain things I find myself linking to a certain page over and over when certain terms come up. And it's nice to have that little helper script to do it for me.

  47. Speaker 1

    Well, I'll do that stuff just for myself, if nothing else. Right.

  48. Speaker 2

    Yeah, absolutely. I mean, it's nice to have your own little list. It's like your own little kind of watch later playlist, but you just keep it around as bookmarks.

  49. Speaker 1

    Because I don't know how many times I come back to my own articles just because I'm doing a hackathon or I'm trying to help somebody else by answering a question. And I'm like, man, I should have a link in here for more information. And I don't. And I'll add one. Because I'm like, this should have been in there in the first place. Right.

  50. Speaker 3

    Yeah.

  51. Speaker 2

    Actually, related to that, the last script I'll mention, because you reminded me of another one here. If I do not have a link, there's a separate script I run that's even sloppier. And it's using a regular expression to look for some phrase or like a... Sometimes it's a very concrete word. Sometimes it's one word with at most 20 characters in another word implying that like, oh, I'm talking about a certain topic in Python or something else. And if it finds that, but it does not find a list of URLs, it suggests that, oh, this could somehow be linked to this thing. That one was super handy because it helps me discover things I'm not linking to that might actually be really helpful to link to. Of course, I have to make that big dictionary of like the regular expression keys and everything else. But once I started to kind of build that up, it was pretty handy.

  52. Speaker 1

    Those are cool. I like that idea.

  53. Speaker 2

    Yeah. It's very hard to think of, you know, I'm doing something over and over manually. After sometimes months, I'll realize, wait, I could have been automating some portion of this, but it's just hard to identify, to go through life thinking of what's my opportunity to automate.

  54. Speaker 1

    Yes, it is. I only start noticing that when I start copying and pasting something common. I'm like, oh, I've done that two or three times and I probably need to automate that. Yes, exactly. Right. Let's see. Could you give us some examples of effective learning strategies you've gotten? Yeah.

  55. Speaker 2

    So I'll mostly kind of, you know, wrote a list off just the ones that are kind of talked about in theoretical terms. And I wish these terms were better because they don't, for being learning strategies, they're not as sticky as I wish they were. Retrieval practice is one of them. That's basically the idea of And this is one of the most fundamental ideas, that if you've got this idea down, everything else becomes easier. If you are tempted to reread or rewatch screencasts or videos or courses or whatever, typically that time is less effective. than the same time that you could spend trying to write out code or really do anything else that attempts to retrieve something from your brain. And I mean anything. A flashcard would even be helpful. Trying to quiz yourself, anything that tries to get something out of your brain. And it's funny, quizzing, self-quizzing is something that people think of that as it's an assessment tool because in school, we use quizzing literally as an assessment tool, a grading tool. It's good for that, sure, but it's actually also really effective as a learning tool because the act of retrieval tells your brain something's important. We do not learn from putting information into our heads. We learn from that act of retrieval because that's what tells our brain that this is worth remembering. So retrieval practice is a big one. Related to retrieval practice is elaboration. Elaboration, you know, obviously, for example, I could elaborate to you and say, you know, I learned something yesterday and kind of explain it in my own words. But it's also related to retrieval practice in the sense that it kind of builds on top of it because you're trying to make connections to other things. You know, explaining something in your own words, often you're reaching for analogies. in the real world, or you're contrasting it to something else, saying, here's this thing in Python, and it's similar to this other thing in JavaScript, or it's different from that other thing in JavaScript. For example, objects are similar in Python and JavaScript, but JavaScript has this, you know, scope works a little differently in some ways, or it has this idea of constants that we don't have in Python, but we both kind of have immutability. So kind of the more connections you can make between things, the more you've anchored an idea in your head. There's also spaced repetition, which is kind of taking that idea of retrieval and putting on steroids a little bit. It's spacing it out over time where you say, instead of binge learning, instead of me saying I'm going to go do an interview or take an exam or something, and I want to try to learn everything at once. I'll do all my practice that I'm going to do today for the interview tomorrow. It's a lot more effective to do a little bit every day. And in fact, if you can, to try to literally space out the act of retrieval so that if you were, for example, to use a flashcard and say, do I know this thing? Flip it over. Yes, I do. Okay, now do it tomorrow. Now do it two days later and four days later. Kind of space it out over time If you look at something and then you can retrieve it six months later, you really know it. If you can't even retrieve it tomorrow, you don't know it very well. But the more you can space that out over time, the more you're really kind of stretching your brain. It's almost like stretching a muscle in a sense there. Well, I guess it's a bad analogy because it's not like stretching a muscle. It's like building a muscle over time.

  56. Speaker 1

    Yeah, I get it.

  57. Speaker 2

    Yeah. And the last one is interleaving, which is if you've got lots of things you're learning at once, you it's actually this is counterintuitive it's more effective to learn to practice multiple of them in the same learning period than practicing just one so for example if you were working with lists and dictionaries you know about both of them you want practice with both don't just spend an hour on lists Spend a few minutes on lists, a few minutes on dictionaries, a few minutes on lists, go back and forth and mix and match because your brain has to context switch between the ideas. It both makes elaboration that connection making ends up happening, but also it makes it so your brain has to do a little bit more work, which will make you feel a little discouraged because it feels harder. It feels like you don't know it as well, but it's actually making the learning more effective. And the analogy from this I think it was from the book Make It Stick that I read years ago, that if you were practicing baseball, you don't want to practice curveballs over and over for half an hour. You want to practice curveballs with other types of pitches, all the other types of pitches mixed together because you don't know what's going to be coming at you then. You have to be thinking about what tool do I need to reach for right now and take it out of your tool bag at the right time. So interleaving can be really helpful too. That's kind of the five big basic ones. I guess it's only four of the big basic ones.

  58. Speaker 1

    That's interesting. I wonder if you combined... Well, since we're talking about Python, if you combine a list of dictionaries or a dictionary of the contained lists, is that going to confuse someone who's new to Python or is that going to help them learn those concepts better?

  59. Speaker 2

    Both. And that's the tricky thing, right? It's like when... you don't want to confuse yourself so much that you get discouraged. There's this idea of the zone of proximal learning that something is just outside your comfort zone there, right? But it's not so far out that you get discouraged and just give up or you can't even do it at all. But it's just outside that comfort zone there. And so it might confuse you, but as long as you kind of have a bit of a grasp of both, You are going to learn something even from the act of failing at it, which is another kind of counterintuitive thing is that attempting to retrieve something from your head, failing to retrieve it and seeing the answer is more effective than seeing the answer and then trying it and succeeding. It's even the act of failure. And it's not that the failure is the important part. It's that you tried to retrieve something and then it kind of almost left a gap there or something so that we could fill in that information that we didn't see. And I'm using analogies here that are very fuzzy because some of the, a lot of learning theory, there's speculation of what, why our brain seems to work in a certain way because the studies are only so, so deep. And obviously I didn't even read most of the original studies. I'm reading books and articles and stuff on the studies.

  60. Speaker 1

    Yeah, that makes sense. That kind of brings up a related question of you're learning these things. Do you think it's helpful for people to write tests for coding exercises or whatever that was?

  61. Speaker 2

    As opposed to just writing the code, right? Solve the exercise. Yeah, yeah. This is something that I'm not mixed on so much as it has a use, but I don't think it's a blanket just yes all the time. I know a lot of folks who do. So I run a service called Python Morsels in addition to my training. And Python Morsels basically takes the exercise side of my training. It's more than exercise now. There's screencasts and explanations and such. But it was originally intended to take the hands-on portion of my training and make that self-paced so that you can get practice writing code by practicing that active retrieval on your own. And there are already automated tests for every exercise. I've written the test for you. that doesn't mean you shouldn't write the test yourself. And in fact, I have had people tell me they always write their own tests either on top of mine or in a separate file. I'm using unit tests so that people don't have to install anything, but obviously a lot of folks like to use pytest, so they might write theirs in pytest as well, and probably I would as well if I had the choice, but it's not in the standard library. And so that act of writing the tests, it can help you understand the problem better. The reason I'm mixed though is if you don't know how to write tests, this can be discouraging. And even if you do know how to write tests, it can be time consuming because sometimes writing the tests takes as much time as writing the code. So what I might do is write some bullet points of here are the types of tests I want, go to a tool like ChatGPT or Clod or Copilot or whatever, and then have it write the test for you, look at the test, tweak the tests, and then try to write the code as well. And honestly, this is what I've been doing in some of my tests for my work, in that if the test is well-described enough, Often, that's the part of your code that an AI tool can be really good at if you have discrete, specific things. Here's the function. Write some solid tests for it. And then you iterate from there. You obviously don't take the result. You just run with it. You want to make sure, read it, see is it good, and then ask it questions and try to get it to nudge it in the direction of writing better tests or different tests or whatnot.

  62. Speaker 1

    That makes sense. I can see that as a good learning tool, and it also helps promote test-driven development. Yeah. which is pretty important, especially nowadays.

  63. Speaker 2

    Yeah, and that's the thing that it's tricky when you're solving an exercise of if you didn't write the tests, the tests might be failing. Then you're trying to figure out what is the test doing? Not only what is the failure saying, why am I getting the failure? What is the test doing? Because I'm not the one who wrote the test. And why is my code failing this test? So there's kind of a lot of question marks there. Whereas if you wrote the test yourself, presumably, hopefully you understand the test a little bit more. Even if you didn't write the test yourself, but an AI system wrote it for you, you looked at it afterward and you tried to understand it, it can sometimes feel a little bit less discouraging than the system is telling me it fails and I don't quite understand why.

  64. Speaker 1

    Yeah. I just throw in a little word of caution on at least my experiences with ChatGPT. It'll hallucinate code for you that looks reasonable but doesn't work. Doesn't work, yeah.

  65. Speaker 2

    It confabulates quite a bit confidently. I use it all the time. But in fact, I've stopped even going to verify sometimes whether it is correct. It'll tell me, oh, you can use this command line switch here. And then I go, huh, it doesn't seem like I'm surprised that command line switch exists. And then I ask, does that command line switch actually exist? Oh, no. I apologize. I didn't even go to verify whether it works and see that it failed. I just asked it, the thing you just told me, is it correct? And then it said it wasn't correct. And so these things are very, very fuzzy right now. But the funny thing is, you can ask them to write tests, write code for the tests, verify that the tests are failing against the code that it wrote. Either the tests are wrong, the code are wrong, or both, and then iterate from there. So you can use it to help you verify itself. But even there, you do want to use your brain, use some self-verification as well. You've always got to verify with these things and iterate for sure.

  66. Speaker 1

    Yes, definitely. Don't let it give you junk code just because it's easy.

  67. Speaker 2

    Yes, don't copy-paste it. Stick it in your file, save it, ship it to production. No.

  68. Speaker 1

    Definitely don't do that. OK. I think the last question I was going to ask you was, do you have any favorite non-technical hobbies?

  69. Speaker 2

    Yeah. Not that I think could be traditionally described in a word. So I love podcasts and audiobooks. I do a lot of listening. Audio is kind of my form of learning, which is funny because I know a lot of folks who make videos, they prefer to read, which I always find kind of ironic. And in fact, I know some podcasters who do not listen to podcasts. They make podcasts, they don't listen to them. And I actually do really like consuming audio content. That's the main way that I do my, you know, consuming of nonfiction and fiction. In general, my nonfiction, I... Anything in the ballpark of human flourishing, of making our lives happier, more productive, not even necessarily human, but the flourishing of beings in general, whether animals are human or maybe even AI systems are sentient or something in the future, who knows? I don't really have an opinion on that one. But at least starting from the baseline of, I know humans have feelings and I want us to have good feelings in the future, And I want, you know, maximal happiness. So there's a whole bunch of stuff that I go into there and like economics and public policy, getting into like, I read a book on parking lots last year and like how parking, you know, works around the world and why it should work one way versus another. It's just all that is, it's fascinating to me to the people will like take a topic, research it for a very long time and write something about here's the state of the world and how the state of the world could be better for all of us. And I just like, you know, learning something from someone who's enthusiastic about what it is they're teaching and why that thing actually matters. But usually in the ballpark, even flourishing, I really do think economics is the most underrated field. uh, thing that I'm, I'm interested in. And I, you know, I'm a novice in it. I don't know about this. I don't have a degree in it, but, um, so many things in the world are about incentive structures, either misaligned incentives or, or aligned incentives, either conveniently accidentally aligned incentives or purposely aligned incentives or, um, you know, a corporation has a different incentive than the government has, or then all of us as individuals have, or we as individuals have a different incentive than our government has. So much of the world is incentive structures, both in terms of companies and in terms of the world at large. And I really wish we talked and thought about incentive structures more often. So this is kind of like my main hobby is probably, you know, in the non-programming world is just listening to people who know more than me about interesting things. Yeah.

  70. Speaker 1

    Yeah. So have you heard of PodScan?

  71. Speaker 2

    I haven't, no. What is that?

  72. Speaker 1

    So there's this guy I follow on Twitter or X or whatever they call it now. And he created this new thing. He just decided, well, I'm going to... First, he started out as being a podcaster, and he's pretty popular. His name's Arvid, or Arvid. I don't know how to pronounce it. Anyway, he decided, I've been doing podcasts for a long time now. I'm going to create a... a service called podscan.fm and it is currently trying to scan all the popular podcasts transcribe them so you can search for any keyword in them and he's basically doing like 4,000 hours worth of transcribing a day or more yeah And, you know, he can set it up so that you can say, I want to get a notification whenever the word Python is mentioned in a podcast.

  73. Speaker 2

    Right.

  74. Speaker 1

    Or textual or, you know, whatever. You can set that up. That's one of his key things. And it looks like a really neat tool. And he's trying to scan everything that's public. Yeah. And make this huge archive of everything. for research purposes, but also for leads for if you want to sell something or you want to learn something new on a certain topic.

  75. Speaker 2

    Right. Because for marketing purposes, you could look for podcasts that tend to mention certain things a whole bunch, that kind of thing. I'd be really helpful. Cause I, you know, the, usually when I search in whatever podcast app I'm using at the time, it's, it's looking, I think in the, what do they call it? The description of the podcast. And, um, That works sometimes, especially it works if they say, oh, here's our guest today, if I'm searching for a name. But if it's a topic, sometimes the topic is mentioned in the podcast, but there's no chapter for it, there's no description for it, and so it doesn't end up popping up in search. That sounds like a really interesting tool. I'll have to write that down.

  76. Speaker 1

    Yeah, it looks really interesting to me, too. I've been kind of keeping an eye on it, waiting for it to mature. But he looks like he already has his website up and you can start playing with it today. So I just thought I'd mention that.

  77. Speaker 2

    Yeah, cool. I mean, I listen to podcasts and audiobooks enough that anything in that ballpark is probably interesting for me to at least know it exists, even if I'm not going to use it.

  78. Speaker 1

    Well, I thought that might be helpful to anyone who's listening that, hey, if you like Python or you like parking lots like you were mentioning earlier, you want to learn more about that, there's a cool app out there. And they're not a sponsor of my podcast by any means. They're just somebody I saw recently. And I'm like, check it out. It's cool.

  79. Speaker 2

    It's interesting because that also, if that data got slurped into like, you know, large language models one day, then you could ask the question of what podcasts, you know, talk about this topic and it might even find related terms to that topic. Like I...

  80. Speaker 1

    Yes.

  81. Speaker 2

    Related to parking lot zoning laws. And I heard about single stair reforms recently. It's just all these missing middle housing, all these weird kind of public policy terms that I didn't know existed. Once I hear about the term, then my temptation is, well, I want to go look it up and see what people are talking about here. Do they like it? Do they not like it? What do they think about it? And if it's not audio... I'm less likely to consume it. If it's audio, I go, oh, great. It's an hour long. That's a long time. But I just put it on while I'm doing dishes or whatever. It's kind of something I can put on the background potential. And if I don't like it after five minutes, I shut it off and look for the next one.

  82. Speaker 1

    Yeah. Oh, hmm. Yeah, sounds like a... I think that's a good hobby. I personally enjoy music more than podcasts. Yeah. But, you know, to each their own. There's nothing wrong with podcasts. I have a lot of friends who love listening to them.

  83. Speaker 2

    I love music as well, but for whatever reason years ago, I... I stopped listening to music while working. I decided that silence was more productive for me most of the time. There's certain times that I need the noise to block out other noise. And at that point I have one album, Music for Airports by Brian Eno that I listened to. It became kind of like, I can't listen to it in either context because it makes me feel like I'm working. I don't want to ruin good music with working, but I used to listen to music as my kind of background soundtrack to, you know, chores and that kind of thing. I still do, but I'm not as much of a music nerd as I used to be. And in fact, I don't even know all the music that I like today is mostly the same music I liked 10 years ago. Embarrassingly, right? I haven't kind of progressed in that way, but I do really love music. It's just one of those things that I... it's an, an undervalued hobby for me. It's something I don't do often enough.

  84. Speaker 1

    Yeah. I can understand. Some hobbies are, you know, they take a lot of time.

  85. Speaker 2

    Yeah. Yeah. Which is the reason there's, you know, they're, they're passing fads from me. Typically I don't have ongoing hobbies often.

  86. Speaker 1

    Yeah. Well, anyway, I want to thank you so much for being on my show today, Trey. And it's been a pleasure to have you. Yeah. Thanks for having me. This was awesome, Mike. Yep, and if anyone's interested in learning about what Trey does or the services he provides, I'll include links to his various enterprises in the show notes.