![]() |
C/C++ ummm!!! Which one to choose? |
From two continious years I am dealing and experiencing the computer language field.and till now what I got is that C++ is one of the best programming language ever known.from two years i am doing C++ programming and believe me it never fails to teach me something more profitable and more logical.
yes! it is true that C++ is built in C only,then,Why should we learn C++?why not C? the perfect answer to this question would be the better stl algorithms,easy wrtting structure,better support for functional programming style and many more.Both C and C++ are known to be the 'ultrafast' language out there,where as some other scripting languages like python are somewhat slower than these two.
According to me we should learn C++ because
- Good support for generic programming
- very fast execution in C++,apps developed in C++ are really very fast.
- Direct interfacing with C and O/S.
- Collection of good and useful libraries
- New developed algorithms(eg:STL algorithms) which are not present there in C.
- Many great companies like google,microsoft, accept C++ as a very powerful programming languages.
- C++ is always preferred choice of programmers in the game programming field.
To say about C++ over C,let us understand it through a simple example:
e.g:
If you have to sort an array containing a set of n integers,what you will do in C will be
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int array[]={set of numbers}
int sort(const void *x const void *y)
{ return (*(int*)x-*(int*)y); }
void main()
{
int i;
qsort(array,n,sizeof(int),sort);
for(i=0;i<array.size;i++)
{ printf("%d",array[i]);}
getch();
}
While doing this in c++ you just have to do
#include<iostream>
#include<conio.h>
#include<algorithm>
using namespace std;
int main()
{ int array[]={set of numbers}
sort(array,array+array.size)
getch();
return 0;
}
here we can see that in C++ the same sorting is done in a very quick and easy process,just by adding a new header "algorithm" thus we don't have to give the whole algorithm as we did in C instead we just use the sort developed in the C++ stl algorithm.and the C++ code also is much easy to understand and execute that the C code.
Like this many different algo's and functions have been defined in C++,which are not there in C.which one can use and can save time,memory..But! it never means that we don't have to learn or understand the basic algorithm for sorting or any other,it is just for quicker access and ease.
Apart from algorithms C++ have a vast scope in the IT sector.many great aaps which we are familiar with have been developed using C++ and their libraries.Some of them are:
Some of the Google applications are written using C++,includig Google file system and Google chromium
Internet browser Firefox and email client Thunderbird are written in C++ programming language and they are also open source projects.
Winamp is the ultimate media player, allows you to manage audio and video files, rip and burn CDs, enjoy free music, access and share your music and videos remotely, and sync your music to your iPod All this have been done using C++.
MySQL is the world’s most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout its history.
Few parts of apple OS X are written in C++ programming language. Also few application for iPod are written in C++.
where so much is there in C++,there must be some loop holes also in this.It means that at some places C++ also fails to tackle with some graet problems,some dissadvantages of C++ are:
- Persistence.
- Not a pure object oriented programming language.
- C++ codes are easily prone to errors,type-checking is not good.
- Its very hard to buitl a GUI using C++.
- And many more are their also.
known till now in our sector.
good post brother.
ReplyDeletea balanced post, you weren't either entirely pro nor completely con...
ReplyDeleteThings change my friend.seeing both pros and cons is the optimal way.
ReplyDeleteHey Aquid, I can't find you on facebook, is there any way we can communicate? Your old friend, Oudi.
ReplyDeleteOUDI..my facebook profile is aquid raza rahman and just send me email @(aquid.shahwar@gmail.com) and i will give you my no'.Missing you all yaar!..
ReplyDelete