The reason I created this tutorial originally is that two friends wanted to learn how to program and asked for my help. I was amazed to discover that while there were many programming web sites and tutorials on the web there was virtually nothing that taught programming to complete beginners. So I wrote one. That situation has changed and there are now many sites for beginners along with a plethora of online videos and even several books of both the eBook and dead-tree varieties. I provide links to some of them at the bottom of this page and in the References topic at the end of the tutorial. However, my approach is still unique and, as such, may appeal to some learners more than the other sites, so here it stays.
The idea of learning to program is still, I believe, a good one for most computer users, even if they do not ever write any significant programs themselves. Understanding how programmers think can help make applications more logical and user friendly. Also many applications allow customisation by writing little programs known as macros. And of course there is the web with the opportunity to publish your own web site and sooner or later you will want to add some dynamic features to your web pages, and that means programming. Finally the Internet and the Web encourage a general interest in computers and that interest naturally leads to a desire to "take control", which means learning to program!
Why me? Well I am a semi-retired professional programmer with 40 years experience who came to programming from an electronic engineering background. I have used (and continue to use) several computer languages and don't have any personal interest in promoting any particular tool or language.
As much as I can. I will cover the basic theory of computer programming - what it is, some of its history and the basic techniques needed to solve problems. I will not be teaching esoteric techniques or the details of any particular programming language, in fact I'll be using several different languages, since I believe it's important to realize that different languages do different things well. That said, the majority of the course will be in the language called Python.
Put another way: what do I expect the reader to know already?
I expect the reader of this tutorial to be an experienced user of a computer system, probably running Windows, MacOS or Linux although others should be able to cope too. I also expect them to understand some very basic mathematical concepts such as how to calculate areas of simple shapes, geometric coordinates, sets, and basic algebra. Nothing that should worry a second year high school student, say. These are all important concepts in today's programming environments, and many programming concepts are based on these ideas. However, the depth of knowledge needed is very low and if you do find the math getting too hard, you can usually just skip over a few paragraphs, try the code as it is and hopefully the penny will drop even if the math still confuses you.
One thing you should know is how to run commands from your operating system's command prompt. In Windows this is variously known as a DOS box, the MS DOS Window or MS-DOS Prompt, or nowadays, the CMD Box. Basically it's a black window with a white text prompt that usually says C:\WINDOWS> and you can start it by going to the Start->Run dialog and typing CMD into the entry box and hitting OK. If you use Linux then you should know all about terminal windows and on MacOS you can run the Terminal program under Mac OS X (which is found in the Applications->Utilities folder). There are lots of powerful shortcuts that can save you typing time if you care to read the help files for your Operating System prompt. I won't cover those here. One tutorial for Windows users can be found here. And a basic Unix shell primer can be found here.
I will not be covering issues like how to create or copy text files, how to install software, or the organization of files on a computer storage system. Frankly if you need to know those things you probably are not at the stage of being ready to program, regardless of your desire to do so. Find a tutorial for your computer first, then when you're confident with the above concepts revisit this site. Remember that Windows and MacOS both have comprehensive help systems built in. Linux has a huge amount of tutorial material on the web, Google is your friend...
Python happens to be a nice language to learn. Its syntax is simple and it has some very powerful features built into the language. It supports lots of programming styles from the very simple through to state of the art Object Oriented and Functional techniques. It runs on lots of platforms - Unix/Linux, MS Windows, Macintosh etc. It also has a very friendly and helpful user community. All of these are important features for a beginner's language.
Python however is not just a beginner's language. As your experience grows you can keep on using Python either as an end in itself or as a rapid prototyping language. There are a few things that Python is not well suited to, but these are comparatively few and far between.
Python currently comes in two major versions (2.7 and 3.x). This tutorial is specifically aimed at 3.6 although 90% plus should work on more or less any Python version since 3.2. Most of it will work in v2.7 too with minor tweaks, mainly to the naming of modules and with the addition of this line at the top of your program file or interactive session:
from __future__ import print_function, division
I will also use VBScript and JavaScript as alternatives. The reason for this is to show that the same basic techniques apply regardless of the language details. Once you can program in one language you can easily pick up a new one in a few days. Why those languages? Well, for a start they have very different styles to Python so form a useful contrast, and more prosaically if we accept that most Web surfers who are also beginners are using PCs with Microsoft Windows installed, there is a programming environment built in to the operating system called Windows Scripting Host which has support for VBScript and JScript (which is Microsoft's variant of JavaScript). In addition, anyone using Microsoft's web browser can also use these languages within their browser and, in fact, JavaScript should work in almost any browser on any Operating System. Initially we'll only look at how to run VBScript and JavaScript inside a browser, but I will be introducing WSH in some of the later topics as an optional extra.
There are other Web sites trying to do this in other languages (and in the time since I originally created this site a few other Python sites have appeared). There are also lots of tutorials for those who already know how to program but want to learn a new language. This section contains links to some of those that I think are interesting!