PyDev of the Week: Eric Matthes

This week we welcome Eric Matthes (@ehmatthes) as our PyDev of the Week! Eric is the author of the popular book, Python Crash Course. He also created a neat set of Python Flash Cards that I reviewed earlier this year. You can catch up with Eric on his website or check out some of his work on Github.

Let’s take a few moments to get to know Eric better!

Can you tell us a little about yourself (hobbies, education, etc):

Sure! I grew up in southern New Hampshire, on the outskirts of Boston in the early 1980s. My father was a software engineer at DEC around that time, and I first learned to program on a kit computer in our basement back then. I am so grateful to my father for sharing the technology he had at home, instead of telling me to keep away from it all. It has been amazing to watch computers evolve from the early days of almost no one having a home computer to almost everyone having multiple computers in their lives.

I loved math and science in high school, and I went into undergrad as a chemical engineering major because I loved AP Chemistry. But I soon found that engineering was really about learning to solve other people’s problems. I enjoyed my physics classes though, because they were all about understanding the universe, from the very large to the very small. For a while I naively worried that if I stayed with physics long enough I’d start to find the world less interesting as I understood it on a deeper level. It was a joy to discover that the opposite was true: the more I learned, the more fascinating everything around me became.

I continued to learn new programming languages throughout my educational experiences. I took a variety of programming classes, and always had a few projects going for fun. I wrote a 3d graphing program in C during spring break one year in college.

I wanted to be a particle physicist, but I didn’t want to be a student forever. I decided to try teaching for a couple years, and quickly found that the intellectual challenge of trying to reach every student in my classes was just as satisfying as doing hard science. I loved teaching, and decided to stay with it.

In 2011 my son was born, and a month later my father died. It was a really hard time, but it was also a formative experience for me. My mother asked me to look through my father’s computer and let her know if there was anything worth saving. It was a really intimate experience, looking through all the projects he was working on, and reading through his notes. I used to visit him in his office whenever I went home, and as long as his computer was open and running that day I still felt directly connected to him. It was sad to realize these projects would never be finished, and would never be used by anyone. In the weeks that followed I realized that if I died you’d find a bunch of half-finished projects on my computer as well. I made a commitment to start using the skills I’d learned to build something meaningful.

I wanted to build tools that would bring greater equity to public education. I gave a talk at PyCon 2013 about how much the educational world could gain from the open source model, and Bill Pollock of No Starch Press approached me afterwards. “I hope you build what you described, and if you ever want to write a technical book let me know.” I went back to my classroom and saw a poster hanging on my wall: “What’s the least you need to know about programming in order to start building meaningful projects?” It was a list I had made for my students of the smallest set of things they needed to know in order to be able to build the things they cared about like games, data visualizations, and simple web apps. I realized that was the book I wanted to write, and the question on that poster became the guiding question for Python Crash Course. I hadn’t intended to write a book, but I realized that in five years of trying to teach programming to high school students, all the resources I found were either aimed at young kids, or assumed more technical knowledge and experience than my students had. I decided to write a book for anyone old enough to not want a kids book. It has been immensely satisfying to see that Python Crash Course works for almost everyone in that anticipated audience: young kids motivated enough to want a more serious book, high school students, undergrads in all majors, grad students, working adults, and retired people who are curious to learn programming at an older age. I was surprised to find it even works well for people who are already fluent in another language, and want to pick up Python quickly.

I don’t just do technical work. After growing up in New Hampshire, I moved to New York City for seven years in the 1990s-early 2000s. I bicycled across the US a couple times during the summer, and then lived on a bicycle for over a year at one point. I rode from Seattle to Maine, down to Florida, over to California, and up to Alaska. That was a life-changing experience, and I moved to southeast Alaska for good in 2002. I love living in a sizeable but isolated town right on the edge of true wilderness. When I go trail running, there’s a very real chance I’ll see a brown bear. Server crashes are a lot easier to keep in perspective when I’ve had close encounters with bears in the woods. I love steep mountains, and I’ve been an active member of a technical rescue team since I moved here. I also love living a partially subsistence life style. Every year we catch our own king salmon, sockeye, coho, halibut, crab, and deer. It’s wonderful living in a community where almost everyone goes out to fish, hunt, and gather a good deal of their own food.

Why did you start using Python?

My language of choice in the mid-2000s was Java. I had used C for a while, and liked the higher level libraries that Java offered. Then a friend said, “Hey you should check out Python. Your programs will be about a third as long as they are in Java.” Like many people new to Python at the time, I was pretty skeptical of the use of whitespace instead of braces, and I was surprised I didn’t need to declare variables. But these ideas were more intriguing than off-putting. I was working on a project to make artistic representations of random walks, and I had built a desktop application for generating and styling random walks. I rewrote the application in Python, and it really was about a third as long as my Java program. I was floored, and I’ve been using Python for almost every project since then.

When asked why they use Python, people famously say, “I came for the language and stayed for the community.” That answer certainly speaks for me. After my father died and I decided to take my programming work more seriously, I looked for a technical conference to attend. I am so grateful that I stumbled upon PyCon. I first went in 2012, which happened to coincide with some of the early diversity and Code of Conduct initiatives. I watched as the community set clear diversity goals, made specific plans to achieve those goals, and followed through on those plans. When I go to PyCon now, I see a fully diverse crowd, and the variety of topics that are presented is just awesome. The Python community is answering the question, “If we make programming accessible to everyone, what will people build?” It’s critical that we give people from all walks the power that programming offers, and let people build projects that serve their own needs, and the needs of their communities.

What other programming languages do you know and which is your favorite?

I started with Basic in the 1970s and early 1980s. I never got too deep into any language until Java and Python in the mid 2000s, but along the way I gained some understanding of Logo, C, Pascal, Fortran, HTML, CSS, JavaScript, and SQL.

I use Python almost every day now. In the next year or so I really want to solidify my understanding of SQL, and I’d like to explore a functional language like Lisp or Haskell. I’d also like to play around with a variety of languages I’ve heard about but never used such as Rust and Go. I don’t ever want to get stuck with Python because it’s what I know; if something better comes along, I want to evolve with the industry.

What projects are you working on now?

I just retired from teaching to focus full time on writing and programming. As Python Crash Course became more established, supporting the book gradually became a second job. As a full time teacher with a young son, all of my writing work needed to happen before 7am or after 9pm. That’s been hard. I am so happy to be finished with classroom teaching, and be free to follow up on the many opportunities that have come up as a result of the success of this book.

My most recent project involves a local nonprofit that’s working to minimize conflict between longline fishing crews and sperm whales. Longliners set mile-long lines on the bottom of the ocean, with hooks every 10 or 15 feet. They target bottom feeders like halibut and sablefish (black cod). They let the line soak for 6 hours or so, and then haul the line back to the surface. Sperm whales have learned to hang out near longliners, and they can pick off almost every fish on a mile-long longline just before it’s brought to the surface. I’m working with a team that has fishing boats tow a hydrophone array on their way to the fishing grounds. The data from the hydrophone array is used to map the location of any sperm whales in the area, and these locations are broadcast to any boats in the area. The goal is to help everyone avoid fishing where the whales are, to the benefit of the fishing crews and the whales. (Longliners are *not* trawlers. Bottom trawlers drag nets across the bottom and destroy everything in their path. Longlining is a sustainable fishery, and has comparatively low bycatch rates.) My role in the project is to help get data from the satellite devices on board the fishing boats to the people who can map this data and get it back out to the boats on the fishing grounds. It’s a privilege to work with such an interesting group of people from the fishing and scientific communities.

I am also working on:

  • Updating the Cheat Sheets that accompany Python Crash Course. These have been immensely popular, and I look forward to releasing the updated version later this summer.
  • Adding new sections to the online resources for Python Crash Course. I’m planning to add a set of Challenges that go beyond the exercises in the book. I also want to write a series of articles and discussions that build on what people have learned in the book. I’m planning to develop a set of teaching guides as well, to support the use of the book in academic settings.
  • I’m working on analyzing local weather patterns to help address the impact of climate change on our community.
  • I’m working on a project that should help math teachers, students, and mathematicians share high-quality math problems.
  • I’m working on a project that should lead to higher-quality education standards in all subject areas. I am hopeful that this project will lead to better tools for teachers, students, and parents.
  • I am getting ready to write a followup to Python Crash Course.
  • I’m watching how people use the Python Flash Cards I developed with No Starch Press. They haven’t sold particularly well online, but people love them when they see them in person. I’d like to publicize the ways that people are using these to solidify their understanding of Python.

Which Python libraries are your favorite (core or 3rd party)?

It might sound boring, but I love ReportLab. I would like to see a more open standard than PDF, but the reality is that PDFs are one of the easiest formats for people to share documents in. Unless you want to be an idealist rejecting any project that involves PDFs, sooner or later as a programmer you’re going to have to dig into PDF internals. I’ve worked on some really impactful projects that use PDFs in a critical role. When I’ve had to do that, ReportLab has made the work approachable. I did that before you wrote your book on ReportLab; now that I’m finished with classroom teaching I’m looking forward to working through your book.

I also love MatplotLib and Plotly. Matplotlib is the foundation for many modern Python plotting libraries, and I strive to maintain fluency with it and use it for a variety of projects. I always look for a friendly higher-level visualization library to work with as well, and right now Plotly fills that role well. I like that Plotly has ports in a variety of other languages as well. Requests has been really helpful in dealing with any network-based data source. I also love Jupyter notebooks for exploratory visualization work, and for educational projects as well.

I absolutely love Django. It’s a great time to become a programmer, and when I think about why that is, Django is one of the first things that comes to mind. When I was growing up, if you had an important program you were working on and you wanted to share it with the world, you needed to find a way to distribute physical copies of your code to the rest of the world. That was a daunting task, and really something only a professional programmer could do. Now if you have an idea and some basic programming skills, you can build a simple web app and have your project available to the entire world in a day. That’s incredible! Django isn’t really about building web sites; it’s about using a web site as a way to share your programming work with the rest of the world. I’m really looking forward to helping more people understand how to use Django to make their small projects available to the rest of the world quickly, and with confidence.

What inspired you to write “Python Crash Course”?

I spoke about this earlier, but I’ll add a little bit to that. It was really frustrating to try a wide variety of learning resources with high school students, and watch them not work for a variety of reasons. Things worked out for my students, because I had enough background knowledge to fill in the gaps for them. I recognized that independent learners, and teachers without a strong programming background, would probably abandon many of these resources and even give up on learning to program.

I decided to write a book that made no assumptions about the reader’s technical background, while respecting them as a mature learner.

What did you learn going through the writing / publishing process?

Oh my. It’s really true, you learn as much from being the teacher as you do from being the student. I have learned as much from writing Python Crash Course as people do from reading it.

Writing a book is a concrete project. You’re never really done writing a technical book, but there are really concrete milestones. It was really nice to have a project I could fully commit to, and know there would be a finished product I could hold at some point. That’s very different from classroom teaching. I learned about commitment, completion, professionalism, and deep humility. No book is ever perfect, especially a longer technical book. It is deeply humbling to have mistakes pointed out, and to have to stay vigilant for required updates.

Do you have any advice for aspiring writers?

First, it is every bit as much work as people say it is, and then some. I thought I’d need six months to write Python Crash Course, and it took almost two and a half years. Find a need of your own that you want to fulfill, and write to address that need.

Pay attention to the process. Learn to use a version control system like Git, and consider how to use it as a technical writer. Your commits should not be the same as they are when working purely as a programmer. For example every time I make a screenshot for a book, I make a commit with a message such as “Generated screenshot 15-4.” That way when the production editor asks for a series of updated screenshots, I can check out those commits and easily regenerate any screenshot at any time. Also, when developing new material, I write a program and make commits about any point of the development process I want to explain to the reader. This lets me focus on developing a meaningful, well-architected project, and then go back to focus on the writing later.

If you write a technical book and get it published, keep it updated! So many technical books go out of date more quickly than they need to. As an author, you can make minor corrections and updates every time your book goes through a new printing. The first edition of Python Crash Course went through about eleven printings. Almost every new printing involved some minor corrections or updates. For example, the Django project was originally written using Django 1.8. The latest printing of the first edition used Django 2.1. A huge part of the success of this book has been due to these updates. If I never updated the book, people would have criticized it as increasingly out of date a long time ago.

If you’re interested in writing a technical book, write online first. It’s a great way to practice writing, and to gain a following as someone who knows what they’re talking about on a specific topic. It’s also helpful for knowing how to develop and maintain a set of online resources for your book.

Finally, just read and write. Read non-technical books as well, so your technical writing isn’t too dry. Even a technical book tells a story, and good technical writers are good storytellers as well.

Is there anything else you’d like to say?

There’s a lot of talk today about everyone learning to code. I’m not convinced that everyone should learn how to code, but I am absolutely committed to the idea that everyone who wants to learn how to write code, should be able to. Tear down all the walls! Programming is power, and that power needs to be shared with almost everyone who wants it.

If you’d like to share your thoughts about Python Crash Course, I have a survey for gathering feedback. I’m using the results of the survey to continually refine the book, and to have a better sense of what other learning resources to develop.

If you’d like to know more about what it’s like to live on a bicycle for a year, I wrote about it in The Road to Alaska. It hasn’t received as much attention as my technical writing, but it’s a fun read if you’re into travel stories.

I’m @ehmatthes on Twitter, and if you want to get in touch feel free to email me at ehmatthes at gmail. Thanks everyone!

Thanks for doing the interview, Eric!