Similarities and Differences between C# and Other Languages
Introduction
You should know that many C/C++ developers have been asking this question:Is C# a new programming language or a new version of C/C++. My answer toboth questions is that none of these definitions is true. Well, in thisarticle I'm going to go under the hood and show you that C# is a cocktail ofJava, C, C++ and Delphi/C++ Builder from Borland. Let's first take a lookwhat C# programming language really is.
What is really C# and not?
First of all C# is a programming language. It has a power to developsoftware. It is a strong language for network and internet programming. C#has redefined the programming landscape. In addition, C# designed with theneed of C/C++ and Java programmers. Microsoft created it with AndersHejlsberg the former Turbo Pascal and Delphi luminary who was the mostprominent Borland staff also Jbuilder team worked together with him. Thisnew language has been developed specifically with the .NET framework inmind, and as such is designated to be the .NET developer's language ofchoice. One very important matter about C#, it is the first componentoriented programming language. The hot topic at the moment though is not itsrelation to C/C++ or Visual basic, but how it compares to Java and Delphi.Why Delphi? Because Anders has had a prime role during C# developing. C#inherits some of it's characteristics from C++ and also is an objectoriented language. C# has the functionality of Java, Delphi and Visual Basicand it a very strong language. You can not reject Delphi similarity becausetheoretically Borland was trying to do the same thing with Borland C++Builder working on Delphi. But C# has the most functionality of Java and C++and theoretical similarity with Delphi and Visual Basic to use this Java andC++ functionality in a RAD environment. You may remember properties termfrom both Delphi and Visual Basic. On the other hand, when I read "C#combines the high productivity of Microsoft Visual Basic? with the raw powerof C++" I quickly remember Borland's words for introduction to Borland C++Builder. What does all mean? C# is not a clone of Java. C# has morecompatibility, functionality and similarity than Java. Also, C# more similarto C++ as a programming language. C# stay much closer to C++.
Similarity and difference with C/C++
C# is directly related to C and C++. This is not just an idea, this is real.As you recall C is a root for C++ and C++ is a superset of C. C and C++shares several syntax, library and functionality. In addition structures,unions, arrays, strings and pointers are most important and similarfunctionality for both languages. C# inherits most of its operators,keywords, and statements directly from C++. Enums are clearly a meaningfulconcept in C++. Finally I can clearly say that C# is the firstcomponent-oriented language in the C/C++ family. C# constructors are verysimilar with C++ constructors. Like C++, methods are non-virtual by default,but can be marked as virtual. There is also some difference between C# andC++, C# supports multiple inheritance of interfaces, but not of classes.Another difference is destructors, their syntax is same with C++ butactually they are very different.
Most of the C# basic types have the same names as C++ basic types but theyare not really same. For example a char in C# is equivalent to a wchar_t inC++. If you decide to move from C++ to C# there are a few things to watchout to include the changes to new, structs, constructors, and destructors.Creating and using a component (DLL) in C# is fairly easier than in C++. Onemore thing, Borland's C++ Builder was a pure C++ with simple RAD environmentof Delphi and VB. C++ Builder was not a new language. This is one of thebiggest differences between C++ Builder and C#. The CLR (Common LanguageRuntime) improves runtime interactivity between program developmentsimplicity, security and portability. However CLR gives usability forcross-language integration. In addition to all those CLL has+ a perfectfoundation for a rich set of class libraries.
Conclusion
While there are a number of differences between C++ and C#, the syntax of C#is not very different from C++ and the transition to the new language ismore easy with RAD environment of .NET. Also .NET's cross languageinteroperability can give you the ability to use C++ and C# togetherFinally, if you want to use a strong programming language like C++ with thesimplicity of VB and Delphi, than you can use C# powered with CLR.












No comments yet... Be the first to leave a reply!