Written By: Varun

All Are Equal before Programming

image cannot be displayed

Overview

Hello There , are you a beginner at programming ? If the Answer is YES , then this Article is for You. If the Answer is NO , then this is definately for you. If you are a Programmer , then you should feel like all programming languages are the same. Programming languages and Classified as :

  • Functional
  • Logical
  • Object Oriented

They may be classified into Different types , but all are Same. I will try to make you feel the same. All the Programming Languages have the same basic features :

Input and Output

  • Python :
    • Input : raw_input() [Older Versions ] , input() [Latest Versions]
    • Output : print()
  • Java :
    • Input : Scanner Class , BufferedReader are some of the ways to get input in Java
    • Output : System.out.println(),System.out.print()
  • C :
    • Input : scanf(“%d”,&i)
    • Output : printf(“%d”,i)
  • C++ :
    • Input : cin»
    • Output : cout«

Variables and Data Types:

In Python , there is no need for you to specify the Data Type for the Variables and return type for the Function. In C Based ( C , C++, Java, C#, Objective C, Go) Languages you should specify the Data Type for the Variables. In Some Languages like Swift , There is a Concept called as Type Inferencing which makes the Specification of Data type while declaring the Variable Optional , i.e, You can specify the Data type , or the Language can Infer the Data type automatically. Apart from that Every programming allows you to store Data in Variables and manipulate them.

Functions :

Every programming Language has this Solid Feature called as Functions / Methods / Procedures. The Syntax may be different , but all the Functions just carry some instructions of code, which can be called any number of Times. If You are Using an Object Oriented Language you may call them Methods , but what you do is you keep the so called functions in your Classes and you feel like You have written a Method ( Some Low Voice Pathetic Background Music Playing). Just kidding. Functions makes your Code easy to Debug and Test. There are a Lot of Advantages of these functions. We will make another post on that.

Loops :

Loops are used for executing the same piece of code again and again , for a large number of times.

Loops are used for executing the same piece of code again and again , for a large number of times.

Loops are used for executing the same piece of code again and again , for a large number of times.

Loops are used for executing the same piece of code again and again , for a large number of times.

Without typing the Above Lines i could have written them like this :


for i in range(4):
	print("The Above Text")

Done. See how simple is that. If you consider other programming languages: Java , C , C++ :


for (i=1;i<10;i++){
    a=a+5; 
} 
// I thought of writing some more lines of code , but i didn’t because i am lazy and you are too.

Python :


for i in range(1,10,1):
    print(i)

Swift :


for i in 1...9{
    print(i)
}

Conditional Statements :

Python :


youlikethispost = True

if(youlikethispost):
	print("share it")

else:
	print("share it")

C Based Languages :


if(2<3){
	//2 is ofcourse less than 3.
}

else{
	// If you are looking at else , then you don’t know that 2 is less than 3
}

Comments :

C Based Languages :


// Single Line Comment

/* 
Multi Line
Comment
*/ 

Python :

# this is a Single Line Comment

# this
# is 
# a
# multi
# line
# comment

"""
this 
is 
also 
a 
multi-line comment

"""

Operators :

All the programming languages have Mathematical Operators like +,-,*,/,% and Comparison Operators like <,<=,>,>=,==,!= and Logical Operators like && and || , etc. But Some languages give you more. Python gives you Exponentiation Operator ** and Integer Division Operator //.

Goals

Language may Support Object Oriented Concepts or they may not. But what you can do with one can be done by others. C Language which don’t have support with OOP’s concepts is used as the core base for construction of various operating systems and softwares that we use today. Languages May differ by execution speed, whether they are compiled or interpreted , but IF you Learn one programming language perfectly , then you can conquer all of them pretty easily, only the Syntax changes. If you know English , you can learn Spanish by communicating in English(idk whether that makes any sense or not). The Same Way Learn One Programming Language and other languages have the same concepts with minor modifications. I have just provided an overview of all the languages. I have shown you in this post that all the programming languages have Loops , Conditionals , Functions , Operators , Input / Output and even Comments,“EVEN COMMENTS?” , what ? Comments are feeling left out now and its all because of you, So please comment your code make comments proud again.

Now If You Agree with me that all are the same. I urge you to check my next Post : “ Tutorial on Swift” . Swift allows you to create your own Application for iPhone , or Softwares for Mac. Swift is a Very Clean and Good programming Language.

UNTIL THEN, System.out.print(“PEACE ;)");