Chapter 5
The Obligatory Hello World Program

It is a staple of the ‘learning to code’ movement to first write a program that prints the greeting ‘hello world’ to the screen, and who am I to fly in the face of this custom?

Setup to Follow Along

If you have been following along so far your VM will already be in the correct state for this lesson, but to be certain issue the following command.

1cd ~ 
2exercise 01.01

Before any code is written someone must have specified what the code should do (the ‘requirements’). This has been done for you in these coding exercises.

Requirements

All programs start with requirements. These are often informal when writing code for private use but the larger the group involved in writing the program the more formally we need to specify our requirements.

Throughout this book we will use an approach generally called Test Driven Development (TDD)1. Although many examples used in this book are trivial compared to real-world development (and the use of formal requirements is overkill) this more disciplined approach is worth developing early in your career as adjusting to it later is more difficult (trust me, I took the hard route because the idea of TDD was developed long after I learned to program.)

We will take a more detailed look at requirements in Chapter 10.

1A development methodology in which tests are written before the implementation code.