ICONLyes's Blog Programming (1) All categories (1) All tags (1) All authors (1)

Hello, World!

Date Created: 2019-08-16 00:00:00+00:00
Authors Lyes Saadi
Category Programming
Tags hello
Languages Language: en

Hello, World! As it's customary for developpers, this is a "Hello, World!" article. But, do you really know from where this piece of history come from? Since when it became a mandatory path for all beginners?

Hello, World!

The "Hello, World!" program is used these days as an introductory way in the beautiful world of development. Every beginner in a language write these sacred words. It is also used as a way to evaluate a complexity of a language.

These are some example of "Hello, World!" programs:

print("Hello, World!")
#include <iostream>

int main()
{
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++. >+. +++++++. . +++. >++.<<+++++++++++++++. >. +++. ------. --------. >+. >.
('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>
10111010 00010000
00000001 10110100
00001001 11001101
00100001 00110000
11100100 11001101
00010110 10111000
00000000 01001100
11001101 00100001
01001000 01100101  (he)
01101100 01101100  (ll)
01101111 00100000  (o )
01010111 01101111  (wo)
01110010 01101100  (rl)
01100100 00100001  (d!)
00100100           ($)

You can find other examples on Wikibooks1!

First use of "Hello, World!"

According to StackOverflow2, the first usage of "Hello, World!" was by Brian Kernighan for the Input/Output part of the BCPL Language manual. It was later used as an early testing for the C Language and one of the first program to test Bjarne Stroustrup's C++. But, it was popularized through the book « The C Programming Language »3 that was written by both Brian Kernighan and Dennis Ritchie, which was considered as a de facto standard for the C language.

1.1 Getting Started

The only way to learn a new programming language is by writing programs in it. The first program to write is the same for all languages:

Print the words

hello, world

This is a big hurdle; to leap over it you have to be able to create the program text somewhere, compile it successfully, load it,run it, and find out where your output went. With these mechanical details mastered, everything else is comparatively easy.

In C, the program to print ‘‘hello, world’’ is

#include <stdio.h>

main()
{
    printf("hello, world\n");
}

From Denni Ritchie's book: The C Programming Language4