Writing a Hello World Program as a First Step in Learning a New Language

The author
Stephen Castle4 years ago

Have you ever wanted to use a new programming language but been overwhelmed by the huge amount of information to learn? You're not alone. That's why one of the first things many programmers who are new to a language do is write a hello world program. A hello world program means creating the simplest possible program you can write to print the words Hello World on the screen! It might not seem like much, but the objective is just to make sure everything is working and get your program running for the first time. From there you can start building more and more behavior into your program.

Try some of the examples below. Click the Try Running it here link for each example to try running the code in your brower, for some of the examples you will have to copy and paste the code into the window. Sure it doesn't do much now, but this is just the very first step in beginning your programming journey.

Python

print("Hello World")

Try Running it here! Repl.it Python

Ruby

puts "Hello World!"

Try Running it here! Repl.it Ruby

Go

package main
import "fmt"
func main() {
 fmt.Printf("Hello World\n")
}

Try Running it here! Repl.it Go

Javascript

console.log("Hello World");

Try Running it here! Repl.it Javascript

Rust

fn main() {
    println!("Hello World!");
}

Try Running it here! Repl.it Rust

Swift

print("Hello, world!")

Try Running it here! Repl.it Swift

Now that you've tried some sample hello world programs, think of something you want to learn and try searching for a hello world example of it on your favorite search engine! That's usually a great first step when beginning any programming learning journey.