Sunday, 15 March 2009

Musings on learning Python

I realised that I hadn't posted for a while and I also hadn't mentioned how I was doing learning Python, so I thought I'd best write a new post.

Well, I've been using Python Programming for the Absolute Beginner, 2nd Edition, and I've skimmed through it once to familiarise myself with the syntax and am now working through it a second time, but this time I'm making sure I pass all the exercises before I move on. I did have a significant setback during this time because I had to spend two and a half months working on Network Technology Foundations, the final module for my CIW Associate course (got 19 out of 21 on the test though! Just waiting to hear from my tutor about doing the final exam, though), but I finished that in mid-February. So, in the period from mid-October to start of December, and then again from mid-February onwards, I've been spending a little time every day learning Python. Now I can devote a bit more time to it, I think I'm making a fair amount of progress.

And how do I find it? Well, I already have reasonable knowledge of HTML/XHTML, and did a little bit of programming in BASIC on my Amstrad CPC when I was a kid, and I'm already reasonably familiar with the bash shell (though I haven't really done any shell scripting), so I wasn't a complete novice. From my experience, and from attempting a few other languages (Perl and Java, mainly), I've found that Python is the first language that I really feel I can make progress with. I've already surpassed my meagre BASIC knowledge, and I feel it's doing me good because unlike with BASIC, Python encourages good programming practices such as indentation, which will no doubt do me good when I choose to learn another language.

I've heard in the past that Python just seems to "fit your brain" better than other languages, and my experience bears this out. I can already follow the flow of pretty much any Python program pretty well, and I was really pleased the other day when I found a listing in a magazine for a game written in Python and I understood every line perfectly. I still haven't gotten very far with learning object-oriented programming, but that will come with time.

I've also tinkered with C a tiny bit, and learning Python has meant that I find it easier to understand what's going on in C, which is great. One of the things that drew me to Python was the fact that it was relatively easy, but at the same time was a full-featured, modern programming language, not some kid's teaching language, so I could learn the basic concepts behind programming using Python, such as object-oriented programming, then apply the principles I'd learned to more demanding languages, as I've always heard that once you know a few languages it's easy to learn another. I've already found that if I look at a program in pretty much any language now it's possible to get some idea of what's going on.

As a very welcome side-effect, my skills with Vim have increased tremendously, and combined with the fact that I can now touch-type, when you compare how long it took me to enter a BASIC program as a kid to how long it now takes me to enter a Python program of roughly equal length, there's no comparison. The downside of this is that at work when typing letters (I work in a customer services role), I keep reaching for j to move down, the Vim key bindings are burned so far into my brain!

I'm going to continue learning more Python, but I'm getting a little bored with my current Python book so I will finish this read through and move on to something else. I have Apress's Beginning Game Development with Python and Pygame, The Definitive Guide to Django and Practical Django Projects, as well as O'Reilly's Learning Python and Programming Python, so that means I've got plenty to learn about Python. I find reading several different tutorials about a subject gives you a more balanced view of it, and there's also plenty of tutorials online about Python so there's loads of scope to learn more.

I have some idea of the path I'd like to take with learning to program after I'm reasonably skilled with Python. I'm interested in learning to program the iPhone and iPod Touch, and now I have a MacBook that's a possibility that's open to me (note that this is pretty much for fun, I'm not one of these people who thinks they're going to write an iPhone app that everyone will buy, after all a year or so ago everyone was thinking the same about Facebook apps and now most people are pretty bored of them), so I've got Apress's Learn C on the Mac, Learn Objective-C on the Mac and Beginning iPhone Development. I wanted to learn C at some point anyway, partly because it's useful to learn it for other languages, and partly because it's pretty much required for any kind of serious Linux or Unix programming, so if I learn that (or, at least enough to get by), then learn Objective-C, then that'll stand me in good stead for learning how to use Cocoa and Cocoa Touch.

I also plan to learn Java and/or C# at some point since both languages are in demand, and I may do this after I finish my current course as the people I'm studying with offer courses in both of these.

OK, that's quite a lot on my plate, I know, but hey, ambition counts for a lot!

No comments: