Playing with Python - first impressions

Ok, well not quite first impressions. I’ve dabbled before but not for a particular reason and never actually built anything – but I’ve spent most of today getting stuck into Python.

I have a couple of reasons for wanting to learn another language properly, and I’m more interested in Python as a general scripting language than as a replacement for PHP as my web language of choice (Rails hasn’t really caught me yet, sorry). I could do some of this with PHP I know but that brings me to my second reason. I’ve been reading the Pragmatic Programmer recently and one of the things it has to say is:

“Learn at least one new \[programming\] language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut.” The Pragmatic Programmer

I like the idea of that. The rest of the book has a number of interesting things to say about programming in general, much of which is easily actionable.

A few of my regular reads sing occasionally about the joys of Python, which was probably another reason I’ve gone that way as well.

Anyway, first impressions is that Python is pretty easy to pick up. I keep wanting to put in braces and semi-colons but looking at the code it looks clean, simple and readable. Arrays, string functions and flow control appear to be present and correct. They work how you would expect which is what you want really for core functionality. Objects are next on my list of things to look at.

I’m building a simple log file analysis tool as I go. I’m fine with it being a command line app to be honest, but I might end up tinkering with some of the GUI features at a later date. One of the reasons for going for Python was it’s flexibility in this regard. Hopefully building something as I go will make it more likely that I’ll keep playing. I have a couple of other sample apps I’d like to make as well which is probably a good thing again to maintain interest.

Anyway, depending on how things go some more comments or code may emerge. Anyone else taking similar advice to learn new languages? If so which ones?