Which programming language should I learn as a beginner?

computer programming

                                                                   

                                                                If you are someone trying to learn computer programming or a student pursuing computer science the first question that comes to your mind will be which language to start with or choose from the huge list of languages available on the market. I'm sure that you may have heard the myth that as a beginner you should always start with 'C' or you may have received similar advices  from other people saying that 'C' is the mother of all the languages out there and all of them are derived from it.


                                                              There is no rule that  a beginner should always start with C programming language. I'm not saying that C is a bad language or you shouldn't learn it but just clearing up the myth. In fact I learned C as my first language at school. You can start with any language but before that you should have an idea regarding what you need make with it. For instance, if you want to become an Android developer you should choose Java. Eventhough Java shares a lot of syntactical similarities with C you can directly start with Java without knowing any other language. But, if you are having prior programming experience that will certainly help you in grasping the concepts much faster. Once you are familiar with one language it is fairly easy to scale to others.

The following images are a perfect guides which deals about the various languages used in their specific domains: 





                                                                  If anyone asks me for a suggestion i,e the perfect language to start with I would definitely suggest 'Python' for tons of reasons.Given below are some of the 10 companies built with Python. Have a look!

         

     
Now let us come back to the reasons why I would suggest python for beginners.

1. Open source  
     
     
    First of all, Python is open source meaning free and has a huge community contributing to its growth in the form of various open source projects like frameworks which make the developers life more easier. It is developed under an OSI-approved open source license making it freely usable and distributable, even for commercial use. Python's license is administered by Python Software Foundation.
  
  
2. Applications in various fields

                    
        Python  is one of the language with a huge variety of applications  in various fields such as  web development, pen testing (Ethical Hacking), data science, Machine Learning etc. It has got a large number of frameworks which makes the work lot more easier like Django and Flask for web development, PyQt, tkinter for GUI, sklearn, pandas, Quandl used in Machine Learning as well as game development using the Pygame framework. Python also offers Kiwy framework for mobile application development.


3. Easy to learn      
  

      Eventhough Python has got such a huge field of applications it has got the easiest of the syntax than any other programming languages out there can claim. It is very easy for a newbie to digest thus making them more productive as it takes much less time to understand those concepts. This simplicity of the language is yet another factor which adds to its popularity.




    Let me prove my statement about the syntactical simplicity of Python by comparing it with another language, C++!


Lets compare the codes in both the languages for defining a function which returns the sum of 2 numbers:

 Python                                  


def add(a,b):
      return a+b

sum=add(12,18)

print(sum)



C++


#include<iostream>
  using namespace std;                                                   
 int add(int a,int b)                                                                                                                          {
       return a+b;
  }
int main()
{
  int sum;
sum=add(12,18);
cout<<sum;
return 0;
}
                                                                           
                                                                            

        

          As you can see the same thing can be achieved in much less lines of code   using Python.


           Now let us consider another sample code. The following code implements Object Oriented Programming(OOP) principles like inheritance and method overriding:

Python

class Animal:
         def makeSound(self):
               print("Make Sound!")
class Dog(Animal):
         def makeSound(self):
               print("Bow!") 
class Duck(Animal):
         def makeSound(self):
               print("Quack!")
class Cat(Animal):
         def makeSound(self):
               print("Meow!")
animal=Animal()
animal.makeSound()
dog=Dog()
dog.makeSound()
duck=Duck()
duck.makeSound()
cat=Cat()
cat.makeSound()



C++

#include<iostream>

using namespace std;
class Animal
{
   public:
   void makeSound()
         {
          cout<<"Make Sound!";  
        }
};
class Dog : public Animal
{
  public:
  void makeSound()
         {
          cout<<"Bow!";
         }
};

class Duck : public Animal
{
  public:
  void makeSound()
         {
           cout<<"Quack!";
         }
};
class Cat : public Animal
{
  public:
  void makeSound()
         {
           cout<<"Meow!";
         }
};
int main()
{
  Animal animal;
  animal.makeSound();
  Dog dog;
  dog.makeSound();
  Duck duck;
  duck.makeSound();
  Cat cat;
  cat.makeSound();
  return 0;
}



           As you might have noticed there is plenty of syntactical differences between Python and C++. In Python, the variables can be used directly without declaring which is not possible in the case of C++ where variables have to be explicitly declared along with their types so that the compiler can understand. Also, semicolons are not required in Python which is mandatory in the case of C++ signifying statement termination. We are not up to an in depth comparison between both the languages but just wanted to point out a few. All these points out to the fact that the same thing done in other languages can be achieved in much less lines of code using Python which makes it the perfect language to start with as it aims to increase the productivity of the programmer rather than just spending time to digest the syntax.


                                                          Once you have chosen a programming language it is very important to stick with it unless you are fluent with the syntax. Consistency is very important. When I started to learn coding I gave more importance to the languages than the concepts. I learned almost 12 languages and ended up regretting since I failed to gain confidence with what I learned so far. It was then that I understood the importance of building projects with what you have learned i,e learning and applying it to real life. There are many resources available online like codingbat.com, hackerrank.com, codefights.com, codechef.com etc. where you can practice your skills as well as compete with others. Also, learning those algorithms and data structures are very important too. All the best!

Comments

Popular posts from this blog

What exactly is computer programming?