26
"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..
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.
Here is what "Hello, world!" looks like in some of the most popular programming languages today:
console.log("Hello, world!")
print("Hello, world!")
print("Hello, world!")
puts "Hello, world!"
echo 'Hello, world!'
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
echo "Hello World!";
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
#include <iostream>
int main() {
std::cout << "Hello World!";
return 0;
}
C#
namespace HelloWorld
{
class Hello {
static void Main(string[] args)
{
System.Console.WriteLine("Hello World!");
}
}
}
fn main() {
println!("Hello World!");
}
Thanks for reading, and I hoped you enjoyed my post on "Hello, world!"
26