You are reading this message because your browser does not support our CSS files. Please read our explanation of accessible Palgrave Macmillan websites.

Home | Search | Browse by Subject | Services | Subject areas | Companion websites

Studying programming

Home > Subject areas > Studying science and technology > Studying programming

In popular culture, there are many images of what the ‘Programmer’ looks like (the loner, the social recluse) but rarely are they characterised as someone who simply delights in challenging and creative activity.

Programming is fun. We think learning to program can also be an enjoyable experience, but starting with the right tools is a critical first step – or, at the very least, figuring out how the tools you do have work is critical. So before we write the next great computer game that will take the world by storm, we should figure out which end of the hammer we hold, and which end we hit things with.

  • Keeping it simple

We think the first few programs beginners encounter should be like roller-coasters: they’ll have unexpected twists and turns, but someone else should do the steering for you. In this way we keep the process of writing our first program as simple as possible. The simplest way we can think of is to copy your first program from a textbook. Just as we all learned to write by copying individual letters and words, copying your first program means there is less to think about, and fewer opportunities for mistakes.

  • Tools of the trade

Writing your first program requires a few critical tools. If you are learning to program as part of your course in your school, college or university, or other classroom setting, these tools are often provided for you. While we can’t predict exactly what kinds of tools you’ll be using for writing your programs, we can that they will probably include a text editor of some sort (for writing your programs) and a compiler (for turning your programs into a form that the computer can run).

  • Did I get it right?

Perhaps the toughest question when you start programming is knowing whether – after working through the compiler, syntax errors and other challenges – the program you wrote does what it is supposed to.

To know without doubt that you have written a program that will work without fail all the time is very difficult. For example you might try your program out with a number of different inputs, and see whether the output you get is what you would expect. However, even a simple program such as a miles to kilometres converter would be near impossible to test in this fashion: imagine trying to type in every possible distance and checking whether it converts correctly. Now consider trying to test a program such as a word processor (inputting all possible combinations of words!) or a complex game (trying out all different strategies). Clearly this ‘exhaustive’ testing of the program is impossible. However, there are techniques through which we can be reasonably certain that our programs work out well.

  • Writing your second program

Our first programs are typically copied from books, or perhaps examples that we modify in an attempt to understand how other people’s programs work. This is how everyone starts out – even people who have been programming for years but are now learning a new language. However, we all come to the point where it’s time to start thinking about writing some code of our own – our ‘second program’ so to speak.

Writing a program ‘from scratch’ is as creative a process as sitting down on a rocky coastline at sunset with a set of watercolours…The challenge itself lies in turning informal description of a problem in English into ideas that can be written in a programming language.

Getting started with writing our first program is probably best carried out as an exercise in copying programs from books or web pages where we know the programs are correct. Even if we get it right the first time, there are still the challenges of setting up and running the compiler on the programs we write. An IDE can simplify the process of writing programs by putting all the tools we need – text editor and compiler – all in one place. In the end getting started with our first programs is challenging, sometimes frustrating, but almost always rewarding in the end!

This content was taken from Chapter 5 of Studying Programming by Sally Fincher and the Computing Education Research Group

 

 





Palgrave Macmillan Ltd
bar