Vikram Shetty

I know this is very basic question. But why one should select C# over VB.net



Re: Visual C# General Why C#

Ashish Basran

As the final code is going to compile as MSIL, it does not make any difference to the execution engine.

So if one is comfortable developing application with C#, should go ahead with C# and if in VB one feels it is easy and comfortable, should go ahead with VB.NET.






Re: Visual C# General Why C#

theblueeyz

Personally, I'm alot more comfortable in C# precisely BECAUSE it is less verbose - I don't need words like "Then" and "End If". Braces are fine for me; all I need are visual markers, and that's all that braces really are.

One thing that occurred to me a few days ago as I was switching back and forth between languages (two separate projects) I realized that my C# code has, on the average, MUCH MUCH shorter lines than the equivalent VB.NET code. If this matters to you (depends on how much you like horizontal scrolling) it may make a difference.

Really it's just a question of what you're comfortable with. Almost all of the object and method calling conventions are exactly the same between languages, so the actual meat of your code files will look the same - only the syntactical sugar is different between them.





Re: Visual C# General Why C#

timvw

Imho they have both their pros and cons... The "c# vs vb.net" debates are numerous (a simple websearch will return lots of valuable resources)... Anyway, in my experience it's a lot easier to find code samples in c# than in visual basic .net...





Re: Visual C# General Why C#

Mohamed Gani

Hi... the first programming language I learnt was Java. Then I moved on to C#. C# is almost identical to Java with some differences. I can say if you select C#, it is like learning Java as well. I'm not too sure with VB.net as I did not use it at all.




Re: Visual C# General Why C#

Figo Fei - MSFT

Hi, Vikram

There are a lot of articles about it, since it is a frequently asked question:

http://blogs.msdn.com/csharpfaq/archive/2004/03/11/87816.aspx

http://www.codeproject.com/dotnet/vbnet_c__difference.asp

http://www.dnjonline.com/article.aspx ID=mar05_vbvscsharp

Thanks.






Re: Visual C# General Why C#

cjard

It's a cleaner syntax and less ambiguous.. One glaring example that springs to mind is VB's usage of () brackets for BOTH methods and array indexers:

method(arg);

array[index];

method(arg)

array(index)

ugh..

try writing this in vb:

for(int linesRead = 0; reader.Read(); lines++)

ugh..





Re: Visual C# General Why C#

ahmhdy

I've just started with C# yesterday!

Now I can create very cool programs, you wonder how, that's because I've been studying C++ for a year, and it's really boring hard, but because of similarities between C# and C++ taking in consideration that C# statements are more simple, you can write your C# program in 10 lines while same one would take 50 lines in C++, add also that C# has the power security of JAVA and interface from Visual Basic.

With .NET also C# would be magic!

That's my humble opinion. Hope you like it.

Good luck