VB.NET vs C#? Is there even an argument?

First, let me start off saying where my loyalty lies, I'm a C# guy.

I've recently been doing a great deal of work in VB.NET and I wanted to share with you what my thoughts are.

C# and VB.NET are identical in form and function. They can both be used to build the same identical systems with exactly the same code. There's no real difference - the beauty of the .NET Framework.

So what's this post about? Well it's about how I feel when writing code in the two different languages. What I write here is not about what's right and what's wrong, it's just opinion (personal opinion at that!).

To me, VB.NET feels like a very solid stable language, with well defined boundaries. Bold colours - you get what you see.

C# seems to be much more subtle, it feels less solid, the boundaries are there, but they're much softer, it's much harder to tell what you have in front of you with C#.

 

I don't get the same sense of completion with VB.NET as I do with C#, when I write code in VB.NET I know the code will do the job, but it just doesn't feel finished.

I wondered, is this because I just have not used the language enough which got me back to thinking about when I first started to learn .NET.

Way back in before .NET was released I was using VBScript and decided to try out the new .NET stuff, using the language I already knew - VB.NET (I mean it even had the same name!). I tried for about a month in my spare time to learn VB.NET, but I just could not get my head around it - all of a sudden I had all of these Object things to deal with and all the nasty casting going on - I really missed varients. I gave up on .NET and went back to VBScript - I knew it and knew it well.

A couple of months later I decided to give .NET a shot, but this time, I opted to give C# a go, see if I could lose the familiarity I had with the VB languages and teach myself .NET instead. This time round I found .NET much easier, the code samples were there, mostly in C#, the community was there, everyone was using C#, it just seemed easier for me to get my head around, all of a sudden these Object things gained a life of their own, I was able to write Classes and use design practices to ensure they were clean and tidy. I got .NET, and have never turned back to VBScript since that day.

So does the fact I learnt .NET with C# taint my feelings with the topic of VB.NET? I'm pretty sure it does. Is this a bad thing? Well for me at the moment, yes it is, I'm working with VB.NET quite heavily and I don't feel confidant in my code, a feeling I never really have with C#.

VB.NET is solid - I feel it does the job, but it just feels more chunky, rugged, designed for the world where it will be haphazardly put together. VB.NET to me is like Duplo (which for those who don't know is Lego for Toddlers - larger bricks, easier to use).

 

 

C# feels much more precise, it's smaller, easier to manipulate into a finer much more intricate design, it feels like it's better than VB.NET (which as I've already stated - it isn't they're equal in EVERY way).

 

So there you have it, VB.NET & C# side by Side do the same job, in the same way - they can both achieve wonderful things with morealess the same amount of code, okay, one language might have features the other doesn't, but essentially, they're pretty much identical.

The only real difference is the perception of developers who use either language. How someone overcomes this difference is beyond me, I'm looking to find a solution to the problem and to banish my VB.NET demons - I need to feel confidant that the vB.NET I write is a solid and as stable as my C# code - maybe I need to see a psychiatrist.

Published Sunday, May 07, 2006 9:45 PM by Plip

Comments

# re: VB.NET vs C#? Is there even an argument?

Sunday, May 07, 2006 6:15 PM by Wim Hollebrandse
Phil - aren't you contradicting yourself a bit? You're saying VB.NET feels more solid, and C# more subtle, whatever the heck that means...

And in your last paragraph you go on to say that you need to feel confident that the VB.NET code you write is as solid and stable as your C# code...

Eh?

# re: VB.NET vs C#? Is there even an argument?

Sunday, May 07, 2006 6:49 PM by yaip
I feel the same way. The only thing is that the languages are interchanged. I am more comfortable with VB.NET as opposed to C#. Whenever I see a C# code, my very first step is to translate it to VB.NET so that I know what's going on.

I guess it is the comfort level.

# re: VB.NET vs C#? Is there even an argument?

Sunday, May 07, 2006 9:27 PM by Terri Morton
I dunno, Plip. C# feels much more solid to me, with VB.NET feeling a lot more fuzzy. C# is deliberate and picky, sometimes annoyingly so for someone like me who started with VB.NET.

PS. Is that Duplo block from your own collection? :-P

# re: VB.NET vs C#? Is there even an argument?

Sunday, May 07, 2006 9:34 PM by xml
i used to code in vb.net and one of the reasons i stopped using it and switched to c# was the the ugly code the compiler generates when you compile your program.

i mean vb syntax is ugly but have you guys seen the code the vb compiler produces? its inefficient and just plain horrible.

and when coding in c# (with /warn:3) i feel i have total control of the program flow making less mistakes.

# re: VB.NET vs C#? Is there even an argument?

Sunday, May 07, 2006 10:56 PM by foobar
C# is like a chocolate sundae. VB.NET is like a Mars bar.

:)

# re: VB.NET vs C#? Is there even an argument?

Monday, May 08, 2006 9:34 AM by AA
In the end, your boss tells you it doesn't matter, he just cares about if you get the job done right and, most importantly, FAST!

# re: VB.NET vs C#? Is there even an argument?

Wednesday, May 17, 2006 1:07 PM by Gotham
You .NET guys are so funny. No only does it have to be .NET, it has to be one particular language -- probably C# 2.0 too. LOL.

# re: VB.NET vs C#? Is there even an argument?

Thursday, May 18, 2006 4:13 PM by Guy Peled
The whole concept of implicitly is horrible and after I too have seen a VB.NET written application disassembled I will never use it.
I also do not understand why did the Microsoft guys had to go and invent a new inheritance language... Shadows,Friend,shared... What was wrong with the good old new,override,static and so on...

# re: VB.NET vs C#? Is there even an argument?

Wednesday, July 19, 2006 9:10 PM by Greg Smith

I dunno I dabbled back and forth... used C and VB early on in PC programming a little VBScript later a little JavaScript, VB.NET, C#, recently, but you know.....the more languages I learn...BTW it's almost 20 years that have been a paid programmer ...the less it matters...the more you learn the less you care...there is no religion...no right or wrong way...things will fall in and out of fashion.

Basically the question is...when you think of a solution to a business problem (yeah it is all about business...software only exists to serve a business need) what language do you think in?

for me it changes all the time...basic initailly......pascal...cobol/JCL...xbase stuff..then tsql and C++ then PowerBuilder, ADA, Level 5...then VB...back to tsql...VBScript, Java, Javascript, XSL, Vb.NET, C#, etc ad naseum...

honestly I did whatever paid the best...and I have no regrets...there is no right and wrong...religion doesn't matter it's all business, politics and money.

realize that and you are way ahead of the game...

# re: c# is better :-)

Thursday, September 28, 2006 4:14 AM by Morten

Why? Because VB is a kindegarden syntax. All the special functions as overriding, and generics are forced into VB with a very hard syntax.

If you are going to make small and simple applications VB can do the thing. If you want to create something big you will save much time using C#.

There is one argument VB have and that is realtime compile. But just download the resharpner and you have the same (only better of course) realtime compileing as in VB.

# re: VB.NET vs C#? Is there even an argument?

Thursday, October 12, 2006 5:30 PM by Sean

Good post Plip, I like your thinking.

I honestly believe it comes down to personal preference, or perhaps your job profile and I've always been baffled by people's insistence on bashing one language over the other. I mean seriously, to those people I say if you like VB.Net, then use it and if you like C#, then use it.  Simple as that. Enough already with the [childish? petty? small-minded? insert your preferred term here, unless you want to argue about which term is better!] language flame wars though. We get it, you have an opinion.  Most people do.  Some are even mature enough to accept that others may disagree with theirs.

# re: VB.NET vs C#? Is there even an argument?

Thursday, February 08, 2007 5:12 PM by Juan

Something else not mentioned on this thread is that for some reason C# developers seem to be better paid. I myself don't understand it. Some people say C# developers (specially good/experienced) are hard to find and that is why they are well compensated. But if that is the case, then why do I see people claiming all the time that C# is the preferred language and most of the code examples out there are in C#?

I don't know what to believe.... but I do know for a fact that you can make more money coding in C# than VB.NET.

By the way, I am a VB.NET developer... (possibly not for long though...)

# re: VB.NET vs C#? Is there even an argument?

Friday, May 18, 2007 3:26 AM by xxxx

eeeee

# re: VB.NET vs C#? Is there even an argument?

Monday, December 17, 2007 3:38 PM by Guy

As someone who moved from VB .Net to C# I have to say that C# encourages much better programming practices.

After some 27 years of programming various languages in my opinion C# is a far superior language to VB .Net for the simple reason that you need to really understand OOP to program in C#.

# re: VB.NET vs C#? Is there even an argument?

Wednesday, February 06, 2008 3:09 PM by Bill New

After 30+ years as a computer programmer, I have found that everyone has a different angle when it comes to "which is the BEST Programming Language to use".

My Favorite Computer Language is STILL Assembly... even though I rarely use it.

Variables are handled differently in most languages. So that takes some getting familiar with the ways things are done.

I don't hate C/C++/C# but I have found that MOST programmers are lazy and don't put in enough comments to explain what their code does.

My preference is to use Variable Names that mean something.

For Example in Visual Basic, a lot of people would do something like this:

a = b * c * d

This is a lot better:

InterestAmount = PrincipleBalance * DailyInterestRate * NumberOfDaysForInterest

The second example is self documenting.

I have done a LOT of Basic, Visual Basic, and Visual Basic.Net ... Relearning C is what I'm doing now.

I, for one, get tired of the "language envy"!

C#.Net is almost 1 for 1 line compatible with VB.Net!

Happy Programming.

# re: VB.NET vs C#? Is there even an argument?

Sunday, May 11, 2008 10:14 AM by John

I'm a VB.NET programmer (programming VB for about 12 years).  Both languages compile to same IL code.  Both use the same .NET Framework, same library of classes, and are pretty much the same with different syntax.

Unfortunately for ME and other VB programmers, there are about 6X more jobs available for C# programmers than for VB.NET.  And I have been watching the trend and it's getting worse for us VB folks.

So in summary:

VB.NET = C# = "Same Framework"

VB.NET <> "Many Jobs"

C# = "Lots of Jobs"

VB.NET = "Less jobs every year."

C# = "Generally higher pay."

Conclusion:  I'm going to start learning C# syntax.

Should not be a big deal (same framework).

Sub = void

Function does not contain "void"

Select Case = Switch

Yes, I'm oversimplifying a bit.  But it's basically true.

It's too bad, MS has made VB a top notch development language (C# nonbelievers, visit MS and learn for yoursleves) and yet the market is forcing many of us to abandon it.

# their there vs they re

Thursday, June 12, 2008 6:13 AM by their there vs they re

Pingback from  their there vs they re

# re: VB.NET vs C#? Is there even an argument?

Saturday, June 21, 2008 6:13 AM by Pradeep

hi guys,.

There's nothing to Debate,..

I can make it simple,..

our human brain has one Interesting Tendency, it always wants to suffer,. always wants to live in the mildest of problems,

that's the reason why peoples Prefer C# and Java,

# re: VB.NET vs C#? Is there even an argument?

Wednesday, July 23, 2008 10:14 AM by closeguy2005

VB.NET provides the very useful  with keyword. This lets you enter the object variable just once rather than repeatedly. This can often make VB.NET considerably less verbose than C#, as you can see in this example:

’ Set TabPage properties in VB.NET

With TabControl1.TabPages(0)

  .BackColor = Color.Red

  .BorderStyle = BorderStyle.Fixed3D

  .ToolTipText = "Click Me!"

  .Text = "Hello world"

End With

// Set TabPage properties in C#

tabControl1.TabPages[0].BackColor = Color.Red;

tabControl1.TabPages[0].BorderStyle = BorderStyle.Fixed3D;

tabControl1.TabPages[0].ToolTipText = "Click Me!";

tabControl1.TabPages[0].Text = "Hello world";

For programmers with no previous experience of a C-like language, VB.NET code will, in most cases, be easier to understand than the C# equivalent. Take the example of a simple for loop. You could read this VB.NET version aloud and understand what it does:

For i As Integer = 0 To 7

  TabControl1.TabPages(i).Text = "Tab: " + i.ToString()

Next i

The same cannot be said of its C# equivalent:

for(int i = 0;i < 8; i++){

  tabControl1.TabPages[i].Text = "Tab: " + i;

}

# re: VB.NET vs C#? Is there even an argument?

Wednesday, July 23, 2008 11:03 AM by James

"VB.NET provides the very useful  with keyword. This lets you enter the object variable just once rather than repeatedly. This can often make VB.NET considerably less verbose than C#"

IMHO the "with" keyword is bad practice and leads to more obscure code, remember more often than not other people will end up having to support the code you write....

As for the "for loop" comment, it is likely that many developers (especially those in web development) will have to be familiar with c-style loops for use in scripting languages such as javascript, so if they can't understand a simple c-style loop this would in the end be a disadvantage to them - and of course the c-style loop is a lot less verbose than the VB style loop, to use your argument in favor of the "with" keyword....

There is not many differences between the two, I tend to think of c# as being a nicer to read vb with all the shit (like "with" for example) left out.

# re: VB.NET vs C#? Is there even an argument?

Sunday, August 17, 2008 11:11 PM by Andrew

I choose C# because it has a stronger community.

Goodies like nunit, nant, log4net, nhibernate were introduced in C# community long before VB.NET.

Leave a Comment

(required) 
(required) 
(optional)
(required)