Adjust contrast

Masterclass: The Nuts and Bolts of Programming

What do computer programs consist of?

To write programs for a computer, we use a language specifically designed for the purpose. Most computer languages involve the programmer in writing a number of instructions (known as statements) in that language to instruct the computer to perform the required task. In this talk, we are going to look at programming language statements in some detail. We are going to cover different statements used in programs. Most languages have some version of each of the statements we are going to cover. When we encounter each new statement, we will first look at it in general terms, describing typically what it looks like and what it is used to do. We will then go into one or more examples of using the statement within the context of an overall program. For the examples, we are going to use the Python language, as this is relatively easy to understand for people new to programming.

What can you expect to get from this session?

No one can learn a programming language in one session. What is intended here is to provide an understanding of the nuts and bolts of computer languages, the typical statements that are available, albeit in slightly different forms, in most languages. We will start by looking at small snippets of Python code to illustrate the statements we are discussing. By the end of the session, we will have looked at a couple of complete programs, and have examined enough Python statements for you to be able to construct your own basic programs.

It is important to understand that this session only scratches the surface of what it is possible to do in Python. A lot of the power in Python comes from libraries of pre-written code you can simply import into your program and use to perform complex tasks in very few lines of code. Before you can do this competently, you need to have the knowledge covered in this session. Looking in detail at what can be done using the libraries available in Python could be the subject of a future session. Specialised libraries exist for sophisticated maths and statistics, data analysis, Scientific applications, sophisticated data visualisation as well as interacting with the web, spreadsheets and databases.

The recording of the session is available on the following AudioBoom link and also as an mp3 download file.

https://audioboom.com/posts/8797918-masterclass-nuts-and-bolts-of-programming

 
Nuts and Bolts of Programming

Here are the files referred to in the Masterclass

All programs
Listing 1 Simpple input and output
Listing 2 variables
Listing 3 variables of different types
Listing 4 print verses printf
Listing 5 arrays with output
Listing 6 lists with output
Listing 7 If elif else
Listing 8 Equals and white space in Python
Listing 9 Triangle checker
Listing 10 triangle checker with file input and output
Listing 11 modules and functions
Listing 12 the TRY statement with simple user interaction
Tutorial Document