"Hello, world!"

sidcraftscode

sid

Posted on December 17, 2021

"Hello, world!"

We've all been here before. When we start learning a language, the first thing we probably get taught to do is to output Hello, world! to the console. For some, "Hello, world!" can turn into a new opportunity, a new career, a new life..

But where did it originate?

The origins of hello world are unclear, but the phrase was first seen in Brian Kernigham’s book in 1972, A Tutorial Introduction to the Language B. After that, it was used in The C Programming Language in 1978, which is what really made the phrase popular.

What it looks like in different languages today

Here is what "Hello, world!" looks like in some of the most popular programming languages today:

Javascript

console.log("Hello, world!")
Enter fullscreen mode Exit fullscreen mode

Python

print("Hello, world!")
Enter fullscreen mode Exit fullscreen mode

Swift

print("Hello, world!")
Enter fullscreen mode Exit fullscreen mode

Ruby

puts "Hello, world!"
Enter fullscreen mode Exit fullscreen mode

Shell

echo 'Hello, world!'
Enter fullscreen mode Exit fullscreen mode

Java

class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
Enter fullscreen mode Exit fullscreen mode

PHP

echo "Hello World!";
Enter fullscreen mode Exit fullscreen mode

Go

package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
Enter fullscreen mode Exit fullscreen mode

C

#include <stdio.h>
int main() {
   printf("Hello, World!");
   return 0;
}
Enter fullscreen mode Exit fullscreen mode

C++

#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}
Enter fullscreen mode Exit fullscreen mode

C#

namespace HelloWorld
{
    class Hello {         
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Rust

fn main() {
    println!("Hello World!");
}
Enter fullscreen mode Exit fullscreen mode

Thanks for reading, and I hoped you enjoyed my post on "Hello, world!"

Check out my Website | Twitter | Github

💖 💪 🙅 🚩
sidcraftscode
sid

Posted on December 17, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

"Hello, world!"
programming "Hello, world!"

December 17, 2021