Saturday, June 12, 2010

Hello World !

Hi Everyone! First and fare most, since you are reading the very first post of my blog; let me say “Welcome!” J.

hello world in programming

I am a developer. Nowadays, it seems bit odd to be in the IT industry and not to have a blog. Why is it so important to have a blog? May be the answer is we really need a place to put our ideas, perspectives or share our experience on a particular matter. Of course, for software developers, blogs really mean a lot of help because someone else from anywhere in the world might have the answer for the problem you are facing.

So, here I have started my blog and what should I start to write about? For a programmer, a starting point always means the “Hello World!”. Why shouldn't I start with that? J

What is a Hello World Program?

For the people who are not familiar with programming and programming languages, a "Hello world" program is a simple computer program that outputs the message (usually a text) "Hello world" on a display device.

The first ever Hello World program appeared in the first edition of Kernighan & Ritchie's original book about C, "The C Programming Language", in 1978.

In most cases, "Hello World" is the first program one usually writes when learning a new programming language. Usually in most of the modern programming languages it’s just a matter of calling a routine to display the text on the screen.

This can be the most simplest of the code to write, but can you write complex hello world programs? Perhaps when the developers get experienced and seasoned they might make the simple stuff more complex... LOL.

Hello World Samples

Now let’s get in to few simple Hello World programs for some popular languages. A collection of hello world programs for number of programming languages were compiled by Wolfram Rosler.

Below we have sample hello world examples for C, C#, C++, Java, PHP, Python and VisualBasic.Net. Please note that, to run this code and try this examples you need to know how to compile and execute each of these languages. No worries, you will be able to find that in internet without much effort.

C Hello World Program

/* Hello World in C */

#include <stdio.h>
#include <stdlib.h>

int main(void)
  puts("Hello World!");
  return EXIT_SUCCESS;

C# Hello World Program

//Hello World in C#
class HelloWorld
    static void Main()
        System.Console.WriteLine("Hello, World!");

C++ Hello World Program

// Hello World in C++ (pre-ISO)

#include <iostream.h>

    cout << "Hello World!" << endl;
    return 0;

Java Hello World Program

// Hello World in Java

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

PHP Hello World Program

  // Hello World in PHP
  echo 'Hello World!';

Python Hello World Program

# Hello World in Python
print "Hello World"

VisualBasic.Net Hello World Program

'Hello World in Visual Basic .NET (VB.NET)

Imports System.Console

Class HelloWorld

    Public Shared Sub Main()
        WriteLine("Hello, world!")
    End Sub

End Class

No comments:

Post a Comment

Had to enable word verification due to number of spam comments received. Sorry for the inconvenience caused.