Motivation: introduction to programming, using Python

Feb 26, 2014 • Martin Paulo

Introduction:

When I read the task, I saw it as, essentially, the creation of a short sales pitch. So I’ve created one targeting a group of people who are about start out on learning to program using the Python language.

The first thing I wanted to address in the pitch was the expectancy of the students. I wanted to get the people in the room to understand that software is actually quite simple, and is built on concepts that most people have mastered. I also wanted to try to slay the “Maths” bogey.

Having set their expectancy, I then wanted to try and give them some form of value in achieving the goal of being able to program. Which I did by putting an example into the sales pitch.

The Pitch:

*Before we start the course proper, I’d like to take a few minutes to talk about what software actually is.</p> You can imagine a running computer program to be a machine: a machine created from the code that you write.

I say ‘write’. That tells you that a running computer programs is created by interpreting words. Words that you write down to make up the design of that program.

And the computer is so dumb that it can only understand a very small subset of the words that us human beings do.

Python, the programming language you are about to learn, has less than 40 words. Under 40! That’s a very small language…

And what’s the best way to learn a language?

Practice, feedback. Then some more practice and feedback. Rinse, lather, and repeat.

It sounds pretty much like learning to play a musical instrument, doesn’t it?

And that’s actually quite a good comparison, because both music and software are underpinned by another common language that frightens a lot of people, and that’s maths.

But the maths you need to master in order to program with Python is pretty basic. Less than, greater than, equals. That kind of stuff. Its mostly the maths that you need to know in order to shop effectively. And I’m betting that you all have mastered that level of maths a long time ago.

So you already know the maths. All you have to do is to learn the words, practice the language, get feedback, and you’ll be programming in no time. But, be warned: like a musical instrument, or learning a new language, you have to put the effort in to see the reward.

Why would you want to put in the effort?

Well, writing. That’s creative. If you enjoy creating or designing things, you’ll enjoy programming.

And remember, you’re creating machines. Machines automate things. Your own personal machines do your bidding, and to save you time and effort. It’s a wonderful skill to have: to be able design and build your own labour saving machines.

For example, I often want to add events to my Google calendar. But that means that I have to bring up my web browser, navigate to Google calendar, and then enter the details. So I wrote myself a small tool, and I now I can just type:</em>
<br /> my_cal “Blood donation, 4th of May”<br />

*and the event gets added to my Google calendar.</p> That tool is less than 50 lines long. And it’s saving me time and effort just about every day. When my wife saw it she liked it so much she demanded that I install a copy on her computer!

You too can have this power.

Because software is simply machines of the mind, created from words.</em>