Which programming language should you start with?
It’s a very common question among students of varying background, from school goers to aspiring computer engineers. Where to start? Which language they should learn first? Which language is easiest and can be used for variety of applications? I will try to answer these questions in this blog with the help of some examples.
When compared with other programming languages Python is easiest. Python reads like English and is simple to understand for someone who's new to programming.
Now with the help of simple programs I am going to show why Python is easier than other programming language.
Suppose you want to print 'Namaste'. How it can be done in Java, C and Python:
'Namaste' in Java
class Namaste
{
public static void main(String [] args)
{
System.out.print("Namaste!");
}
}
Go to the location where you saved the file.
Compile the code with javac.
Then run the code with java.
Just to print a 'Namaste' you are required to write class, a main method, println statement; after that compile the code and then you will able to run it.
Namaste in C
#include<stdio.h>
Void main
{
printf(“Namaste!”)
}
Compile and run the program.
For a newcomer it is a bit complex to understand it.
Namaste in Python
print ("Namaste!")
Just write one line of code and run. No class, No main method, No curly braces. Obviously, this is much easier to understand even for someone not familiar with programming.
Next example is a program for sum of two numbers:
Comments
Post a Comment