Introduction to Programming

These notes are intended as an introduction to programming in JavaScript for those with little or no previous programming experience.

The programming language we will use is JavaScript. It is not a bad language to start learning, although it does have a few peculiarities. The main problems you will encounter are not to do with the language itself but with the way in which it is implemented in a web browser. Against this, it has the big advantage that it does not have to be purchased, downloaded or installed, it is already there in everyone's web browser.

When you make a mistake in your program (which you will do!) the diagnostic information you get will not necessarily tell you just what you have done wrong and where. In the worst case, all you will know is that something has gone wrong somewhere in your program.

To minimise these problems you should do two things:

We will focus on writing programs which do numerical calculations. In fact JavaScript is not primarily intended for such calculations. Most JavaScript is used to `enhance' web pages, e.g. to produce these annoying pop-up windows with ads in them.

Finally, we will assume that you are using a computer with a Windows operating system. If you do have a chance to use a Unix or Linux system you should do so since these are environments intended to help people to write programs, which is what you are about to start doing, rather than run other peoples' programs, which is what Windows is best for.

Before starting to write programs there are some things you should do in Windows to make sure you can create files to put programs in. Read the notes here.

Outline


Go back to my home page.