tags:

views:

1364

answers:

16

I'm mainly a flash and PHP web developer. I have been trying to learn some new languages and I thought it would be good to use VB.net for my introduction to .NET. However both online and offline I find a lot of elitism going on with VB being considered an inferior language when compared to C#, Java etc.

Is VB.net really that bad a programming language? OR is there some other history towards the VB hatred that I am missing, something like the Python vs PHP wars!

+4  A: 

Oh, it's not, but C# has a lot more trendy syntax, and VB is a little ... it's got some training wheels. It can be a little unsatisfying for people used to other languages. But BASICS have been around for, what 40 years? There must be some reason.

Charlie Martin
Trendy? It looks like C!
Steven A. Lowe
Trendier than "Dim X as Integer"
Charlie Martin
+6  A: 

Given that you're a php developer, you might find that C# has a more familiar syntax - I suspect that's one of the reasons for C#'s popularity in that it closely resembles a number of other languages.

VB.Net is every bit as capable as C# - the negativity towards it stems from the days of VB6 more than likely.

Bayard Randel
+28  A: 

VB isn't a bad language per se, but it tends to be looked down on because it lowered the bar to the point where anyone could make an application. While this may sound like a good thing, it allowed even the most inexperienced to slap "developer" on their resumé.

Most people going into a VB project these days get that same "code smell" they do when they see an Access database driving an entire company inventory system.

However, VB.NET and C# are actually pretty similar. Obviously, their underlying MSIL is virtually identical, but even their syntax is somewhat similar in terms of how you declare variables, instantiate classes, etc. VB.NET is a huge leap from VB6.

Soviut
I will second that VB.NET was a pretty big step forward from VB6, but it's still carrying the stigma from the previous versions.
MadKeithV
Also I think (at lease in the being in of .net) because VB.NET programmers often come from a VB6 background and C# programmers often C, C++ background.
Tom Alderman
I'd say the main issue with VB (as a whole) isn't so much the dilution of credentials, but rather that, by allowing people who know nothing about programming to write their own code, you get a *lot* of crap code, which is not appreciated by those who get called in to clean up the mess.
Dave Sherohman
@dave yeah, that's generally what I was getting at. They can write terrible code, but still call themselves a developer because they were *able* to write that bad code.
Soviut
FWIW: The MSIL produced by VB.NET is not necessarily identical to that produced by C#. VB has a bit of extra baggage to support things like the "My." namespace, and a few of the VB idioms don't translate well into C#, leading to some distinguishable features in the resulting MSIL.
tylerl
+8  A: 

I think the VB haters are there because they see VB and its derivatives as "wysiwyg" languages. Not too far back, anyone with VB 6 and MS access was a developer. From there they hit ASP.NET and now they're webmasters. They use absolute positioning, global variables for loops and their code looks like this:

Function EnableControls(OnOrOff AS string)
    foo.Enabled = OnOrOff
    bar.Enabled = OnOrOff
End Function

Do all VB programmers write code like this? No. Do programmers from other languages write code like this? Yes. Will that stop the hate? No.

Ben
+1  A: 

If you look at the history of VB, it was really geared towards non-programmers, or at least less savvy programmers. Most people using VB, traditionally go for the wysiwyg tools and just fill in some gaps with a little code. These are not people that take pride in coding, as much as they are practical people with less knowledge trying to get the job done. As a language it is simpler (thus the "BASIC" in VB) and therefore looked down on by more knowledgeable programmers.

VB.Net is a big step towards C#/Java type languages, and a move away from previous versions of VB. As such, its really not that big a deal to get started with, even if you want to move into C# later. You will get more documentation and support for C#, though. And its a language you can grow into.

Russell Leggett
+3  A: 

First...there are more VB programmers than there appears, they just don't admit it too frequently for fear of getting flamed.

But, it probably comes down to two things:

1: Lots of programmers who entered the field w/out any programming background probably entered through MS training and VB6. So by virtue of no/bad training, you see a lot of bad VB code.

2: VB.Net makes writing code easy and reading code hard (wordy, diff. syntax from most Cish languages), but writing code is the easy part. You spend a lot more time maintaining code than writing it, so reading should be easier.

2 is a bit subjective, but IMHOP has some merit.

Aaron
most non-cish languages have different syntax from most cish languages, e.g. Pascal, FORTRAN, some argue that wordiness is VB's strength
Patrick McDonald
+11  A: 

For historical reasons.

  1. BASIC was created as a language for teaching people to program, like LOGO. It was not created for 'real' development.

  2. VB6 and it's ancestors were pretty poor. They were not properly OO, had half baked component model etc.

VB.NET is now much better but struggles to shake off the reputation from past sins.

Craig
+8  A: 

BASIC has been looked down upon pretty much from the very beginning--mostly by academics, and largely because it ostensibly teaches coding patterns that make it difficult to solve problems down the road.

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

-Edsger W. Dijkstra in 1975

Unless you come from a heavy BASIC background and don't want to change, you'll be much better served by C# in the .NET world. The language and the framework fit together significantly better -- VB.NET is a bit of an afterthought added on to help pull the hordes of VB developers into the .NET world.

tylerl
I learned QBASIC, moved on to Pascal, Delphi, C, C++, VB4, VB5, VB6, ASM, Java, and now C#, and I would firmly disagree that BASIC programmers are in any way mentally mutilated.Especially since .NET languages still promote proper decoupling, and OO principles, I don't think this is still the case.
John Gietzen
I wasn't saying I agree with Dijkstra; but his quote is a famous one apropos of the question at hand. I was serous about the relationship between C# and .NET though. New language features like linq are implemented for C#, with C# in mind, and then ported to VB. The .NET framework "fits" C# better.
tylerl
I learned how to program on QBASIC, QUICKBASIC, VB4, VB6, ASP and even some VB.NET before switching to C#, ActionScript, Python, Javascript, etc. I don't think the BASIC language is the issue, its people and their stubbornness.
Soviut
Quoting Dijkstra from 1975!? Are you kidding!?
JRS
@JRS -- Yep, BASIC is, indeed, that old. And even then it was looked down on.
tylerl
+7  A: 

Beginners All Purpose Symbolic Instruction Code

Who wants to use a language with the word beginners in its acronym ;-)

Tim Jarvis
maybe they should have renamed it Visual Amazing.Net ?
Pondidum
A: 

I like to think of VB as more of a starting language for developers as its somewhat easier to understand for beginers and for basic applications.

Where as C# has more advanced syntax to still be readable in complex applications.

(I learnt VB at school and C# at uni) learning VB first helps you get your head around the .NET framework and Object orientated Programing.

d1k_is
+3  A: 

For each programmer there comes the day when they decide to start programming .NET. Most have programmed before and have more or less background in one or more languages.

If they are most familiar and comfortable with C/C++, Java, PHP, or any of a number of other c-like languages, their path of least resistance is C#.

If their comfort zone is some dialect of Basic, then VB.NET.

These are probably correctly considered to be two distinctly different populations of programmers (although, of course, with huge numbers of exceptions and outliers), but the general perception follows accordingly.

le dorfier
+3  A: 

I never see new / fancy / exciting applications being written in VB.NET. Do you ?

I dread VB.NET not so much for the "language" per se but the "type of applications" for which its used.

When I think VB.NET I immediately think migration / maintenance. That makes me sad.

Preets
+5  A: 

I'm a VB.NET developer and I don't think it's a bad language, to be honest I think most of the time it's incredibly usable and readable language., I just love it. Even though I worked as a C++ / C / PHP / C# developer I still think VB.NET is the best language I used. However you VB was one of the worst. There is massive difference VB.NET and VB.

However if you are a new starter I'll recommend you to go with C# because everyone else using it, in VB.NET you'll have problems with jobs, code samples, good blogs etc. It's especially harder for beginners. VB.NET is n----r of the .NET world as in "Woman Is the N----r of the World"

As a final note if you are a C# developer you can code in VB.NET and vice versa. .NET is so great in that manner it doesn't matter which language you choose it's going to take about only 2 weeks to get used and code as you normally do in a different .NET language.

I worked in couple of projects where the developers were mix of VB.NET and C# developers. We always worked in C# and VB.NET projects, every one of us managed code nicely in the other language without any major issue.

Also a nice blog post about how MS's bad treatment to VB.NET.

dr. evil
any explanation of down votes? Curious about justification :)
dr. evil
are you serious?
ojblass
your usage is technically correct but attracting that kind of attention is not advisable.
Jeff Atwood
now it's OK and a good answer. +1
moster67
Sorry I wasn't aware the word is that offensive, considering that I referenced the original song in case people might not get me correctly. Next time I'll try to keep it censored :) I understand that it's a sensitive subject.
dr. evil
A: 

VB.NET is certainly not a bad language. However, it is easier to learn VB>NET than C#. So, there is a perseption that you do not need great skil to become a VB.NET programmer between fans of other cryptic languages like C#, java, C++ etc. Also, a lot of VB.NET coders are old VB6 programmers and good number of times code produced by them are not up to the latests OO trend. I would recommend you stick with C# because.

  • You will find breaking features are not almost always supported in VB.NET E.I anonymous delegates, lambda subs, nullable variables etc.
  • The .NET community is more C# friendly
  • You will find more books/examples in C# than in VB.NET

At the end go with a language which feels right to you.

Niran
A: 

Oversights in the VB compiler such as the following (there are more but not going to root them out now) still give Vb.Net the "it's not a real language" smell, even though it's a gazillion times better than Vb6.

  • You can't switch off a particular warning for a class / method
  • Vb misses some lots of unreachable code warnings
  • clunky lambda expressions
  • no anonymous delegates
  • no yield statement

I come form a Vb3/4/5/6 & C++ background, and my 5 or 6 years of .Net time have been pretty much split between Vb.net and C#, and given my druthers I'll jump for C# every time.

Yes, I prefer the language syntax, but more importantly the language is more expressive and powerful, and the C# compiler is a more complete, more functional compiler than the Vb compiler (IMHO).

Binary Worrier
I do however find the vb.net background compilation to be better than the C# background compilation.
Pondidum
True, but the pros don't outweigh the cons for me.
Binary Worrier
+1  A: 

VB.net is not a bad language but it does encourage some bad habbits that C# is less tolerant of. There is also some snobbery involved. C#'s syntax is also more similar to well used existing languages such as Java and C++.

There is however little you can do in one language that you cannot accomplish in the other as they also compile down to the same intermediary language.

As Fish points out C# has some features VB does not. You could also argue the reverse that C# is missing some features VB has such as optional params and XML literals.

Microsoft have said that in future both C# and VB will co-evolve so this argument becomes weaker as most features will be available in both languages. Wikimedia covers some of these changes: http://en.wikipedia.org/wiki/C_Sharp_(programming_language). There is also a Microsoft white paper detailing them which I cant find at the moment (sorry).

Overall through if you are going to learn one language learn C#. The syntax is cleaner, more examples are written c# and it seems to be more popular job wise and command higher salaries.

alexmac