PyDev of the Week: Matt Harrison

This week we welcome Matt Harrison as our PyDev of the Week. Matt is the author of several Python books. He is well known as a speaker at PyCon and other conferences and user groups. Last year, he released a Python Training Bundle which is a Python course for learning 90% of Python. Let’s spend some time getting to know him better!

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

I should preface with: I use emacs, so you can stop reading now if you need to 🙂

I run a small company, MetaSnake, that offers intense Python training for professionals, and consulting services around prototyping, data science, and generally being efficient with Python. I grew up in Utah, but went to school at Stanford and stuck around the Bay Area for a while after graduation, working for various startups. My biggest time-suck has been Ultimate (frisbee), beginning in college. Being in the Bay Area, I was able to play in pickup, leagues, and club year round and almost any day of the week. (This actually was a wonderful networking opportunity, because it turns out that nerds tend to like ultimate and I met and played with many interesting folks).

I’ve worked across varied domains over the years: HA, search, open source stack management, BI, storage, data science, education, and mobile app design. Most of those tasks were accomplished using Python. Ă‚ I have been programming with Python for 15 years now, and have seen it grow a bit. When I started working, we needed to hide that we were using because pointy-head types didn’t trust any old language. Now, Python is one of the most popular languages around, being taught at Universities and used in both startups and established companies.

mharrison

We relocated to Utah to be closer to family. Though nothing compares to the tech scene in the Bay Area, I’m happy here. Having four seasons is wonderful (I skied 18 inches of powder this morning), but even in Utah, I have access to year-round Ultimate. The tech scene is improving: there are plenty of local user groups and conferences to keep nerds happy. There is a huge demand for Python developers here.

I’m a big believer in helping others and paying it forward. I help run the Utah Python user group. In addition to speaking and doing training at conferences, I have been volunteering to teach 8 week long programming concepts to elementary students for the past five years. This has been rewarding and interesting. Even though kids have more access to technology than previous generations, they are dealing with devices and apps that shield them from understanding how computers work. It has been fun to try different approaches to illustrate the underlying, hidden computer science concepts to them. My latest attempt was to use drones, and I think it was pretty successful.

Why did you start using Python?

At the first startup I worked at out of school, I was working with some really smart folks on information retrieval. A colleague and I were tasked with implementing tf-idf for an internal tool. He was familiar with Tcl and I was using Perl at the time (I had been told that if I learned Perl while in school that I would be much more “employable”). Neither of us was interested in crossing the bridge to the others’ language. But we were both interested in Python and decided that was a happy compromise. In the end we finished the project in three days and both of us promptly began to use Python as our “go to” tool.

While I appreciated Perl, I found it to be a write only language. Python, in general, meshed with my sensibilities. I can take pseudocode and implement it in Python in the same amount of lines. While Python the language has various warts, I’ve yet to find another language that gives me the productivity that Python does.

 

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

I have used JavaScript, Java, Perl, VisualBasic, C#, C, C++, and Lua for various work related tasks over the years. In school I have learned Prolog, Pascal, Fortran, and Lisp. Like many my age, I got my start doing Basic on a Commodore 64. My go to tool is Python.

In a current consulting engagement, we are doing a lot with Clojure and ClojureScript. I appreciate functional programming, and Rich Hickey has done a great job shepherding Clojure. I think Python programmers would do themselves a favor to look into functional constructs because they can be applicable in Python as well. Most people coming out of school right now seem to be indoctrinated in OO programming, and while Python supports that style of programming, it also enables imperative and functional styles. I think these latter styles are often cleaner and more succinct. Having said that, I’m aware of more than one company that has attempted to use Clojure for tasks that Python excels at, only to eventually come back to Python.

 

What projects are you working on now?

For my training clients, I work with them to construct customized training that will bring professional programmers up to speed in Python quickly. Students or hobbyists can generally take their time and browse blogs or documentation, but for professionals it is imperative that they understand the syntax knowledge, warts, best-practices, and libraries quickly. I work with clients to tailor that transfer of knowledge.

harrison_adv_python

One nifty tool that I created and use for training is rst2odp, a tool for converting rst to (Open|Libre)Office presentations. A nice benefit of using rst is that I can run doctest on all of my slides and make sure that the code in my slides actually works.

My consulting consists of strategic planning and implementation of both applications and analysis/data science projects. Here I use the whole Python stack: Flask, SQLAlchemy, pandas, matplotlib, and others, even foraying into projects such as IronPython. I recently started using the Luigi project which has been very useful for building analytic pipelines, and I wish I had used it previously.

Below are a few of my github projects. I find it interesting that my two most popular github projects are not even Python:

  • epub-css-starter-kit A collection of css for creating well formed ebooks on the most popular ebook platforms
  • Git-Supervisual-Cheatsheet An svg explaining git usage
  • rst2epub2 A Python (finally) tool for transforming rst to ebooks that will also work for ebooks destined for the Kindle
  • pycoverage.el An emacs plugin for highlighting coverage.py results

One fun little project that I have been working on with my sports-obsessed son is a football game. We found some stats for his favorite players, and using that data, combined with some statistics, we have made a pretty cool little text based football game that somewhat emulates what happens in reality. It is fun to show younger kids how math and programming can be applied to sports. (Maybe he will turn into a sports gambler).

 

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

Two libraries that I use almost daily are virtualenv and pip. To be able to sandbox apps easily with virtualenv, gives me peace of mind to quickly experiment and try new things. Pip enables easy installation and is a godsend. It makes development much less painful. Prior to pip (and its predecessor, easyinstall) setting up dependencies was a headache.

I have really appreciated SQLAlchemy over the years. Mike Bayer has done a wonderful job with the layered interface. I’ve used both the SQL abstraction and the ORM interface, and am very impressed by the featureset. I even wrote MonetDB support for it some years back, which was pretty straightforward.

The analytic workhorses of pandas, matplotlib, scikit-learn, and iPython Notebook are super handy. I’m a long time emacs user and I am really appreciating the emacs client to iPython Notebook. IPython Notebook is geared toward analysis, and I find that when I’m writing libraries I want a real editor for that. The emacs client makes it pretty painless to intermingle both development and analysis.

Matplotlib is another amazing engineering feat, but it is slightly non-Pythonic due to its interface being inspired from MATLAB. The Seaborn library, that sits on top of matplotlib, provides interfaces geared towards statistical plotting and is an improvement over both the matplotlib interface and the pandas plotting interface. Anyone needing good looking, sophisticated plotting should look into it.

 

What was your motivation for writing books about Python?

Short answer: bike-shedding. I felt a need to create the Python books that I wanted when I was learning Python.

Longer answer: I have always enjoyed teaching and helping others. I funded my education through tutoring. It is super rewarding when you see ideas click in others. That’s how I started to get involved with tutorials at PyCon and other conferences. I imagined: what class or course would I want to take? I created my hands-on courses based on that. In general, they have been really successful and well received. I’ve taught hundreds of students Python over the years.

My books have been an extension of that idea. When preparing for a tutorial for one conference in particular, I thought rather than just re-do my slides, I’ll write a book based on my course. I had the intention of finishing the book before the conference, but alas I was quite naive at the effort involved in writing a book.

Eventually I finished my first book, Treading on Python: Beginning Python. In the process, I learned quite a bit about ebooks (hence the projects on github for CSS for ebooks, and converting rst to ebooks), and eventually had an ebook and a physical book up for sale. I have tried to provide the product that I wanted when learning Python. The response has been good, and I’ve got a few other books started, and ideas up my sleeves.

 

Can you tell us what you have learned from being an author?

Anyone can be an author now. Traditional publishers are still looking for content, but with the advent of the Kindle, self-publishing is easier than ever. The only requirement is the determination to write the content. Being an author and an instructor is very similar to programming. If you have a logical progression, the output is easier to follow. I think being an author has helped me as a developer as well, because I tend to break problems into a progression of smaller steps.

Going the self-publishing route has also allowed me to delve into creating and selling a product. Doing sales is a new experience and requires you to put yourself out there. From that exposure comes both good and bad. It is awesome to get great feedback and reviews. But then you also get bad reviews, some of which are reasonable and some aren’t. It is not for everyone, but I like new challenges, and it has been a great learning experience.


Is there anything else you’d like to say?

With the media attention given to data science these days, there is a huge interest in Python from non-web developers and scientists. Python is one of the only tools that sees such breadth of action across a wide array of domains. It is a great time be a Python developer.

My biggest regret is that when I was first out in the Bay Area I didn’t participate in the local user group. It was a tiny group at the time. I tend to be an introverted person and didn’t see the importance of not only networking, but of sharing ideas and getting inspired by how others were using Python. That was pretty silly of me. If there was a single piece of advice that I would give to my younger self, it would be to break out of your comfort zone.

Thanks for reading, you can follow me on twitter at @__mharrison__. Or feel free to come and chat at PyCon!

Thanks!

The Last 10 PyDevs of the Week