If you’re migrating to .NET but are uncertain about whether to go with VB.NET or C#, go with C#—it will be the lingua franca of .NET. Now, before you flame me, I realize that the Common Language Runtime (CLR) translates languages into the Intermediate Language, so you can use whatever language you prefer to crank out applications. You can even use different languages on the same project.
So why should you go with C#? For several reasons:
- C# is more like Java. If you already have Java programmers on your team, they should be able to pick up C# relatively easily.
- C# syntax is fairly easy to digest. Even if you’re not familiar with Java, C# syntax is very straightforward, and it’s cleaner. You can also rely on exception handling as part of the .NET Framework. The nefarious On Error Goto command still lingers in VB.NET, even though you can also take advantage of .NET exceptions in VB.NET.
- One of the best advantages of C# is the power to support XML documentation. The XML documentation works a lot like Javadoc—you actually maintain your docs while you maintain your code. The VS.NET IDE has a bunch of tools built in for generating HTML documentation from your XML comments, so it's easier to use than Javadoc.
Events are a basic concept in programming. In our continuing series on C# fundamentals, we'll walk you through the process of creating events using Visual Studio .NET. Read "Working with events in C#."
Again, one of the tenets of .NET is that the language doesn’t necessarily matter: It boils down to your syntax preference. In my opinion, C# is more powerful and offers cleaner syntax. If you want more reasons to choose C# over VB.NET, check out the Builder.com article "How I learned to stop worrying and love C#." If you want to get a grasp of the basics, read "The role of the .NET CLR in creating a global development framework."
King for a day, or maybe longer
Will C# become the dominant force in .NET development? Post a comment below, or flame the editors.