Thursday 18 July 2013

Which Programming Language to learn?


              If our era was of 1800 or before, then this question wouldn't have a relevance. Unfortunately or fortunately, now we are living in a world designed by a numerious programming languages. Every beginner or geek or job seeker are stunned and trying to cope up the race where the man with deep knoweldge as well as the domain knowledge on the latest hot programming language trend, earns the race medal. So, which language we have to learn so as to qualify this race and earn a reputation. I won't give the answer for this as simple as you think. Infact, I'am no one to give the answer. It' all upto you to decide after reading this.
 
                  There is no point in narrating the whole history and evolution by saying " first it was called "code" then one of the major languages FORTRAN and COBOL came, after that...." .  There are no shortage of languages already and yet the individuals & I.T Giants are launching object oriented, scripting, functional languages and many more. It's obvious that a person cannot study all languages in a short time. But it's a difficult task rather than an impossible task. That means, a person can study any language he wants provided some conditions he should meet.

 For a beginner, i would like them to pick from the shopping cart consisting of Java, C++, C & SQL.

Studying C is for the basic beginners. They will be introduced with the concepts of programming languages and the first division in programming language -> Functional Level Coding. So to be thorough with that, you can got for C learning. But it won't be a demanding one nowadays but all it can do is that, it can make your rest of the journey smooth. Otherwise it's like aiming for Black Belt directly without learning to attain White Belt,Blue belt, Purple belt and Brown Belt.

By learning Java and C++, you can make up yourself prepared for any other Object Oriented Programming Languages. First you learn C++ and then Java. It's said that If you can learn the logic behind C++, then you will find an ease to grasp Java. And if you can learn logic in Java, then you can study any other Object oriented programming language very easily.

Database is a demanding area for now and ever. Data is the only thing which our world and we deals with. Success of a new technology and language solely depends on how efficient it is in dealing with data (storing as well as presenting or processing data). So, studying a Database Language is a must for all who wants to long live in techy background. Regarding Database Language, as all I will also suggest SQL. It's a nice language which can aid your journey to a Database world. It all deals with the logic on how to insert, delete, update the tables and the over all view of tables and it's characteristics.


For printing a fibonacci series, we can write several logics, using a while loop and by using recursion also.



1.Normal Method in C++


#include<iostream>
using namespace std;

main()
{
int n, c, first = 0, second = 1, next;

cout << "Enter the number of terms of Fibonacci series you want" << endl;
cin >> n;

cout << "First " << n << " terms of Fibonacci series are :- " << endl;

for ( c = 0 ; c < n ; c++ )
{
if ( c <= 1 )
next = c;
else
{
next = first + second;
first = second;
second = next;
}
cout << next << endl;
}
  return 0;
}


2. Recursive Method in C++


#include<iostream.h>
#include<conio.h>

rec_fibo(int);

void main()
{
clrscr();


int n,i;

cout<<"Enter the total elements in the series : ";
cin>>n;
cout<<"\nThe Fibonacci series is:\n";
for(i=0;i<n;i++)
{
cout<<rec_fibo(i)<<" ";
}

getch();
}

rec_fibo(int n)
{
if(n==0)
return 0;
else if(n==1)
return 1;
else
return rec_fibo(n-1)+rec_fibo(n-2);
}



         Both ways yield same output. But what matters is the logic behind which yields output as well as efficiency. Efficiency means efficiency in time of processing, using memory space etc. All it brings you on the other level of coding. To reach the 2nd way, you have to study the 1st way. It's a natural philosophy that, you can run only after learning to walk. Same applies here !!! .....


   

         
                   

              

No comments:

Post a Comment