This week, I’m joined by Moshe Zadka, a senior site reliability engineer at SurveyMonkey. Moshe is a core developer for the Twisted framework and a Real Python author.
In this interview, we discuss a variety of topics, including the Twisted framework, Python for DevOps, writing Python books, and tai chi.
Ricky: Thanks for joining me, Moshe. I’d like to start with the same questions I do with all my interview guests: how did you get into programming, and when did you start using Python?
Moshe: The first programming project I remember working on was a project for class, converting numbers from decimal to binary in Basic. The teacher thought this was a little advanced for a seven-year-old, which was my main motivation for finishing it.
I got into Python in 1999. I was frustrated with the data formats we were using on a project and thought moving things to XML might be an improvement. I looked for a language with decent XML support that was easy to install on Linux. Python seemed like the best alternative. I downloaded the tutorial in the evening and found myself productive in Python the next day.
Ricky: You’re a core developer for the Twisted library. For those who haven’t heard of Twisted before, what is it, and what sorts of applications are best suited to use it?
Moshe: Twisted is an event-based framework. It is well suited to writing network applications. The event model is well suited to handling multiple connections while maintaining coherent state because it avoids race conditions. This makes Twisted suited for game servers or clients, chat applications, and long-running web applications like Server-Sent Events.
Ricky: By day you’re a senior site reliability engineer at SurveyMonkey. How does Python fit into your day-to-day practice as an SRE?
Moshe: Python is popular in the site reliability and automation space for many things, but one use that is often neglected is small data processing. Sometimes I need to analyze log data or metric streams from a handful of machines in order to troubleshoot a problem.
In a recent such incident, a typical chunk I needed to analyze was a few thousand data points. This is not a lot of data for Python, even pure Python, but it is a lot to look at by hand. Writing ad-hoc analysis in Python allowed me to diagnose the problem.
Ricky: You’ve authored several books to date, including Expert Twisted, DevOps in Python, and from python import better. What have been your motivations for taking on such an enormous task as writing a book, and what have you learned the most from writing them?
Moshe: I managed to get in with a less-committed experiment: Expert Twisted was a joint project of several authors. I only had to write two chapters, which made for a much less scary commitment. I enjoyed writing the chapters, but working with this many authors was a complicated coordination effort. Though many of them are close friends, the first thing I learned was that I never want to work on a collaborative book again!
I wrote from python import better because I was already in the habit of daily writing and was interested in what it is like to self-publish an e-book. It was an interesting experiment, but I decided that I want to let a publisher deal with some of the logistics.
For DevOps in Python, I worked with the same publisher I got to know working on Expert Twisted. That was definitely the best book-writing experience I had. However, it was still a lot of work, and I discovered that the often-stated principle that it is hard to make money from technical books is true. After three books, I decided to take a break from books—at least for a while.
Ricky: Now just a few last questions. What else do you get up to in your spare time? What other hobbies and interests do you have aside from Python and programming?
Moshe: Right now, I’m experimenting with writing yet another Python version manager. I was dissatisfied with some of the design decisions in pyenv and wanted to do better. My personal project pyver is already good enough for me, and I am working on cleaning it up enough to be useful for others. I am also taking an online class to learn how to use PyTorch.
My main “pandemic hobby” is tai chi. After years of looking for a style of exercise that fit my personality and lifestyle, tai chi is it. I love practicing it at home. I have also started meditating regularly, and I find the practice helps me stay centered and focused on the important things.
Ricky: Thank you, Moshe, for taking the time to talk to me.
If you’d like to get in touch with Moshe about Twisted or anything else we’ve talked about today, then you can contact him on Twitter.
If there’s someone in the Python community that you’d like me to interview, then leave a comment below or reach out to me on Twitter.