Sometimes programming languages are like religions. Developers are so zealous about their language of choice that they turn a blind eye to other languages.
With .NET all language choices are now just cosmetic and that’s the most important point to understand. After all the CLR (Common Language Runtime/Managed Runtime) works on IL (Intermediate Language – Refrain from using MSIL as IL is standardized now) and all .NET enabled languages compile to IL. So no matter what .NET supported language you choose there is no difference in the capability in terms of functionality and (in the right hands) even performance.
To target the .NET platform and avail functionalities of the managed runtime we developers have quite a few options - in fact (at the time of writing) twenty two all together Microsoft Visual Studio.NET supports the popular four: C#, VB.NET, C++ & J# with other vendors coming up with their own implementations.
The language choices we as the developers make rely upon two factors more or less.
1. The developer's programming background.
For any developer his or her programming background is the most important factor in choosing a new language. Developers tend to progress to similar languages - or at least look-a-like languages - so as to benefit from their past investment and make their learning curves minimal.
So if you are coming from a C, C++ or Java background the modern OOP language C# will be the most obvious evolution, and for developers with a Visual Basic background or without any programming experience, VB.NET with all the new features will be an attractive option.
2. The market for a specific language.
It may sound a little off-track to many folks but the market for a particular language also plays a role in the daunting task of choosing a language for some developers.
Just to give you an example. I hail from <st1:country-region><st1:place>Pakistan; the majority of clients here preferred VB and most of their projects developed in VB. After .NET the trend has switched towards VB.NET. It comes without any surprise that VB.NET is popular among employers and developers alike in the market here. So to secure a job a developer might consider sacrificing his individual preference for the general trend in the local software development industry.
Interesting Myths and Concepts
Additionally let me explain the difference between the in style (popular) .NET languages and demystify some popular myths about them.
As mentioned earlier the only difference that remains among languages like C# and VB.NET are syntactical ones; they solely depend on the syntax and structs of the language. Remember each language has its own set of cosmetic pros and cons attached to it. C# may have better support for delegates while VB.NET has better support for event handling and the list just grows on, but I should rather cut short here as this is better meant for a later post or article.
Now hitting on some touchy issues, many developers believe that VB.NET is slower then C#. That’s not entirely true. The only place I see VB.NET slower than C# is where developers use old-style functions like Len and Mid instead of calling reciprocal methods available within the .NET Framework library classes and as mentioned by Heath Stewart (see post below) using old syntax like FunctionName = ReturnValue. On a positive note its interesting to note that the VB.NET runtime it self is coded in VB.NET.
Another myth is that C++ is superior then C#. It may well be but in relation to .NET the truth is exactly the opposite. For the managed runtime C#, is better off then C++ as it’s much neater and - remember folks it’s the only language built for the .NET platform, and the majority of the .NET Framework classes have been coded in C#. Almost all other languages have simply been enhanced to be ported to the .NET platform. I in no way intend to undermine C++. I think it’s one of the most powerful and flexible language. Just to share its importance the CLR is coded in C++.
Don’t Overlook Language Interaction
The CLR offers complete and easy language interaction which basically means you can code up a same solution using two different programming languages.
I think this ability to switch programming languages easily with rich interaction between languages is an awesome feature of the CLR. Unfortunately I also believe that developers will often look overlook this feature and will concentrate on their choice of programming language. On the whole programming language such as C# and Visual Basic are excellent languages for doing I/O operations. APL is a great language for doing advanced engineering or financial calculations. Through the CLR, developers can write the I/O portions of your application using C# and then write the engineering calculations part in APL. The CLR offers a level of integration between these languages that is unprecedented and really makes mixed-languages programming worthy of consideration for many development projects.
New Languages will Come and Go
All developers will agree on one thing for sure. Programming languages have a fixed shelf life. They come; they conquer and with time expire to be replaced by a (much) modern language. In my own little time I as the developer I have learned eight languages and most of them are obsolete now.
.NET may very well not change all that but its valuable in the sense that its language independent and soon will be platform independent too. I think developers will have less to learn in the future and will only have to adjust to new languages that will certainly keep on coming and hopefully keep on running on the .NET platform. No one can be sure about the future but it definitely is a bright possibility.
C#, a Matter of Choice
Finally after all this general talk, here are a few lines of applause for C#. Some of you may find it a little biased but please bear with my views.
In retrospect, C# is my language of choice for the .NET platform, What makes C# appealing to (a hardened C++ and VB programmer) like me is the negligible learning curve, modern OO concepts and built-in features for better coding. I can't stress this enough, C# is a master piece evolved from today’s most popular languages and has all the best features borrowed (as you might say) from VB, C++ and Java.
Another interesting point to note for which we have Heath Stewart (see post below) to thank is that C# is better for newbie’s because it opens the doors for more languages (C/C++, PERL, Java, and many more) and it's easier to read.
I hope this article sums up some of the raging ‘language wars’ witnessed among .NET developer community by large on various forums and email lists.
The moral of this little comparison is that no one language is perfect and each is meant to cope with different scenarios and developer tastes. What the .NET platform has done for us is that is has given us the right to choose.
Here are a few links worth checking out:
• .NET Language Listing: http://www.jasonbock.net/dotnetlanguages.html
• The Difference between VB.NET and C#: http://www.4guysfromrolla.com/webtech/012702-1.shtml
• Hitchhiker's guide to alternate .NET languages: http://builder.com.com/article.jhtml?id=u00220020630adm01.htm