Sunday, July 12, 2009

How can you differentiate C, C++, Visual C++, C#, Visual C# ?

Actually I want to know what is the basic difference between them. What are their application areas? Can each one of them substitute each other? What about the syntax? Is there anything common in these languages? Who has built these languages. What is needed to run these languages on our computer? What IDE or complier is needed?





I would prefer direct answers only who know about these languages. Please dont provide links to other pages.





Thanks in advance.

How can you differentiate C, C++, Visual C++, C#, Visual C# ?
Lets start from the begining :)





In 1971 two computer engineers Kerringhan and Ritchie developed a language which could be portable to different machine, their objective was to develop a high level language which gives them power of a low level language and still have sufficiently human comprehensible code. The result was a language they named as C. The nomenclature came from an earlier language which was called BCPL or in short just B, so they termed thier langauge as C.





C became tremendously successful as it was powerful, easy to understand and easy to program with, giving a lot of flexibility to the programmer. It was termed as 'The Programmers´Language´ and one of the first sucess of C was UNIX which was written using C.





In late 70s when the computer programs were getting bigger and more complex, a new concept was introduced which was that of Object Oriented Programing (OOP). Richard Stroustrup started building the foundations of an Object Oriented version of C. His first results were a highly modified (in syntax and type checking etc) version of C and he named his new version C++, basing his name on the ++ operator used by C which increments the value by 1.





There were many IDE for both languages, most famous at the time were from Borland, named as Turbo C and Turbo C++.





Later, with the advent of Windows based Operating System and introduction of Microsoft Foundation Classes, Microsoft introduces its own versions of IDE for C and C++. Microsoft named them ´Visual C´and ´Visual C++´. Note that these two are not separate languages, but just new IDEs, though there were certain syntax restrictions put in by Microsoft, which makes them a little different from thier ANSI counterparts.





C# is another adventure of Microsoft which uses the CLR and .NET framework. This is a new language which appears to me more of a newer version of JAVA rather then C (both languages use a similar syntax and program architecture) as it incorporates more feature of a ´secure´JAVA then the loose barrelled C.


IDE for C# is called Visual C# carrying on the nomenclature of ´Visual´for Microsoft.





Hope this helps.


Just as a footnote, C is my personal favourite programing language.
Reply:C is a subset of C++. C cannot do classes, operator overloading or templates whereas C++ can. C# is quite different, although it looks similar. It is a managed language, and a lot of behind the scenes stuff is taking place.





C is the fastest of these 3, but more limited in terms of features. C++ is slightly slower, but for the most part the performance difference is negligible. C# will execute slower than both in most cases, but again this difference is negligible. Being a managed language, C# has a lot of features to ease developer productivity, it is the ideal language for quickly creating applications that can perform moderately well.





All three of these languages could be used for the same things, although many will pick C or C++ for computationally intensive tasks. The syntax for all three is also very similar, except that C does not support classes, and C# typically does not work with pointers (although it can).
Reply:An interesting question. Realistically, a programming language is just an interface so a human can produce programmes to run on a computer as the computer can only interpret '0's and '1's. Very early computers could only be programmed in '0's and '1's because there were no programming languages back then! Over the years, different languages were created by various people who had different needs. Some of the languages were popular enough to stick around, and all the most popular ones can be run with the .net environment. All of the languages have different strengths and weaknesses depending on what type of program you need to create. Some of these languages (such as C and C++) are designed for creating code that runs very fast for creating operating systems and controlling hardware. Others are very good at handling text and database applications (such as BASIC) but not at all suitable for operating systems or control applications as they would run too slow to control any hardware devices.


As for the differences in syntax, that is a very diverse question, suffice to say that after a while in dealing with various languages, you get to know the syntax so that at first glance you can tell what language is what. This is similar to when you see a foreign language written, or hear a foreign language spoken...after a while you just get to know it and understand what it is. The more interest you take, the more detail you learn.


Hope this helps, regards Dave.

anemone

No comments:

Post a Comment