Podcasts

043 - Exploring the evolution of Python with Piotr Gaczkowski

August 25, 2020

Jeremy talks with Piotr about decades of working with Python, DevOps and learning new technologies.


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.

Transcript

[00:00:00.000]

Python has taken over the world. In a previous episode of this podcast, we talked about the history of Python, and today, we're going to talk to someone who lived it.

[00:00:15.912]

Hello, and welcome to All Hands on Tech, where today's leaders talk to tomorrow's technology. I'm Jeremy Morgan. Today we're talking with Piotr Gaczkowski, a Python developer and consultant. He's developed courses for Pluralsight and teaches in-person courses on Python, Docker, Kubernetes, and more. He's been around the block a few times, and he's going to talk to us today about developing in Python for the last 20 years or so. So let's welcome Piotr Gaczkowski.

[00:00:42.397]

So how are you today, Piotr?

[00:00:44.270]

Very good, thank you. How are you?

[00:00:46.777]

I'm doing well. So tell us a little bit about yourself and what you do.

[00:00:50.659]

I'm currently a consultant and a teacher, I would say. I consult mainly on the DevOps-related issues. And as for teaching, I produce content like blog posts like video courses for Pluralsight, but I also teach in-person groups, mostly Python here, but I've also done some classes in other technologies. And yeah, that's basically what I'm concentrated at. I was working as a programmer of different sorts for the last almost two decades, well, maybe less, yeah, less. But recently I've switched more to sharing the knowledge, sharing the experience I've gained and helping others to basically develop their own skills. 

[00:01:47.800]

So how did you get started with Python?

[00:01:50.851]

It was around 2002 or 2003, I believe, so quite some time ago, I kept hearing about Python. I don't really know where I kept hearing about it because at this time, probably the main sources of knowledge were different mailing groups. There wasn't anything like, you know, social networks and stuff like that. So I guess I must have read about it, maybe on some open source list. I'm not really sure. And it kind of looked really promising. I liked the approach, the way that it looked like, basically, easy. The things that you can achieve with a lot less work compared to other languages. Because mostly at that time I had been doing programming in C++ or C, so Python looked really, really, much easier. And at that time, I was also writing articles for, yeah, for a website basically. There were quite a few people, but the CMS that we were using required HTML for formatting. And for me, HTML was fine, but for most of the other editors, it was like something, you know, an alien language, basically. So I decided to write a rich-text editor in Python that people could use to input the text they wanted. And on the output, they would get the HTML formatting that the platform allowed. Because of course it didn't allow the full spectrum of HTML text. So I was thinking, okay, I have the idea for a project. What should I use for it? And I decided, yeah, this Python thing looked really cool. I think I'll start with that. So I just started looking into different resources on Python on how to approach it, how to write user interfaces in it, and, yeah, that was my first project. I really liked Python for that, and it basically stuck with me ever since.

[00:04:09.842]

That's pretty interesting. That method is a little ahead of its time because that's how a lot of blogging and content-management systems work now. You know, you've got kind of an editor, and then it generates out in HTML, pushes out to the site, so, yeah, that was probably a fun project back then.

[00:04:25.881]

Yeah, it was great sharing this with others who were like, oh, yeah, I no longer have to put those weird characters in my text. Thank you very much.

[00:04:36.893]

Yeah, exactly. So what do you think are some of the biggest differences between developing in Python and developing in something like C++?

[00:04:46.379]

This is an interesting question. I've never thought about the differences, but definitely for me, Python is much more suitable for experimenting, doing some prototyping, testing different solutions. Because you don't need to necessarily design everything from scratch before you start working. You can create a few different experiments, see how things look like, how to approach different algorithms. And only once you are sure that this approach would be the best, you can decide how to actually design an application around that. With C++, even if you want to do an experiment, you still have to design this experiment from scratch, deciding on what types to use, for example, deciding what classes to use. It's been a lot easier with the modern C++, with some of the modern additions to it. But, yeah, when I started, this was basically the night-and-day difference, that in Python I had all the necessary data structures I wanted to use. I could basically implement whatever algorithm I wanted, just using the plain types from Python without using anything else. And yes, that also reminds me that the standard library of Python is awesome. You have most of the use cases that you ever want to use already covered without trying to install anything. And, yeah, installing things back when I started Python, I don't even quite remember how was it done. I guess you had to write, as an extension developer, you had to write an installer for each platform. As a user you had to install it manually. I don't recall there was such a thing as pip back then. So yeah, and for C and C++ it was only manually. So even with that, whatever I wanted to achieve with Python, most of the time it was already there. I had library for this, I had library for that, all in the standard distribution. So it also helped a lot, and it helps to this day.

[00:07:20.900]

Yeah, that's pretty nice. Would you say one of the biggest differences between then and now would be the, like, cross-platform capability, like you mentioned? These days you can write something in Python and push it to Windows or Linux or Unix or Mac or whatever, and it pretty much runs the same.

[00:07:35.591]

Uh-huh.

[00:07:35.891]

Now would you say that's one of the biggest differences between now and, like, 2002, or is there a really big difference in how it's developed?

[00:07:45.040]

This is a good question. Back when I started, I didn't really much think about cross-platform operability. I wanted my projects to run on multiple platforms, but I knew that the main platform of distribution would be Microsoft Windows anyway, so I didn't bother about the distribution part, at least. But the main change I guess is with how the entire ecosystem grew during these years. That, as I mentioned, in the beginning there were a lot of, in my beginning at least, I know that Python is a lot older, there were a lot of extensions already, but installing them, using them, wasn't really something that was straightforward. And right now, when we can control all the dependencies, their versions, create virtual environments, all that stuff, it really, really helps with development. And also in distribution, if we think of distribution as, for example, deploying code to web servers. I'm not necessarily talking about distributing desktop applications. And yeah, when I started, I don't think that Python was at all used for web stuff. I think it was possible to do a web server in Python, but nobody was actually considering it. And nowadays, I would say that probably the most of Python's use cases are web related, so this also changed quite a bit.

[00:09:31.233]

Oh, yeah, that's true. I don't remember that either from the early 2000s. I remember a lot of Perl, PHP, ASP, stuff, like that.

[00:09:40.117]

Yes, exactly.

[00:09:41.336]

And now it seems like Python is right there on top of the list. You know, when people talk about web frameworks and APIs, it's kind of right there at the top. 

[00:09:49.274]

Exactly, if you were thinking web, it was basically either PHP or Perl. Or if it was enterprise, it was Java, and that was all.

[00:09:58.402]

So what do you think is one of the biggest drivers that's making Python more popular today in 2020?

[00:10:03.628]

The ecosystem that I've already mentioned, that you can find libraries for mostly anything in Python, this is definitely a strong point. Also, how it grew to be one of the major web platforms is something that really helps its adoption. I have no idea how it happened, but at some point, Python also started to be associated with artificial intelligence, machine learning, data science, things like that, things that, I don't know, 5 years ago I probably had no idea that they existed. So right now it is also, Python is a hot topic because these things are also hot topics. So with this, with web, and also with all the automation related to the DevOps movement basically trying to automate as much of processes as is possible, these are areas where Python really fits well and, yeah, the user base is growing because they want to use it for either of these purposes. That's how I feel about it.

[00:11:14.722]

Yeah, definitely. And it's easier with so many libraries to interact with. Like, I got into computer vision, for instance, about 5 years go, and I started experimenting with it. And at that time, it was mostly C++ to interact with it. So it was kind of difficult. You know, I'd struggle with that a lot because I'm not a C++ developer, and I just kind of put stuff together. So just recently, a few weeks ago, I started playing with it again, and with Python instead. And it was like, oh, this is easy. This is just calling methods, you know, at that point.

[00:11:44.092].

Uh-huh. Also, now that you come to mention, the APIs in Python are much easier to use than, for example, in C++, basically, each library uses their own abstraction, their data structures, most of the time. Yeah, it also changed a bit recently with the modern C++, but a few years ago, it was like a normal thing that each library would implement everything of its own. And you first have to learn, okay, so, yeah, this data structure's basically a tree, these are its methods, okay, cool, fine. With Python, there is this expectation that each library for Python would just expose the so-called Pythonic API. So for example, if there is a tree-shaped structure, it would probably be a dictionary with embedded dictionaries. If there is a list, it would be a Python list, and you already, as a programmer, as a user of the API, you already know all the types, how to use them, what operations are possible. It's also easier to mix and match different libraries, use it as basically the form of a glue. In C++, once again, you would have to first translate or convert between the different conventions used by one library and the other library, and only then you would be able to achieve something with Python. You just get a dictionary from one API, put it as a dictionary to another API, and you have whatever you want to achieve because those two libraries are already using Python abstractions and talking Python, basically.

[00:13:25.939]

Yeah, yeah, that does make things easier with that consistent interface. So you mentioned DevOps quite a bit. And I'm also a DevOps person, and I love DevOps. What do you think Python's biggest role in DevOps is, and why are people using it so much for that?

[00:13:40.747]

From what I feel, Python has always seen some great, how to say it, adoption in administrative work. So first, there was Perl, but I guess that people at some point figured out that reading Perl scripts after some time is very, very hard, so they were looking for some alternative. And Python proved to be one of the sensible alternatives. So for quite some time, it was used in the various administrative tasks. And when people decided to build systems that scale, that use a lot of automated API, for example, to talk to the cloud, to provision new machines, to do whatever it takes, it was just a natural step, in my opinion at least, to just use Python for all these things. So even nowadays when a lot of tools are written in Go language, for example, Python still has a wide adoption in the DevOps circles. And yeah, a lot of tools are either based on Python or using Python or communicate, interact, with Python. So it's still a strong player in this area, I would say.

[00:15:01.610]

Awesome. So what advice would you give someone who wants to learn Python, if they're brand new to it? Like, how to learn it, some things they should look out for, things like that.

[00:15:11.641]

I would advise them to take the steps I took, so basically find a problem that you want to solve, and try solving it with Python. For example, I know a person who wanted to have the home automation system programmed in one way. They had some automated curtains, I believe, that took one protocol. They had something else that took the other protocol. So they basically decided that it's possible to use Python and a Raspberry Pi to connect all these different devices that speak totally different languages together and make them available for a single interface. So, for example, if I want to have a movie night, I can just touch one button, and all the lights would dim, the curtains would close, etc., etc., etc. So if you have something that you want automated, whatever it is, maybe it's an editor for articles, maybe it's home automation, maybe it's, I don't know, doing your yearly taxes, try to do it with Python.

[00:16:23.822]

Yeah, that's great advice. It's learning by doing. You can use Python for pretty much anything.

[00:16:29.618]

Exactly.

[00:16:31.228]

Okay, so shifting gears a little bit, but still with Python, what do you think are some misconceptions that people have about DevOps?

[00:16:38.746]

Oh, there are a lot of misconceptions about it. A lot of people seem to be thinking that DevOps is just the usual ops stuff that use automation and not doing everything manually, which is, in my opinion totally not the case. Automation is a part of DevOps, but for me, DevOps is a philosophy. DevOps is a way that the entire product team interacts how they work together, how they basically deliver and operate things. It's not something that you can say, okay, we'll have this one person responsible for DevOps. No, no, no, the entire team is responsible because doing DevOps requires a different mindset to the one that is presented in waterfall methodology, for example. So one team is responsible for building something; the other team is responsible for running it, even without knowing what it is, how was it built, etc. So this I think no longer works in an agile world and in especially the complicated world that we have today. Because a few decades back, you had this one machine in your server room. You just put some code on it and it was running, it was cool. Nowadays, you have lots of different cloud APIs, cloud services that talk to each other. Each of them had to be provisioned in one way. You know, you need to have some policies to administer them. And there's just too many things to really learn and figure out. So instead of trying to have one person responsible for one thing, the other responsible for other thing, with DevOps you have people that are open to learning new things, new approaches, whenever it is necessary, if this actually benefits the product. 

[00:19:03.669]

Yeah, absolutely, and that's pretty much how I've understood it over the years. I did DevOps consulting for a while before Pluralsight, and that was one of the main things is, I would go to each person, and they were like, well, that's a developer thing, or that's an ops thing, and then I'm like, no, this is an everybody thing.

[00:19:19.879]

Yes, yes, exactly.

[00:19:21.882]

Everybody has to be on board with this idea. So what kind of trends are you seeing in the Python community right now, like some things that are kind of changing or moving with Python?

[00:19:33.051]

This is another good question. Back when I started, I think that Python was like this all-purpose language that was mostly used as a glue code, but also had the aspiration to be everywhere and basically be fitting to everything. Nowadays, I see most of its use shifted to either the dimension tooling and automation or the web, or everything related to artificial intelligence. There is much less desktop applications, or, for example, mobile applications with Python. And I know there are libraries that are still developed that target desktop or mobile, but Python is not really something that comes to your mind when you want to build a desktop application or mobile application. I would say that currently Python is mostly strong at the back end of various web solutions because usually the artificial intelligence projects are also the back end for some web application that gathers the data, processes it, and serves it back. Also, the glue code usually, not all of the time, of course, but usually is just to handle the deployment of the web stuff or make sure that this web stuff runs properly. Currently, I would say that a lot of people may think that Python is back end and that's all, which is not quite accurate. Python can do much more, but still I think the focus is mostly here.

[00:21:12.550]

Yep, that makes sense. So how do you learn a new technology? Like if something comes up, like you mentioned Golang or anything like that that kind of catches you eye, what kind of steps do you go through to learn a new language or technology?

[00:21:25.079]

Currently, there is a lot of open-source projects that you can just contribute to without any previous experience. You just open GitHub, for example, or GitLab, and see the projects that you can create some patches to. And this is usually the way I learn, currently, I would say. So for example, I see the project that I'm interested in, and I see that it could use some help. For example, it needs this feature, or I want to build a plugin to allow something. And, yeah, I just download the project, I try hacking it, I then try reading how to do the thing that I've done properly, improve upon it. When I post a PR I would get the comments from the maintainers that, oh, yeah, yeah, that's very cool code, but I believe that you should use this and this for this purpose. Also, this is the idiomatic code that does that, etc. I mean, that's the way, for example, how I learned Ruby. I just started contributing to a project that used Ruby. And with each pull request I got more and more knowledge from my own research and also from the comments.

[00:22:48:097]

Right, right, well, that's a bold approach to start going with pull requests, but that's good for instant feedback, for sure. That's really cool.

[00:22:56:173]

Yeah, it's great that we can basically learn in an interactive manner, currently. So we still have, for example, books and video courses that we can take the initial knowledge from, but it's not just the initial knowledge that we want to have to actually build some working products. And when we contribute to open-source projects, we get feedback from actual people that are interested in this code because they have to maintain it after all. And then we learn the actual patterns, best practices, stuff that is not necessarily as easy to convey in books or courses because it depends on the context, basically.

[00:23:42:113]

So what are you working on right now? Are there any cool projects or anything you can tell us about?

[00:23:46:778]

Yeah, currently I'm maintaining a book club, which is something of a totally different thing to most of what I've done. And I'm also planning on releasing a small product of mine in the near future that allows to record vinyl records to digital format in a best possible way.

[00:24:14:342]

That's really cool.

[00:24:15:649]

So it's a product in C++, as the libraries that I'm using are in C++, and I have to say that developing and maintaining it is not as pleasant as I would expect _____ yeah. That's what we have.

[00:24:37:572]

Awesome. So yeah, I follow you online, and I have for a while, and I know that you're a big music fan. And so I wanted to ask, what are some parallels between music and Python that you could think of, some things they have in common?

[00:24:50:216]

Wow. I just don't know where to start even. That's a good question.

[00:25:01:198]

Yeah, maybe parallels with composition?

[00:25:03:660]

Yes, yes, I would say that when it comes to actually playing music, I would see some parallels, though I'm mostly passionate about consuming music. I'm not much of a player of any instrument. Though I know there are a lot of people actually who are into both tech and music production or even music production through tech doing composition out of code. That would be a great question to ask them.

[00:25:36:201]

So one final question. If you're going to name a programming language, what would you name it and why?

[00:25:41:026]

Okay, I honestly don't know how you come up with these questions. They're really interesting. This is something like, okay, we were talking about Python and now music? What?

[00:25:53:406]

Yeah, I've got to keep in interesting, you know.

[00:25:56:329]

I've never thought about it. I think that I would avoid naming in a single letter like some languages are named, like C, D, or whatever. This is not something I think is good. Also, yeah, currently, it would be bad for marketing, how to use it in a web search engine, yeah, doesn't make sense. I think I would try to find something quite unique, maybe a made-up word, maybe some quote from, yeah, one of the songs I like, or the books I like. This is probably the way I would approach it, but also trying to think about this marketing angle. Currently trying to search for some information, for example, trying to find anything related to Go is quite, I would say, hard because Go is a common word, which can be in any text. Just searching for it may not bring the best results. So yeah, something musical, I would guess.

[00:27:18:828]

Yeah, so that's one of the things I noticed when I was learning Go in the beginning. I was having a hard time finding things for that exact reason. I would search for something, and if you use the term Go, then all kinds of other stuff comes up. And I think that's why they call it Golang. But programmers, everybody else calls it Go, but it's like Golang on the internet. Yeah, in the ecosystem, they hate it when you call it Golang.

[00:27:40:971]

Yeah, exactly, whenever I search anything related to Go, I just type Golang and whatever the problem I'm having. Because if I just write Go, I assume I would get totally irrelevant answers. So sorry, they just named it in a way that is not really searchable, which is ironic, because it was made by the company that makes search engine.

[00:28:09:064]

Yeah, exactly.

[00:28:17:188]

That was a fun interview and an interesting look into the past couple of decades of Python. If you'd like to know more about Piotr and what he's working on, check out doomhammer.info. Thank you for listening to All Hands on Tech. If you like it, please rate us. You can see episode transcripts and more at pluralsight.com/podcast.