046 - Dig into Python with Douglas Starnes

September 15, 2020

We talk with Douglas Starnes, who has years of experience building and teaching Python. He shares his perspective on the current state of Python, why it's such a powerful language and more.

If you enjoy this episode, please consider leaving a review on Apple Podcasts or wherever you listen.

Please send any questions or comments to podcast@pluralsight.com.



Python is one of the most popular programming languages in the world. Companies like Google, Instagram, Dropbox, and many more rely on Python to run their companies. Today I'm talking with Douglas Starnes. He's a Python programmer. He's a Pluralsight author and tech community influencer from Memphis. He's the codirector of the Memphis Python User Group and has spent many years writing Python stuff. So let's welcome Douglas Starnes.


So how are you doing today, Douglas?


I'm good, Jeremy. How are you?


I'm doing well. So you've done some courses for Pluralsight, and today we're going to talk about Python and your Python expertise. Tell us a little bit about yourself and what you do. 


So I'm Douglas Starnes. I live in the Memphis, Tennessee area. I actually live in the county to the east of Memphis. And I brand myself as a polyglot ninja. I was given that title several years ago by a gentleman who helps run the Git Camp here in town, so I just kind of kept it. But mainly I have Python and .NET tendencies. And I also, as far as professionally, I am a tech author. I'm trying to make a profession out of this, and Pluralsight's a big part of that. And so I also tell people that I'm a professional explainer. I don't really write production for a living right now. I tell people how to write code and work with technology, and it's something that I really enjoy doing. And then also over here in Memphis and in Tennessee and in the southeast United States, I'm a speaker. Haven't been doing much speaking this year, for obvious reasons, but for example earlier this week I spoke at the Chattanooga .NET user group. And then I also help run several user groups in town, so one of those being the Python user group, and also the .NET user group, the Xamarin user group, and the Power Platform/Power Apps user group. I'm also on the organizing committee of two conferences in Tennessee. One is called Scenic City Summit. That one is usually every August in Chattanooga, over in the eastern part of the state. This year it has been officially postponed, again, for obvious reasons. And then also I am part of a new conference that we're trying to put together with the, it's a polyglot conference, but it's being put together by the leadership of the .NET user groups in Tennessee called TDevConf, and we're looking to have the first edition of that in early October.


Oh, nice. So it seems like it's kind of spread out a little bit. Because like the Python world and .NET world are pretty separate, I mean, for the most part. I know there are people that are doing Python with .NET. Which one did you get into first?


Oh, it almost a chicken and egg situation. I got into .NET first. So I have been a big fan of the Microsoft platform for a long time, and actually something that I problem should've said earlier but it's brand new, so I really haven't gotten used to saying it, is that back in May, I was awarded Microsoft Most Valuable Professional for developer technologies for Python.


Nice, congratulations.


Because of my Python activities. But, no, I was hardcore Microsoft and in .NET for---that was probably my first, in fact, my first exposure to software development was actually classic ASP, and then moved into .NET. After, when I went back to the university, there wasn't a lot of .NET going on there. And I already knew about Python, and I was already using Python to do things like administrative tasks. I mean, Python's fantastic for writing one-off scripts to do some utility function or something. But however, I became, I was actually doing exclusively Python at one point. And then things started happening in Xamarin, for example. That caught my attention with .NET, and then of course the announcement in, I believe it was November of 2014, of what eventually became .NET. Because when I started doing more Python, I went over to the Mac side, and Mac support for .NET was not that great at the time, or had not progressed to where it is now, at least. And so I was using a Mac, so when I was able to do---and of course, on Windows, Python support hadn't progressed to where it is now, so I had to switch between one and the other. But now I can do everything on a Mac. So that's kind of the story of where I went. And now that Microsoft is more of a polyglot company now, and actually Microsoft actually had excellent support. They were actually big supporters of Python even before .NET Core and before kind of the polyglot revolution or whatever you want to call it around the company. But now it's really great because I can live in both worlds, and so that's---I can live in both worlds really equally. And oftentimes I will still, even if I'm working on a .NET project, if I need to do something like do some kind of processing on data files or something that I'm going to use in the project, then I'll do those in Python. A good example of that is the MongoDB course that I, like I said, just submitted the last materials for yesterday. And what happened is, the majority of the course uses JavaScript because it's using the Mongo shell with JavaScript. But I need to have example data to import in and work with inside of MongoDB, and to generate that, I use Python. So Python comes in all over the place.


Nice. Yeah, it is what I would say, like, an excellent glue language.




As far as, you know, you have all these different technologies, and you need to make them all talk to each other and work with each other. Like, for me, Python is the one that comes up right away. Like, can we use Python on it?


Right, and Python is generally my go-to. Python has a wider reach, really, than any other language I can think of. So for example, one of the things that I'm---I think most of my content on Pluralsight is data science and/or machine learning related. And if you look in that field, a lot of people---the example I always use is Fernando Perez, the creator of the IPython project, what today now has become Jupyter Notebook. And what happened was, he's a computational physicist, I believe. He's a professor at University of California still, if I'm not mistaken. But however, he's not a computer scientist. He's a scientist, and he's obviously a really a bright person, but he's not a computer scientist. He's not a developer necessarily by trade. And so what he did is, he saw a need, and he saw a need for---because Python is used a lot in science and everything. And he saw a need, and he said, hey, I can use Python to do this. And there's a lot of other people who are not necessarily professional software developers, but they're able to pick up and use Python because, one, it's such an easy language to learn and use, and, two, there's so much reach. I'll be asked sometimes when I do my Python 101 talk, you know, what can Python do? And I say probably the answer is easier, what can Python not do? Because the list is so much shorter.


Yeah, absolutely. And I think that's what's been driving the popularity with Python, is probably the machine learning, AI things, and then IoT. Of course, that's when I started getting back into Python again, was messing with the Raspberry Pi. And I noticed you could just do pretty much anything with it. Is that probably one of the things that's been driving back to the forefront again?


That and how easy it is to pick up. One of the things I say about Python is that you can become dangerous in a weekend and useful in a week. I mean, if you already know another object-oriented language such as C#, Java, even JavaScript. Two things that I heard about Python once and it kind of stuck with me. One is that it's close to the metal, meaning that you can, even though it's an interpreted language, there are ways to get very good performance out of Python by binding Python to native libraries. But the other one is more relevant to what we're talking about, is I can keep it in my head. In other words, I don't have to keep my nose in the documentation just in order to remember the syntax of certain things. Because it's very clean, very simple syntax. So I think the ease with which you can pick up the language is also a driving factor. But definitely the very rich support that the Python community provides across many, many different disciplines is certainly a driving factor upon the adoption rate.


Yeah, absolutely. And have you done any web stuff with Python? Like in Web API or anything like that?


Yes, I have. So most people reach for Django. And Django, I always tell people Django is absolutely fantastic if Django will do what you need. And actually the support for doing things besides you typical forms over data information delivery type of applications has improved, but I was already entrenched with Flask. So I use Flask most of the time. Flask is a microframework, so it kind of stays out of your way, whereas Django is rather prescriptive and makes some assumptions for you. Flask more or less stays out of your way. For example, I'll use the MongoDB course that I just---so in the last module of the course, I wanted two things. First of all, I wanted to take sort of a capstone application that would tie everything in the course together. And also, I had been using JavaScript in the entire course, and I wanted to show that, hey, MongoDB is not tied to JavaScript. Whereas relational databases are tied pretty much to SQL, MongoDB is not tied to JavaScript. So I decided to use Python. And MongoDB is a non-relational database, and Django, although there have been experiments with this in the past, has an ORM that is for relational databases only. Now again, like I said, I know there have been experiments with this in the past using non-relational databases. However, I'm not up on how successful they've been or how far they've progressed. But still, I knew that with Flask, what I could do is, I could take one of the Python drivers for MongoDB, either PyMongo or MongoEngine, and simply pip install the packages and then import the modules, the same I would as in any other type of application. So that's one of the advantages of Flask being a microframework, is it comes with no preconceived notions about how your application is going to operate. Whereas Django generally makes the assumptions you're going to be using a relational database. So the flexibility of Flask, that's why I've been using it for so long.


Yeah, I prefer Flask myself, just because I actually like smaller frameworks for what I'm working on because I'm not doing enterprise Python development or web development at this time, so just using Flask seems to be a little bit smaller and simpler for the small little one-off projects that I do. But Django is pretty cool if you want the kind of batteries-included experience with building a huge, giant website. I would probably choose Django for that.


Oh, definitely. Again, that's what I tell people. If you're doing that forms over data information delivery kind of application, absolutely use Django. But I generally don't do those, like you were talking about, those large, enterprise-scale applications. It is generally right now just one-offs. And deploying Flask is so much easier, with my experience, than deploying Django as well. 


Yeah, and I think those things have kind of built a bridge for people. So a lot of the front-end developers that I've talked to, for the longest time, you know, front-end developers are like, oh, the back end is a scary, crazy place that I don't want to go to, and it's really intimidating. Whereas I've found a few front-end developers that have started to get into things like Flask and Django. As soon as they get into Python and start writing stuff in Python, they're like, wow, this is cool, you know, because they have JavaScript experience or TypeScript. And then they jump into it, and they're like, wow, I'm a back-end developer now. And it's like, yeah, you absolutely are. And they just kind of take off with it. And I think that's one of the coolest things that Python the language has provided, to kind of build a bridge for people who are wanting to go from front-end to back-end development and become full stack. I feel it's a lot easier than jumping into some of the other back-end languages.


I agree, and that kind of reinforces the point that I was making earlier about if you already know another object-oriented or object-based language such as JavaScript, Python is not a far leap to make. So absolutely it's going to be very easy for front-end JavaScript developers to pick up the language and then pick up something like Flask, which there's a very low barrier to entry with Flask, or compared to Django, which is another reason that I like it. So they can make that transition very quickly.


Yeah. And what do you think are the biggest challenges for somebody learning Python for the first time? I mean, you mentioned the Windows thing earlier, so that, I think, a few years ago would've been the answer.


That's not a big deal today. Python runs equally well on Windows, macOS, Linux. You can even get applications for iOS and Android where you can write Python code. There's one called Pythonista for iOS that's really nice. And you can even go online and use something like repl.it, which is kind of like, oh, gosh, I'm blanking out. But basically it's a small online IDE where you can write and experiment with Python snippets and save them and put a link out on Twitter or something or share them with others. So again, as far as that, the barrier to entry is very low. As far as a challenge, I can only see a challenge is, A, if you're wanting to be a front-end developer your Python resources are going to be somewhat limited because JavaScript pretty much has that sewn up. Except now with WebAssembly, that's something---you know, we were talking about Blazor earlier, there are, I'm not up on any of them as well as maybe I should be, but there are packages that I have seen for using Python with WebAssembly, which, in theory, could allow you to write a full-stack web application in Python. But outside of that, if you don't know JavaScript and you're wanting to get into front-end development, Python might not help you that much right now. Other than that, Python, again, it's one of the lowest barriers to entry that I can think of. The only thing would be, again, kind of edge cases and some things. So if you're writing applications in which you really need to tune the performance, Python might not be, so systems programming. You would probably want to go towards a language, something like C or C++. And if you're doing, like, research on TensorFlow or something, then, yeah, Python might not be the best choice. But back to your question about what are the challenges to somebody learning Python, I think, I can't even say that attention span and patience would even be as much required as they are for some languages because you can pick up the language so quickly and easily. And this is also, this point is reinforced by, if you look at Python conferences, many times they will have a young coders session, which is reserved for children generally between the ages of, I've seen children younger than 10 years old at these, but generally it's, you know, around middle to high school age. And they bring them in, and they teach them Python. And that's because, again, when you're teaching children to write code, you want to have as few barriers to entry as possible, especially if you're trying to teach them in a day. So if you can teach children how to use Python in a day, then somebody who has experience in another programming language can definitely learn it.


Yeah, absolutely. One thing I noticed, that you did a course on the Python standard library. And I recently just released a course on the Go standard library, and I'm super passionate about that particular standard library. What could you tell us about the Python standard library and why somebody would want to use it?


So the Python standard library, if you go into the documentation for Python, you're going to see two parts. You're going to see the language reference, and you're going to see the standard library reference. The language is, of course, everything is built into the language, the syntax and the built-in types and language constructs such as loops and conditionals and things, classes, and such like that. The standard library is distributed along with the language, so it's not like it's a separate download or anything. But I don't like to describe it as the things that the language forgot because if it was things that were integrated into the language, the language would be so big that you wouldn't be able to keep it in your head, as I said before. So it's a bunch of utilities and helper classes and such, things such as file I/O, string handling, network access. There are some additional types such as names, tuples that come in there, JSON handling, random data generation, things like that which are often going to be a part of an application, not just in Python, but really any application, but that you don't want to have integrated into the language. So like you said, the Go standard library has a facility like this. .NET has the Base Class Library. So this is similar concept to those. And like I said, you can just about guarantee that the Python standard library is going to be available on any system that has Python installed on it, so you can be sure that it uses the random data generation classes. My machine, when I deploy it, I'm going to have access to those wherever I deploy my application as well.


Yeah, that's super important. What are some common misconceptions you think people have about Python? 


The first thing is the reach that it has. Python is far from being a one-hit wonder. It's not a jack of all trades, master of none, but it's not a one-hit wonder, either. Because people ask the question, can I do this with Python? And my response is always, you know, what can you not do with Python? That's what I've found it is. The other common misconceptions that you still might have, people who have not stayed up to date on Python, is that it doesn't run well on Windows. Again, that is totally not the case today. I write code across Windows and Mac using Python, and it works equally as well.


Yeah, I've been doing that a lot lately, where I'm on my laptop that only has Linux. And, you know, working on something, and push it over, and I've noticed when I can open it up in Windows it's the same kind of thing, and it's really nice. Most of the stuff works just…


It's very easy, it's seamless, and if you're using a they'll like Visual Studio Code, you get the same developer experience across different platforms. So, yeah, it's absolutely fantastic. 


Yeah, and do you think people are still struggling with the move from 2 to 3 at this point, or are we pretty much in the clear in that area?


I switched to 3 a long time ago. I have not used 2. There was something that I actually installed. It's kind of strange because I installed it on New Year's Eve last year, and of course EOL, Python support for Python 2 officially ended the next day on January 1, 2020. But it was some Edge case, something I was just experimenting with, but I don't remember what it was. But that's really the only thing that I personally have come across in a long time that has required Python 2 that I remember. So I have seen---but a majority of your mainstream libraries and frameworks and packages and applications have made the switch completely to 3, or at least support it.


Yeah, awesome. What do you think the future of Python looks like in the next 5 years or so?


It's only going to continue to grow. Like I said, I don't know of anything new on the horizon. I'm only going to see it grow, especially with the end of life of Python 2, people can now begin to focus on the new and innovative features that are coming into Python 3. I think 3.9 is currently in development. And the other thing is, feels like it's going to continue to grow, again, like we said, because it feels like machine learning and data science. You mentioned IoT earlier. That's actually something for the young coders sessions that we'll sometimes do is, we'll put them on a Raspberry Pi because they can take the computer home with them, plug it into a TV, hook a keyboard and a mouse up to it, and they can pick up where the left off. So it's only going to be able to bring more people into the Python community and bring more people into software development and into technology in general.


For you personally, how do you learn a new technology? So, do you have a specific process that you go through or techniques to learn something new?


I don't know that I have a formal methodology or anything. Google and Stack Overflow and GitHub are always your friends in this situation. But one thing that I do is, I generally start off, I look at code that other people have written. I generally take a code-focused approach to things. In fact, I was commenting with my ASM the other day that I don't know if I could create a course that didn't have live code demos in it. So I'm very code focused. In fact, the same goes for when I present. I always have to have a code demo of some kind. I always have to have something where I get my hands dirty. And that's one thing is, I do try to get into an implementation as soon as possible, when I can. Outside of that---and then it also depends on what I'm trying to learn, you know, different tools for different situations, because technology today, and software development and IT is so much more than the code. For example, Azure Machine Learning Studio, a low- to no-code environment in which you create machine learning workloads that you can augment with Python. But environments like that and in things like the Microsoft Power platform, in which you have Power Apps and Power Automate, which are low- to no-code environments as well. So at the risk of sounding like a copout answer, it depends. But I do like to get to an implementation as quickly as possible so I can begin to prove what I'm learning.


Yeah, that makes sense. What are you working on right now that you can tell us about?


Like I mentioned many, many times before, the MongoDB course will be coming out soon, and then I'm going to actually be starting a Flutter course, mobile development, cross-platform mobile development in particular is something that I'm really interested in. And I love the idea that you can write a single codebase and have it not only go to multiple platforms but multiple types of applications. And I've actually done a cross-platform mobile course. I did a Xamarin course back earlier this year also. So it's something that I'm definitely interested in, as far as Pluralsight is concerned. I'm also, outside of the conferences and the user groups and---because I'm still trying to keep user groups alive. That's one thing, constantly sourcing speakers. Got a really cool guest speaker for the Python user group on Monday. He's going to talk about Azure Notebooks, how to use Azure Notebooks. And I understand that there are going to be Animal Crossing references. And when she told me that, I said, you had me at Animal Crossing. Because we can always use a good Animal Crossing talk. But any rate, and then, however, I'm working on, I just started doing work for a company in Canada, that's a company, have a site and everything. They're a company called Real Python. Just finished my first project with them, and I'm working on another one. I've got my own content that I'm looking to market myself. I wish I could reveal that today. I wish it was ready, but it's not. And then one of the things about getting the MVP award that I was really excited about, was now not only do I get to continue to participate in the community with the speaking and such, now I've got extra resources that I can do this, and Microsoft expects it of me to do this participation. So I keep on looking for ways to do that in Python and beyond. And overall, this is something, I'm one of these people that, this is my life. This is what I do. I mean, I don't do it 24/7. There are other things that I do. I do from time to time pretend that my music degree is still relevant. And still I have a small studio here that I work in sometimes when I'm not making courses. And so it's not all technology. But I am one of those people who, it's not necessarily this is the job that I have to finance the life that I really want. This is my life. Even when I'm not doing something that I'm not getting paid for directly, I'm probably thinking about how could I use technology? What's new? What's different? What's interesting? Things like that.


Yeah. Totally understand that. I do a lot of stuff that I don't get paid for that I do just for the love of coding and building things and experimenting. So yeah, I totally understand that.


And you just hit on something there. You said "building things". And, yes, that, I guess the question that you asked about how do I learn something? I had a professor that, when I worked for the university, the professor that I worked for, he always told people when you're learning something you have to have a goal. And yeah, and so I guess that would be the best way to sum it up, is that goal that I have when learning something is to build something.


That's probably the best way to learn anything, I would imagine, in any field, is to have something you can hold in your hand, figuratively or literally that you've built. So do you think there's a connection between your love for Legos and Python?


[Laughs] Well, Legos are building things. Now, I will say that I am a little bit less ambitious than some of the people, for example, that I see streaming on Twitch, in which they will actually take, they'll go down the street to a retail store and get one of those big boxes of Legos that's pieces and dump them out on the table, and you'll be able to visualize something and build something out of Legos. I'm not quite that ambitious. But, yes, you are building things. And it is the process of construction and creation. So just like music, again, same way. In fact, there's a story, I forget where I read it, but back when IBM invented their variant of the personal computer, back in the late 80s, and they were looking for a new breed of programmers to take on this new machine that wasn't a mainframe. And they went out looking for two types of people. They went out looking for accountants and musicians. But at any rate, because of the thought processes and how you structure, and dealing with structure and everything. But, you know, music also, because I was a composer, is, again, building something. So, yes, so basically, I like to build things, whether that's with code, whether that's with little pieces of plastic, or whether that's with sound. Still building something and having a product at the end to show is something, like, again, you always need to have a goal. 


Yeah, absolutely. So I've got one final question for you. So if I'm going to travel to Memphis at some point, what is one meetup, and this is assuming that meetups are happening again. But I guess if I'm traveling then that means that they probably are. What is one meetup that I would have to go to, and what's one restaurant that I would have to go to?


Well the meetup you have to go to is obviously the Python user group.


Yeah, that's probably is the one I would go to.


To be honest, they're all, I mean, we have a lot of good ones here. Now one of the reasons that you would want to go to the .NET user groups, the .NET and the Microsoft user groups that we have in Memphis is, Microsoft just opened a beautiful brand-new office in Memphis. And from day one they have allowed us to crash their party. And right now even when we're having the virtual user groups, Microsoft is providing Teams meetings. They're letting us piggyback off their Teams tenant to hold virtual user groups. So you can come to Memphis user groups even if you're not traveling. And it's actually interesting. I have had people internationally attend the user groups that I help run, which is really cool. But no, the Python user group, the .NET user group, we have a very active web workers user group here, which is a combination of both web development and design. So we have a lot of different user groups here. I am going to be partial to, of course, the one that I help run, but they're all good. And the restaurant that you must go see. So obviously, Memphis is known for its barbecue. My personal favorite is the Germantown Commissary. It's a little, I don't want to say hole in the way, but it's one of those places that you wouldn't notice unless you were looking for it, probably, so if you didn't know it was there. But it is absolutely fantastic barbecue. Barbecue nachos is one of the things that they do really well. But what's interesting about it is, so we have a professional golf tournament that comes through Memphis every year, and Germantown Commissary is relatively close to that golf tournament. And in the lobby of the, or the waiting area of the restaurant, of the Commissary, they have pictures of all the professional golfers, autographed pictures of all the professional golfers that have eaten there. So like Phil Mickelson has, they've got an autographed picture from Phil Mickelson in there, which is really cool. So I would say that the Commissary. Now, there also are other things here. There's kind of a local, regional chain, I believe it's just local and regional, called Swanky's Taco Shop that is absolutely fantastic. So those would be my recommendations. And fortunately, there is a Swanky's Taco Shop within a reasonable range of Germantown Commissary, so you could have lunch at one and dinner at the other.


Oh, nice.


This is an interesting fact about Visual Studio Code that some people are surprised about, so this could also go back to the misconceptions of Python. Visual Studio Code out of the box is very minimal. It's kind of like Flask. It doesn't get in your way. It doesn't make a lot of preconceived notions. So everything, so the power of Visual Studio Code, and I've actually got a couple of guides that I've written on Pluralsight about Visual Studio Code and it kind of speaks to this. They have extensions. And there's like 21,000 of these extensions and everything. And even .NET Core support does not come out of the box with Visual Studio Code. You have to install it with an extension. But the number one extension for Visual Studio Code is Python.




So that is something that's sometimes people are---so, yeah, it came up in the back of my mind when we were saying that earlier, so I thought I'd go ahead and bring that up.


Nice, yeah. I've done some quick editing in Code, but I've gotten really used to PyCharm over the years and I've had a hard time breaking away from it when I'm building on things. But I'll definitely check out that Python plugin in Code a little bit more because that's where I do most of my coding these days, is in Visual Studio Code.


PyCharm is fantastic. And you have a cross-developer experience across Windows, Mac, and Linux with PyCharm. I'm definitely not, and there's a free version of it. There's a free community version of it. And PyCharm actually has the best visual debugger for Python, and that's hard to do. Debuggers for Python, debugging dynamic languages has really been difficult. And PyCharm had the best one first. But what I like is, I just like the fact that Visual Studio Code stays out of my way. It doesn't try to help me a lot. It only helps me when I want it to. And also getting that cross-platform developer experience, that consistent developer experience across platforms and not being dependent really upon a particular language. So I mean, and again, in the MongoDB course, I showed off the flexibility of Visual Studio Code by using it as a MongoDB client and using it to write the Flask demo app at the end. And also even other ways of programming, such as, there's a fantastic interactive console inside of Visual Studio Code. You can, Jupyter notebooks inside of Visual Studio Code. And this all comes as a benefit of just installing that Python extension. It's the top of the list. You can't miss it.


Nice, yeah, I'll have to check that out. Well, thanks for talking with me today. This was really great.


Thank you for inviting me. I'm always eager to talk about Python and technology in general.


That was an excellent conversation with Douglas Starnes. You can check out his courses on Pluralsight or connect with him @poweredbyaltnet on Twitter. Thank you for listening to All Hands on Tech. If you like it, please rate us. You can see episode transcripts and more info at pluralsight.com/podcast.