What is a Hello World program?

Making a program say “Hello World” is one of the first skills that pro­gram­mers learn. The objective behind a simple Hello World program is simple. A plain Hello World code il­lus­trates the syntax and the pro­gram­ming language’s func­tion­al­i­ty in the simplest way.

What is a Hello World program used for?

The text “Hello, World!” was one of the first codes written by pro­gram­mers. This cryptic phrase has actually achieved cult status since the US series “Mr. Robot” was released. However, it’s been a cultural asset in the pro­gram­ming community for some time. But what is the meaning behind it and why is it a rite of passage for those who learn pro­gram­ming?

A Hello World program is just a simple code which outputs the text “Hello World”. Creating a Hello World program is an easy in­tro­duc­tion to pro­gram­ming, and you can see the result im­me­di­ate­ly. Beginners can quickly get a sense of how easy or complex internet pro­gram­ming languages can be. If you are con­sid­er­ing learning Python, you will im­me­di­ate­ly see how concise the Hello World code is:

print ("Hello, World!")

The simple text looks much more com­pli­cat­ed in Java:

class Hello {
    public static void main( String[] args ) {
        System.out.println("Hello, World!");
    }
}
javascript

Beginners can see how the syntax differs between pro­gram­ming languages and how so­phis­ti­cat­ed pro­gram­ming paradigms are when it comes to complex pro­gram­ming.

What is the function of a Hello World program?

A Hello World program doesn’t offer a deep insight into a pro­gram­ming language, nor does it teach you any functions that go beyond the famous greeting to the world. Nev­er­the­less, “Hello, World!” is one of the unspoken rituals which even ex­pe­ri­enced pro­gram­mers follow when learning a new language. When it comes to children’s pro­gram­ming, a Hello World program allows kids to learn how to use code editors and a variety of in­ter­est­ing code languages in a fun and in­ter­est­ing way.

Whether you consider it a cult, a tradition, or a simple teaching tool, one thing is certain about Hello World, it’s fun to create a small program in a short amount of time that does exactly what you ask it to do. Pro­gram­mer Erin Spiceland described the fas­ci­na­tion of pro­gram­ming as “telling rocks what to think”. Nothing compares to the magic of creating a readable, working program with a few pieces of code like a simple “Hello, World!”.

Where does the name come from?

Many people who are pro­gram­ming “Hello, World!” for the first time will wonder who came up with the idea in the first place? The origin of the tradition dates back to 1972 and 1974. Brian Kernighan is a Canadian computer scientist and co-developer of the B and C pro­gram­ming languages and wrote the internal manuals for B and C. His aim was show how in­di­vid­ual words could be arranged in a mean­ing­ful way using the B and C code languages. The in­spi­ra­tion for the famous greeting is said to have come from a cartoon Kernighan had seen on tele­vi­sion.

The “break­through” of the familiar word came with the famous Bell Lab­o­ra­to­ries textbook “The C Pro­gram­ming Language”, which Kernighan wrote with the American computer scientist Dennis Ritchie. This was the first book published on the C pro­gram­ming language. It quickly achieved fame and is now con­sid­ered a standard work. The text was written as “hello, world” in Kernighan’s internal in­struc­tions and in “The C Pro­gram­ming Language”. It sub­se­quent­ly became known as “Hello, World!” or “Hello World” in the pro­gram­ming community.

What are some examples for Hello World in different pro­gram­ming languages?

It is difficult to say how many pro­gram­ming languages there are in the world today. Estimates range from 700 to over 1,000 markup languages. The simple pro­gram­ming task “Hello World!” can be used to get a quick and clear overview of each syntax.

The following examples of Hello World programs il­lus­trate the com­plex­i­ty or even con­cise­ness and ef­fi­cien­cy of different pro­gram­ming languages:

B:

main() {
    printf("Hello, World!");
}

C:

#include <stdio.h>
int main() {
    puts("Hello, World!");
    return 0;
}

C++:

#include <iostream>
int main()
{
    std::cout << "Hello, World!" << std::endl;
}

D:

import std.stdio;
void main() {
    writeln("Hello, world!");
}

JavaScript (in the browser):

document.write("Hello, World!");
javascript

PEARL:

MODULES (HELLOWORLD);
     SYSTEM;
          TERMINAL:DIS<->SDVLS(2);
     PROBLEM;
          SPC TERMINAL DATION OUT ALPHIC DIM(,) TFU MAX FORWARD CONTROL (ALL);
     MAIN:TASK;
         OPEN TERMINAL;
         PUT 'Hello, World!' TO TERMINAL;
         CLOSE TERMINAL;
    END;
MODEND;

PHP:

<!--?php
    print "Hello, World!";
?>
php

QBasic:

<!--?php
    print "Hello, World!";
?>

SQL:

SELECT 'Hello, World! AS message;

Unix shell:

echo 'Hello, World!'
Go to Main Menu