Ads Top

VB.NET vs. Java vs C#

Originally published at:

Author: Dan Mabbut

"Adrian" wrote in to ask:

"Some people tell me VB.NET is bound to disappear, and that C# or Java are better. What do you recommend?"

I haven't answered this question in a while, so here's my point of view.

Back in the days of VB6, there was much more of a case to be made about "VB" versus "C" but today, everything is different. Back then, a lot of what the computer could do was 'hidden' from the VB programmer to reduce the complexity of programming Windows enough to make it a practical reality. It's doubtful that Windows itself would have been successful without VB to reduce the cost of developing an application enough for business to afford it. But some programmers insisted that they needed to get 'next to the hardware' anyway for speed or the implementation of low level functions (like communications ports or individual monitor pixels). It's questionable how often this was REALLY a requirement but since managers tended to simply not understand the issue, programmers often got their way in spite of business realities.

But that was then and this is now.

Today, the issue of Java versus VB and C# versus VB are two different questions. They have seperate pro's and con's. Let's look at them individually.

Java versus VB

This is actually more a question of Java versus .NET, not VB. Java is a complex, but very powerful, programming environment controlled by Sun. In my opinion, Java has both less functionality and more complex requirements than .NET. keras. Some of the reason is due to the fact that .NET is simply a more recent development and Microsoft took advantage of more advanced understanding of what worked and what didn't. (Much of it learned because Java pioneered the way, but that's life in the big city.)

At the same time, Microsoft has recently pushed out the frontiers of programming with initiatives like WPF (Windows Presentation Foundation - the basis of Vista Aero graphics which gives you vector based and hardware accelerated graphics), WCF (Windows Communication Foundation - again, used in Vista, but destined for much greater things because it was designed with the Web at the core) and WF (Workflow Foundation - if this takes off, it will be incredible, but it's actually advanced beyond the needs of today's business).

Sun simply doesn't have the infrastructure to match this kind of "Apollo Project" scale of development. Some pretty amazing things are being done in Java, but they're being done by the customers, not by Sun. If you plan on inventing your own wheel, go with Java. If you want the resources of a mega-corporation behind you, go with .NET. There are pro's and con's of living inside the garden walls rather than being free and on your own. Choose wisely.

C# versus VB

This is a much more difficult choice. Today, VB.NET and C#.NET both compile to exactly the same intermediate language and use exactly the same Framework libraries. In most important respects, they are identical. As you note, the main difference is in syntax. C# syntax looks like this:

for (int i = 1; (i <= 10); i = (i + 2)) { // Do this } VB syntax looks like this: For i As Integer = 1 To 10 Step 2 'Do this Next Pick the one that seems easiest to code and understand. There are a few language differences today (more than there were when .NET was introduced, actually). But most of them favor VB. For example, the C# development team has chosen not to implement the "My" namespace in C#. (But you can use it anyway by simply importing the Microsoft.VisualBasic library into your C# project.) And adalah there are features in the VB.NET implementation of Microsoft's new LINQ, such as XML literals, that aren't in C#. ("Nullable Types" - a feature in C# that isn't in the current version of VB - will be in VB.NET 9.0.) So they aren't identical in functionality, but they're very close. The one clear advantage that C# has is that there are more books and articles written using C# as a basis. I simply don't understand this and it seems illogical to me. kerja But since I review a lot of books, I can't deny it. What I can say is that there are plenty of books and articles for both. I doubt that you will ever run out of reading material with either one. The bottom line is that both VB.NET and C#.NET are great development environments. Given a free choice, I would (and have) picked VB. But the decision factor in the 'real world' is likely to be the language that your employer chooses.

No comments:

Powered by Blogger.