Home All Posts

Learning Python, Part 1

2018-10-21

It’s been a little while since I’ve started to learn a new programming language. Since I started down the path of studying how interpreters and compilers are developed, my interest in languages has grown quite a bit. So I decided that I would take the time to really learn a new language while I’m also working through SICP, and I decided that the language to learn would be Python.

This decision was come to from a practical standpoint more then anything else. Python is a language which has been around for a long time, has a ton of libraries and tools available for it, and is widely used in industry. Part of me wanted to not learn it and dive into something like Clojure or Haskell, however, since I’m already learning Scheme I decided to hold off on Clojure for the time being. Practically, there are more Python jobs than Clojure jobs, and there is a lot of literature on Python.

Python is also regarded as a relatively easy language to learn. It is dynamically typed and garbage collected, with an intuitive and easy syntax. It’s also easy to get running on your computer, and with VS Code there is a free good IDE for starting with development. Python is also widely used for mathematics and machine learning tasks, which I’d like to eventually play around with a bit. With a library like SymPy, it’s possible to do symbolic math which will help me work through a lot of the math I need a refresher on. In conjuction with something like Jupyter I can write up problems and easily have good looking math equations which I can reference in blog posts.

So far I’m not that long down the the path of learning Python. I’ve started reading the massive tome “Learning Python” by Mark Lutz, and I’m a few hundred pages in. This book is massive at around 1500 pages and covers Python in depth. I’ve probably got another 200 pages or so to work through before it even starts exploring statements and loops, and even further before it gets to functions. From there it goes into classes and object oriented programming, and covers modules and a lot of other topics in the Python spectrum. In all it looks to cover all things about the Python language itself.

Despite the length of this book I expect it will take much less time to work through than SICP. There’s nothing really hard about it, it just goes into a lot of detail which I think is a good thing. I probably could have picked up a shorter book or even just hacked away at some Python programs, but I prefer having something structured which will explain the nuances of the language.

My impression with Python so far is a good one. I have a few ideas for web scapers that I’m going to write as some programs to get started with. While Python has a large set of builtin types such as dictionaries and lists, I’m also going to take the time to implement a lot of core data structures and algorithms manually in Python as a learning project. I have a number of books on Algorithms that I’ve collected now, so once I get a good handle on the language I’ll spend some time with that.

All in all, Python is a language that is definitely worth learning. It’s support for cross-platform development is very strong which is a big benefit – it’s possible to do cross-platform GUI development which is something you don’t get with a lot of languages.