Hello, World! Across 7 Languages
Hello, World! Across 7 Languages
Welcome, explorers of code! 🌍 No programming journey is complete without the humble “Hello, World!”—the program equivalent of saying “Hi, I’m here!” in a new language. Today, let’s go global and check out “Hello, World!” across seven different programming languages. Here’s to the thrill of our first print statement!
C
Ah, C! The backbone of many systems. Here’s how C says “Hello, World!”
1
2
3
4
5
6
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
C#
C# makes it look easy with a few lines, using its .NET framework.
1
2
3
4
5
6
7
using System;
class Program {
static void Main() {
Console.WriteLine("Hello, World!");
}
}
Ruby
Ruby keeps it simple and sweet. This line is as minimal as it gets!
1
puts "Hello, World!"
Go
Go is strong and opinionated, yet concise. Here’s “Hello, World!” in Go:
1
2
3
4
5
6
7
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
Node.js
JavaScript running on a server? Absolutely! Here’s how you do it with Node.js:
1
console.log("Hello, World!");
Python
Python’s syntax is famously beginner-friendly. Here’s its take:
1
print("Hello, World!")
Rust
Rust is both powerful and safe. It keeps you on your toes but welcomes you warmly:
1
2
3
fn main() {
println!("Hello, World!");
}
And there you have it! Seven languages, seven greetings, one universal message: “Hello, World!” Whatever language you choose, each first program reminds us of the wonder and creativity in programming. So, which one is your favorite “Hello, World!”?
Happy coding! 😃