The text "Hello World!" is highlighted with sparkle icons around it.

The Beauty of “Hello, World!”

Have you ever learned programming before? Then you might’ve heard about the concept of “Hello, World!”. It’s a small piece of code almost every programmers write when they try to learn a programming language, like below:

C
#include <stdio.h>

int main() {
    printf("Hello, World!\n");
    return 0;
}
Plaintext
Hello, World!

Just like “Hello, World!” section of a book, “The Rust Programming Language”, many books have a similar section almost at the very beginning. But why is it so special?

The table of contents of “The Rust Programming Language”

How it all started

Originally, the tradition of using “Hello World!” message itself hasn’t been a long time. Even in the beginning of the programmable computing era, there were just test programs, meaning it didn’t directly say “Hello World!”. But with the inspiration from a book called “The C Programming Language,” people started using the phrase.

What you can learn just by writing a “Hello, World!” program

Some people say that you can learn about a programming language just by writing that small piece of code. Is it really true? Let’s take a look at some example Java code.

Java
public class App {

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

This piece of code tells us lots of things about the Java language, including followings:

  • The language is class-based.
  • It has a main function.
  • The main function must be static.
  • The main function receives arguments as an array of String-typed values.
  • The method println is accessed through the out field of the System class.
  • And the list goes on…

Let’s take another example in Rust:

Rust
fn main() {
    println!("Hello, world!");
}
  • The language has a main function.
  • It uses a macro(!) to print messages.
  • You can declare functions without classes.
    • (In fact, Rust technically doesn’t have classes.)

That’s a lot of information from just a small piece of code, isn’t it?

The phrase became popular

Eventually, the “Hello, World!” phrase got so popular that many artists started using it in their work. “hello world” by Louie Zong is one of such examples:

Did you learn anything new about “Hello, World!”? I hope you enjoyed the post!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *