Web Development

General discussion


VB .NET vs. C# .NET

By jloranger ·
What are the advantages (or disadvantages) to using VB .NET over C# and vice versa? Is each language more suitable to particular types of applications?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

All of them are good, but

by Binghong In reply to VB .NET vs. C# .NET

There are not significant advantages or disadvantages between C# and VB.NET. I use C# at work because my previous programming experience is from C/C++ and Java, so I like that bracket syntax instead of plain English in VB. If you start a new project without modifying old code, I suggest that you use C#. It is more object orient than VB.NET.

Collapse -

More Money

by majolar In reply to VB .NET vs. C# .NET

There's a simple difference between VB.Net & C# - more money! This difference is caused by a number of factors like:
- Perception that VB developers can't do OO programming
- Microsoft is definately investing a lot in C# (Look at the sample code for the latest technologies - most of it is in C#)
- Don't take my word for it, take a look at your local job listings.
- Mono is done in C#
- Many third party tools only support C# (or support C# initially)

If you're just strating up, save yourself some pain and learn C#.NET and get more money for the same level of experience as VB.NET developers.

BTW: Microsoft won't tell you/advertise that C# is fractinally faster than VB.NET and guess what I'm a VB.NET developer who's just converted to C#!

Collapse -


by Tracy.Davenport In reply to More Money

how is c#.net faster than vb.net if they both get compiled down to the same il??

just wondering.

Collapse -

Not the Same IL

by Bucky Kaufman (MCSD) In reply to faster?

how is c#.net faster than vb.net if they both get compiled down to the same il??
----- ----- ----- ----- ----- ----- -----

They don't get compiled to "the same" IL.

Consider an example - creating an array of Objects, through which you want to iterate each's properties.

The "logic" that is used to create, manage availability, and destroy the objects - as well as the way of accessing the properties - is different in C, from VB. Therefore, the underlying IL is different.

VB assumes that you are going to need some safety and usability functionality that C might not mandate - that means the C code will likely be faster because there's less code to execute.

Collapse -

by Tracy.Davenport In reply to Not the Same IL

ok. sounds logical.

Collapse -

C# == Powerful

by ksamarakoon In reply to VB .NET vs. C# .NET

VB still remains the inferior language although it has been seriously improved on with the invention of '.NET'. C# however, is more useful for more powerful features and speed. If you already know a language like Java, then you'll have absolutely no problem learning C#!

Collapse -

my two cents

by martin.jordan@atkinsglobl In reply to C# == Powerful

I started out on VB.NET moving from VB6. I've since learnt C# too and had a big part of researching which route my employers should follow. We did alot of digging and found the following...

1. There is a massive amount of disinformation and assumptions out there. Alot of people assume because C++ was faster than VB6 then the same applies in .NET. Utter rubbish. If you use strict typing with VB.NET (set 'Option Strict On') then the code is as quick.

2. I have documents that list every little thing that one language has that the other doesn't. VB.NET does the odd thing C# doesn't and vice-versa. The things that only one or the other does are limited and can be counted on one hand. For 99.9% of folk both languages will do the job perfectly well.

3. Alot of .NET is about the Framework. The framework is common to all the .NET languages.

There is no right and wrong answer to this dilemma. My advice is learn the one you are most comfortable with now. If you're a C++/Java head then learn C#. If you're from a VB background then learn VB.

Once you're over the initial learning curve i'd then suggest you learn the one you didn't learn already. I've recently done a course in C# and it was pretty painless picking up the syntax and construct differences. Some things I found more natural in C#, some other things I found a pain (like having to wire up events yourself). I was productive straightaway though as alot of things you just code the same as in VB because the .NET Framework is common to both languages.

I hope this helps.

Collapse -

Hit it on the Head

by Maverick17 In reply to my two cents

I think Martin's hit it on the head: if you bother to learn how to write efficient code, you should be able to use either language and achieve the same or similar performance.

From my experience, in what I've seen produced by VB.NET coders (BTW - I pretty-much exclusively use VB.NET), there's justification for C# coders to call their VB counterparts names: the quality of the code is crap and I think there's one main reason for this:

Many VB developers just don't get OO. I believe the reason most companies are looking for C# people are that they want to attract people who can architect an n-tier application. Many VB developers think an object-oriented design involves using ASP.NET server controls because they're objects, right?

Often, developers choose C# because they had a background in Java or C++ and it's more natural to move to C#. Then they see an English-like language such as VB, have a look at what some of these people are turning out, then scoff and mock VB developers in general as Development Gumbies.

I'll always prefer VB.NET in my development, but from what I've seen of VB.NET code in Australia, there's some very good reasons why VB-ers have copped a bagging. VB Guys, if you're moving to .NET please learn how to write real OO code and stop coding like you did as an ASP scripter...?

I think part of the blame must go to Microsoft, too, for softening on the migration to .NET. My understanding was that things like implicit type conversions were going to be a thing of the past. Seems they caved to VB6 pressure and allowed this little "Option Strict Off" beast into our blissful New World.

So with Martin's 2 cents, I've just made up a dollar.

Collapse -

I Agree

by cimnik2999 In reply to Hit it on the Head

I have to agree with you on this one. I started out with VB. When I attempted to teach myself C++, I had a **** of a time with classes. Then I moved on to Delphi, where I really learned how to do OO. The transition from there to C++ was rather painless (writting simple console apps, not MFC or Win32).

Now that I have moved on the the .NET platform, I have never bothered to touch VB. I find the new keywords and code way too confusing and overcomplicated, such using whole words where C# uses one character. Not to mention the variable names that all theses keywords waste, and then futher making variabled case-insensifice.

I personally code only in C# and the new C++/CLI languages, depending on if i need to use unmanaged code or not.

Collapse -

You got it right

by siby12 In reply to my two cents

I totally agree. I have found the best way around this is to learn both languages. Start with the one you are comfortable with and then switch to the other. You will be more markertable

I would also encourage developers to be conversant with both .NET and J2EE platforms .. what have got to lose.. market yourself!!

Related Discussions

Related Forums