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

anandprakriti

Prakriti Anand

Posted on September 25, 2023

"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!

đź’– đź’Ş đź™… đźš©
anandprakriti
Prakriti Anand

Posted on September 25, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related