How a hello world program looks like in 5 programming languages

If you don’t know what a hello world program is, let me explain.

It is a very simple program that is meant to be the first program you write when you start learning a new programming language.

The program itself does nothing more than printing a “Hello World” text on the screen.

In this article, I am going to show you how a hello world program looks like in 5 very widely used programming languages.

1- Hello world in Python

Python is a programming language that dates back to the late 80s.

It’s a popular language because it’s very easy to learn.

Due to its readability and simplicity, python is usually the programming language of choice for freshman CS students.

Recently, Python’s even gained more popularity because of the booming fields of machine learning and data science.

Talking of simplicity, here is how a python hello world looks like:

print("Hello, World!")

Some of the popular open source projects written in python are scikit-learn and Django

2- Hello world in Java

Without a doubt, Java is a very widely used programming language.

Started by Sun Microsystems in 1991 before Sun was acquired by Oracle.

Here is how a hello world program looks like in java

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

Some of the open source Java projects that I like are elasticsearch and Hadoop

3- Hello world in C

C is one of the oldest programming languages dating back to the 70s.

It is still very widely used and is not going away any time soon.

Despite the fact that it’s relatively harder to learn,ย it gives developers full control over the system.

Here is how to write a hello world program in C

#include "stdio.h"

main()
{
    printf("Hello, World");
}

The most popular piece of code ever written in C, in my opinion, is the Linux operating system.

4- Hello world in Go

 

Go is a new programming language that was created by Google in 2009.

I am a little biased because this the language I use for my work on a daily basis ๐Ÿ™‚

It combines the control and power you have in C with the readability and simplicity of Python.

It definitely makes me happy to know that the language is rapidly growing day after day.

Here is the code for writing a hello world in Go.

package main
import "fmt"
func main() {
    fmt.Println("hello world")
}

Some of the popular open source projects written in Go are docker (now moby), kubernetes, and ethereum.

5- Hello world in C#

C# was created by Microsoft to rival Java, and in all honesty it lost the battle.

Not as widely used as the other languages in the list but still used in some companies.

If you end up working for Microsoft or you are developing software to run primarily on Windows, you will probably use C# on top of the .NET framework.

Here is how to write a hello world program in C#

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
        }
    }
}

 

That’s it folks. Have fun programming! ๐Ÿ˜‰

2017-12-09T07:47:17+00:00 By |

Leave A Comment