I spoke at the local .NET User Group a couple of weeks ago and saw some strangers in the audience. I asked them to introduce themselves and they said they were there recruiting for a consulting company that was doing some work for Microsoft. I asked them to highlight the qualifications and to my surprise, they said they only needed C# developers. Being a Visual Basic.NET bigot, I did not take this very well so I asked “So, why not use Visual Basic.NET developers?”
“They aren’t suitable,” the leader of this consulting group said.
I resisted the temptation to jump over the podium and … well, I didn’t. That’s because you’ve heard of a number of companies that have made a similar choice—I suspect to their detriment. What they might not know is that Visual Basic.NET is one of the most popular languages in the world—and for lots of reasons. No, this assertion is not drawn on my regular straw poll, but Forrester Research. They also tell you:
- Visual Basic is the #1 .NET language.
- C++ Express is #2 (20% behind Visual Basic).
- C# comes in at a distant fourth.
- Visual Basic has the most trafficked MSDN language dev center and blog.
- The Visual Basic team blog is in the top 1% in readership of all Microsoft bloggers.
I think part of the problem is perception, ignorance, or simply personal preference that has little to do with the technical merits of one language over another. I think the choice of language has a lot to do with what language the developer already knows. Just as a resident of west Texas is more likely to learn Español than Chinese, a Java or C developer will find C# easier to learn. Sure, I expect some portion of the Visual Basic.NET developer community tends to be ex-VB6, VBA, or Visual Basic-script developers; however, many more simply find that Visual Basic.NET is their language of choice—even if the choice was thrust upon them. Yes, there are development houses that still think that productivity is important. That is, some have found that Visual Basic.NET is weeks faster than C#—the same project takes less time to build, test, and deploy in Visual Basic. Of course, if the shop is populated with C developers as they transition to .NET, no one is surprised to see them adopt C# or Managed C++.
Visual Basic.NET—a First-Class .NET CLR Language
Consider that Visual Basic.NET is a deadly serious, start-from-scratch .NET CLR language. It compiles to the same IL generated by C# with a few rare exceptions. Sure, there are some code approaches that Visual Basic 2005 could not duplicate, but this is no longer the case for Visual Basic 2008. In contrast, there are a number of features supported only in Visual Basic.NET.
So, what’s the problem? Well, all too often you find examples written in C#—just C#. You find books that include only C# examples—and I’m not talking about the “C# for Dummies” series. I guess I’m just as guilty—all of my book’s examples are in Visual Basic.NET. I barely mention C# in the Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition) (Addison Wesley). My last C# book was ADO.NET Examples and Best Practices for C# Programmers (APress)—and Peter Blackburn did the translating…
Rumor vs. Reality
So, why don’t developers or decision-makers choose Visual Basic.NET when it comes to building new code? You see a litany of excuses—some of which make sense, but others have little foundation in reality.
Visual Basic.NET is slower than C#
Although Visual Basic.NET can compile to the same intermediate language (IL), to get the same performance you have to turn off some of the “safety” features such as integer divide overflow checks that are added automatically to Visual Basic.NET code—and that are not enabled in C#. In reality, I’ve found that Visual Basic development is actually faster. Studies show that projects written with Visual Basic.NET can be designed, prototyped, and debugged more quickly than in C#—even without “edit and continue.”
There are features in C# that are not supported in Visual Basic.NET
Yes, there are some relatively obscure operators that are required by C# that are not supported by Visual Basic.NET. I have yet to hear from a developer that this issue had any impact on development or implementation. In reality, there are a number of features such as Dim WithEvents, My functionality and many others that are only available in Visual Basic.NET. These features make coding easier and less trouble-prone.
C# developers are smarter or more experienced
Remember, I’m a data guy and yes, I get the same number of “challenged” data access questions from experienced C# developers as I do from experienced Visual Basic.NET developers. In reality, Visual Basic’s ease of use has indeed lowered the bar to developers so far more men and women can write code and build applications without formal computer science training—but these inexperienced “paradevelopers” do not necessarily reflect the population as a whole. A lot of very complex and well-written code was written in VB6 despite its shortcomings and at least as much serious code is being written in Visual Basic.NET by developers with degrees in CS and some without.
Those making executive decisions about a language and the developers who use it need to think twice before discounting Visual Basic.NET. The just might be overlooking a valuable resource.
About the Author
William (Bill) Vaughn is an industry-recognized author, mentor, and subject-matter expert on Visual Studio, SQL Server, Reporting Services, and data access interfaces. He’s worked in the computer industry for over thirty-five years—working with mainframe, minicomputer, and personal computer systems as a developer, manager, architect, trainer, marketer, support specialist, writer, and publisher. In 2000, after 14 years at Microsoft, Bill stepped away to work on his books, mentoring, and independent training seminars. He’s written seven editions of the Hitchhiker’s Guide to Visual Basic and SQL Server, and three editions of ADO.NET and ADO Examples and Best Practices for Visual Basic (and C#) Programmers. He and Peter Blackburn also wrote the critically acclaimed Hitchhiker’s Guide to SQL Server 2000 Reporting Services.
Bill is a top-rated speaker and frequents conferences all over the world, including TechEd, Visual Studio/SQL Connections, DevTeach, and many others. He’s also written a wealth of articles for magazines such as MSDN, SQL Server Magazine, Visual Basic Programmer’s Journal, .NET Magazine, and many others as well as a regular editorial for Processor magazine. Bill spends considerable time answering questions on the public newsgroups and speaking at INETA user group meetings all over the country and at other speaking venues all over the world. He’s available for consulting, mentoring, or custom training. See www.betav.com or www.betav.com/blog/billva for his current schedule and course catalog.