“Hello, world” Way too much information
The story behind the first program every coder writes, and Hello, World in sixteen languages from Python to x86 assembly.
We’ve all encountered it, especially if we’ve ever dabbled in programming. That simple, two-word phrase that represents a rite of passage for every coder: “Hello, World!” It’s a tradition, a starting point, and a beacon of initiation into the vast realm of computer programming. But why is it so universally recognised, and what’s the deeper symbolism behind these words? Let’s have a look at the history and finally some examples in modern and old programming languages.
A Historical Glimpse
The phrase “Hello, World!” in the context of computer programming was popularised by the book “The C Programming Language” by Brian Kernighan and Dennis Ritchie in 1978. This guidebook used the phrase as a demonstration for the basic syntax of the C language. Since then, “Hello, World!” has been adopted by countless programming languages, courses, and tutorials as the default initiation program. I personally encountered “Hello, world!” during my programming education many times of the years.
The Humanity of Hello
At its core, “Hello, World!” encapsulates the essence of human curiosity and our intrinsic need to communicate. The first word, “Hello,” is a greeting – an attempt to initiate dialogue, foster connections, and bridge gaps. Historically, when inventors have made significant breakthroughs in communication, the first messages they’ve sent are greetings. For instance, Samuel Morse’s first Morse code message was “What hath God wrought?”, and Alexander Graham Bell’s words over the telephone were, “Mr. Watson, come here, I want to see you.”
In this lineage, “Hello, World!” is the programmer’s greeting to the vast universe of digital possibilities. It’s a message sent out into the binary expanse, echoing our age-old need to understand and be understood.
The World’s Response
“World” in this phrase represents both the vast expanse of possibilities within the coding realm and our tangible world outside the computer screen. By saying “Hello, World!”, the programmer not only tests and validates the functionality of their code but also symbolically reaches out to the broader audience – their peers, mentors, and anyone who interacts with their creation. You could also look at it a different way. Perhaps we are allowing the computer to reach out and communicate with us in a very primitive way?
Conclusion
“Hello, World!” is more than just a beginner’s code; it’s a symbol of humanity’s enduring spirit of discovery and communication. As you embark on your coding journey or any new venture in life, remember the depth and weight behind this simple greeting. It’s a testament to our shared desire to connect, innovate, and transform the world around us, one ‘Hello’ at a time.
Below I have included several examples for many different languages. I will be completely honest, I have not tried them all, as curious as I am to try them all I just do not have the time. Don’t let me stop you though 🙂
Python
print("Hello, World!")Java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}C
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}C++
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}JavaScript
console.log("Hello, World!");Ruby
puts "Hello, World!"Go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}Rust
fn main() {
println!("Hello, World!");
}Fortran
PROGRAM HELLO
PRINT *, 'Hello, World!'
ENDCOBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. HelloWorld.
PROCEDURE DIVISION.
DISPLAY 'Hello, World!'.
STOP RUN.Pascal
program HelloWorld(output);
begin
writeln('Hello, World!');
end.BASIC
10 PRINT "Hello, World!"
20 ENDLisp
(print "Hello, World!")Ada
with Ada.Text_IO;
procedure Hello_World is
begin
Ada.Text_IO.Put_Line("Hello, World!");
end Hello_World;Prolog
main :- write('Hello, World!'), nl.Assembly (x86)
section .data
hello db 'Hello, World!',0
section .text
global _start
_start:
; write syscall
mov eax, 4
mov ebx, 1
mov ecx, hello
mov edx, 13
int 0x80
; exit syscall
mov eax, 1
xor ebx, ebx
int 0x80