Introduction: Where the First Program Begins and Why

Hello world from black box

Almost always, the first example program in any programming language starts with displaying the message “Hello, World!”

Why exactly this? The processor that executes the program is like the human brain. No matter what thoughts are in your head, no matter what sentences you articulate internally—until these thoughts are converted into something tangible, audible, or visible to others—they remain inaccessible to everyone else.

We can transform our thoughts into something perceivable by others:

  • Through speech—by producing an audio message.

  • Through body language:

A program is like a black box, from whose output we can receive messages and use them to understand how the algorithm execution is progressing.

Therefore, when creating a program for a new platform—be it a computer, laptop, Arduino board, or anything else—the first thing to figure out is how to send a signal “outward.”

The ideal option is to output a message as text. This requires either a display (computer or for embedded systems) or, for example, a serial port where a message can be sent and read at the other end using a special adapter connected to a computer and running a terminal program.

However, sometimes a display or serial port is unavailable. Or they exist, but the program freezes before correctly configuring them and thus cannot display information (to the screen or serial port) about what is happening.

What is done in such cases? One can blink an LED or beep with a simple speaker (a so-called buzzer).

For example, when UEFI or BIOS (the basic input/output system that starts when power is applied to your computer) is loading and the display is not yet initialized to show messages, a series of beeps from the speaker can signal various problems detected during the boot stage.

Vocabulary