DEV Community

Prakriti Anand
Prakriti Anand

Posted on

"Hello, World!" in Different Programming Languages: From Easy to Hard

Programming is a fascinating journey and it all starts with printing "Hello, World!" on the screen. This simple program is the first step for many into the world of coding. Let's explore how to write this program in various programming languages, starting from the easiest to the more complex ones.

The Easy Ones

Ruby

Ruby is known for its simplicity and readability. Here's how you can print "Hello, World!" in Ruby:

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

Python

Python is another language famous for its simplicity. Here's the Python version:

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

JavaScript

JavaScript, the language of the web, also makes it easy:

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

Intermediate Languages

Swift

Swift, Apple's language for iOS development, has a straightforward syntax:

import Swift

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

PHP

PHP, a popular language for web development, requires a bit more code:

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

Kotlin

Kotlin, a statically typed language from JetBrains, is gaining popularity for Android development:

fun main(args : Array<String>) {
    println("Hello, World!")
}
Enter fullscreen mode Exit fullscreen mode

The Hard Ones

C

C is a powerful language that provides low-level access to memory and is widely used in system programming:

#include<stdio.h>

int main()
{
  printf("Hello World!");
}
Enter fullscreen mode Exit fullscreen mode

C++

C++, an extension of C with additional features like classes and objects, is used in game development and system software:

#include <iostream>

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

LISP

LISP (LISt Processing) is one of the oldest high-level programming languages and has a unique syntax:

(defun hello-world ()
  (format t "Hello World"))

(hello-world)
Enter fullscreen mode Exit fullscreen mode

Java

Java, a class-based object-oriented language, is widely used in enterprise environments:

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

C

C#, a language developed by Microsoft, is primarily used in Windows desktop applications and game development with Unity:

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

No matter which language you choose, writing your first "Hello, World!" program is an exciting milestone. Happy coding!

Top comments (4)

Collapse
 
michaeltharrington profile image
Michael Tharrington

Nice!! This is really cool seeing all these variations on the classic hello world. Fun post, Prakriti! 🙌

Collapse
 
anandprakriti profile image
Prakriti Anand

Thanks! 😀

Collapse
 
nlxdodge profile image
NLxDoDge

Rust is also very nice with this:

fn main() {
    println!("Hello, World!");
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
lexiebkm profile image
Alexander B.K.

@10, 25 say "Hello World"
The programming language from which I earned my money for the 1st time is the one that has this syntax.