VB or C#?

Strange_Will

Member
Joined
Jan 31, 2006
Messages
14
Programming Experience
1-3
So which language would be better to program in ASP.NET in? I've been using VB, but most examples are in C# is there a reason for this? Is it more powerful or something?
 
It is just a matter of preference, I would say.
 
Microsoft wrote the .NET Framework in C# and most of their .NET applications are written in C#. It is Microsoft's language of choice, probably because it competes more closely with Java due to its similarity. It is also more like C++ than VB.NET is so it's easier for most of the high-powered developers they already have to switch to. The biggest advantage of C# is that it supports pointers, and that's important for much of what microsoft would want to accomplish with their apps. For your average ASP.NET developer there is no practical difference. If you have C/C++ or Java experience I'd say go with C# as the syntax will be familiar. If you have VB6 experience then go with VB.NET. Other than that just take your pick.
 
I am amazed at how easily I can understand C# coming from a strictly asp non-javascript background. So much so that im thinking of learning C# just to add that to my resume :)
 
quickbasic22 said:
But I hear you can't make calls to API's from VB without modifying the data type, like adding a null to the end of a string to talk to windows functions. I think the data types restrict VB from the C language that you might want to learn C just so you can modify Windows or Windows Programs.
I don't know where you heard that but it's comletely not true.
 
What surprised me at PDC was to hear the CLR language architect guys spend an entire session talking about how much better VB.NET was than the other language options because of it's wide range of capabilities. They basically said that C# requires a more strict programming model. For example, all types must be known beforehand (during compile-time) and that it takes quite a bit of coding to deal with types that you do not know about until run-time.

VB.NET, on the other hand, can be written as strict as C# if you want to do that, or as loosely as VBScript or other scripting languages like PERL. I think this is a big benefit, especially for web applications. I enjoy having the ability to bounce back and forth between very strict and less strict techniques without having to think about it too much.

It also sounded like the future of VB.NET will continue to span the spectrum wider and wider... allowing more strict and more loose techniques.

So, you may be losing some capabilities in C#, but most likely they are not the capabilities you would miss in most ASP.NET applications... and they may be provided in future VB.NET releases anyway.
 
Back
Top