Contrasting C# and VB.NET

If you ever program in the Microsoft ASP.NET framework, you have to choose whether to program in VB.NET or C#. Recently I’ve had to work on a project where the client wanted a website in VB.NET because that is what their programmers knew how to maintain. Needless to say my experience with VB.NET has been painful, yet my experience with C# went just fine.
What was the difference? The community, answers and examples I found were all using C# . I couldn’t find the proper VB.NET code or answer any time I looked. I ended up going line by line translating VB.NET to C# to figure out how to make it work. Jeff Atwood summed up my feelings with this excerpt from his article, C# and the Compilation Tax :
Most of the community has settled on C# as the de-facto standard, so you’re in for a rough slog of code translation if you want to stick with VB and cleanly integrate commonly available source code libraries into your codebase. And if you want to understand the code you’re absorbing into your application (note: this isn’t really optional in my experience), you better learn how to read it without a bunch of mental translation gymnastics. And once you’ve learned how to read and write the language well enough to integrate it, you’ve come full circle. Like me, you’ll be left wondering why you didn’t just cut out the translation penalty entirely and stick with one language in the first place.
He points out exactly my frustration with VB.NET. The bulk of the community has settled on C# and if you want to do anything complex in VB.NET be prepared to translate C# code over to VB . So the moral of the story is stick with what people use the most – C#.
2 comments
I’ve used C# quite a bit now, and it’s
alright. I really don’t like feeling dependent on .NET, but I guess that’s where a lot of things are going.It’s not that hard to find Visual Basic samples, prefix the term “visual basic” to any queries in google.
It should be easier to switch to VB though. Once you get over the lack of curly braces, the non-case sensitivity and implicit conversions make for some laid back lazy programming.