DEV Community

Cover image for Breaking the Language Barrier: A Journey through 'Hello, World!' in 20 Different Programming Languages
Rajaniraiyn R
Rajaniraiyn R

Posted on

Breaking the Language Barrier: A Journey through 'Hello, World!' in 20 Different Programming Languages

Are you bored of writing “Hello, World!” in the same programming language over and over again?😴 Do you want to spice up your coding skills and learn new languages in a fun and easy way?🌶️ Well, you’re in luck because today we are going to explore how to write “Hello, World!” in 20 different programming languages.🌎

Me trying to learn 20 programming languages in one day

As developers, we know that learning the basics is the key to mastering any new programming language. “Hello, World!” is a simple program that is often used as the first step for learning a new language. It’s a way to test that your development environment is set up correctly and that you understand the basic syntax and structure of the language.

But what exactly is “Hello, World!” and why is it so popular?

The History of Hello, World!

The origin of “Hello, World!” can be traced back to the 1970s when it was used in a tutorial for the C programming language by Brian Kernighan and Dennis Ritchie. They wrote:

The only way to learn a new programming language is by writing programs in it. The first program to write is the same for all languages: Print the words hello, world This is the basic hurdle; to leap over it you have to be able to create the program text somewhere, compile it successfully, load it, run it, and find out where your output went. With these mechanical details mastered, everything else is comparatively easy.

Since then, it has become a tradition in the programming community to write a “Hello, World!” program in any new language you learn. It’s a simple way to get started and familiarize yourself with the basics of the language.

So, let’s get started and see how to write “Hello, World!” in various programming languages.

Python

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

Python is a powerful and versatile programming language that lets you create amazing things with just a few lines of code. Whether you want to build a website, analyze data, or create an AI system, Python has you covered. Python’s syntax is simple and elegant, making it easy to read and write.

JavaScript

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

JavaScript is a fun and flexible programming language that powers the web. You can use JavaScript to create dynamic and interactive websites, games, mobile apps, and more.

Java

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

Java is a robust and reliable programming language that runs on almost any platform. You can use Java to create large-scale applications, mobile apps, web apps, and more.

C++

#include <iostream>
using namespace std;

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

C++ is a powerful and versatile programming language that gives you direct control over hardware and memory. You can use C++ to create fast and efficient applications, such as operating systems, video games, and more. C++ is also open-source, which means you can customize and extend its features.

C

using System;

class HelloWorld {
    static void Main() {
        Console.WriteLine("Hello, World!");
    }
}
Enter fullscreen mode Exit fullscreen mode

C# is a sleek and elegant programming language that is designed for building Windows applications, web applications, and games. You can use C# to create rich and interactive user interfaces, powerful and scalable back-end systems, and immersive and fun games.

Swift

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

Swift is a fast and expressive programming language that is designed for building iOS, macOS, watchOS, and tvOS applications. You can use Swift to create beautiful and intuitive user interfaces, efficient and secure back-end systems, and innovative and engaging apps.

Ruby

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

Ruby is a fun and friendly programming language that is used for web development, automation, and scripting. You can use Ruby to create dynamic and interactive websites, automate tasks and processes, and write scripts and tools.

PHP

<?php
    echo "Hello, World!";
?>
Enter fullscreen mode Exit fullscreen mode

PHP is a popular and versatile programming language that is used for web development, server-side scripting, and building dynamic web pages. You can use PHP to create websites, web applications, content management systems, and more.

Go

package main

import "fmt"

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

Go is a fast and simple programming language that is used for building networked and distributed systems. You can use Go to create web servers, microservices, cloud applications, and more.

Kotlin

fun main() {
    println("Hello, World!")
}
Enter fullscreen mode Exit fullscreen mode

Kotlin is a sleek and elegant programming language that is fully compatible with Java. You can use Kotlin to develop android apps, web applications, and server-side development.

R

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

R is a versatile and expressive programming language that is used for data analysis and statistical computing. You can use R to manipulate, visualize, and model data, perform statistical tests, and create interactive applications.

Perl

print "Hello, World!\n";
Enter fullscreen mode Exit fullscreen mode

Perl is a flexible and versatile programming language that is used for system administration, web development, and network programming. You can use Perl to automate tasks, manipulate data, and create dynamic web pages.

Shell

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

Shell is a powerful and convenient command-line interpreter that is used for executing scripts and commands in Unix and Unix-like operating systems. You can use Shell to manage files and directories, run programs, and automate tasks.

Lua

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

Lua is a fast and easy programming language that is used for game development, embedded systems, and scripting. You can use Lua to create games, control hardware devices, and write scripts and extensions.

Rust

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

Rust is a reliable and efficient programming language that is used for developing system-level software and web applications. You can use Rust to create fast and secure applications, such as operating systems, browsers, and servers.

Dart

void main() {
  print("Hello, World!");
}
Enter fullscreen mode Exit fullscreen mode

Dart is a versatile and expressive programming language that is used for developing mobile apps, web applications, and server-side development. You can use Dart to create beautiful and responsive user interfaces, powerful and scalable back-end systems, and cross-platform applications.

Scala

object HelloWorld extends App {
  println("Hello, World!")
}
Enter fullscreen mode Exit fullscreen mode

Scala is a elegant and powerful programming language that is used for developing web applications, big data applications, and machine learning. You can use Scala to create expressive and concise code, leverage the benefits of functional programming, and interoperate with Java libraries.

TypeScript

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

TypeScript is a robust and expressive programming language that is a superset of JavaScript. You can use TypeScript to develop large-scale applications and to add static typing to JavaScript projects.

Groovy

println "Hello, World!"
Enter fullscreen mode Exit fullscreen mode

Groovy is a fun and flexible programming language that is a dynamic language that runs on the Java Virtual Machine (JVM). You can use Groovy to develop web applications, automation, and scripting.

Elixir

IO.puts "Hello, World!"
Enter fullscreen mode Exit fullscreen mode

Elixir is a modern, open-source programming language that is widely used for developing scalable, distributed systems. It's known for its fault-tolerance and concurrency features.

Wrapping Up

Wow, we did it! We’ve greeted the world in 20 different programming languages, each with their own flavor and charm.👏 From the long-winded and bossy Java to the sleek and sassy Python, there’s a language for every mood and occasion.😎

Hello, World! I am coding Master

But let’s face it, no matter how many languages we master, “Hello, World!” will always be our first love.❤️ It’s the program that popped our coding cherry🍒, the spark that ignited our passion for programming.🔥

So whether you’re a coding ninja🥷 or a coding newbie👶, take a moment to appreciate the elegance and joy of “Hello, World!” and all that it stands for.🙌 And who knows, maybe one day you’ll invent your own awesome version of this legendary program.🚀

Until then, keep coding, keep learning, and keep saying “Hello, World!” to new adventures in programming!👋


If you liked this post, please share it with your friends and fellow developers. And don’t forget to follow us for more programming tutorials and examples! 😊

Top comments (1)

Collapse
 
karthidreamer profile image
Karthi Keyan

The way you concluded it was so cool 😎