# Visual Basic.NET and C# same thing with a different syntax type ?[Answered]

This topic is 4845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've been talking with a someone I know that claims VB.NET is the same thing as C# except that C# has a C-Like Syntax and that VB.NET has a VB type of syntax. I can't seem to really find a real answer to this question. I am curious though about finding out if this is true, partially true or if this guy is whacked and on crack. I don't this to be a flamewar I just want some "proven facts" about this. I don't intend to use VB.NET but it might be good to know if it can be compared to C# or nothing at all. Thanks people for the info ^_^ [Edited by - Avenyr on August 10, 2005 9:23:11 PM]

##### Share on other sites
In most cases the languages are completely similar with just different syntax, but they do have differences. For example, C# has unsafe code and unsigned types, bith of which are not in VB.Net. VB.Net has optional parameters and With blocks, also not in C#. Overall though the differences are not major, and if you NEED something that is only in one you can mix code from different languages in your project.

##### Share on other sites
It's mostly true - The editors are a bit different (although not that much), but language capabilities probably map 98%, and performance is probably similarly close.

Basically, they both have very similar features with a very few exceptions (C# has usafe code that vb doesn't have, VB has late binding, etc), and in the end, they are both compiled to IL - so most differences in performance for normal usage due to small implementation differences in the compilers.

Most of your coding will probably be invoking the same library, further evening out differences.

##### Share on other sites
Well, its not the "same", both are completly independent languages and use a quite different syntax.

However, both rely on the .NET Framework and are even interchangeable (you can mix c# with VB, e.g. by calling c# code in VB, there are also a lot of other .NET languages you can use) because of the CLR (common language runtime). This results in the exact same performance (unlike VB6 vs c++ or java, VB.NET is a lot faster) for c#, VB or whatever .NET language you use when just calling .NET Framework methods.

http://www.codeproject.com/dotnet/CSharpVersusVB.asp
http://blogs.msdn.com/csharpfaq/archive/2004/03/11/87816.aspx

##### Share on other sites
Ok so this answers my question, I had my doubt that VB.NET was now JIT compiled to IL and that it was completely different than VB6 but wasn't sure about the similarity.

Thanks a lot for the info guys.

##### Share on other sites
Indeed, the main difference is syntactical. I had some fun with this C# to VB converter (and vice-versa).

Note also that VB by default Imports and references the Microsoft.VisualBasic assembly, which includes VB6 compatibility functions such as Mid, Left, MsgBox, PPmt, etc. C# does not do this by default.

I have my doubts about the C#-to-VB thing though, it just produced
Dim x As Encodingunsafe{	 Dim p As Encoding* =  &x }

from

Encoding x;unsafe{ Encoding* p = &x;}

This converter seems to work better.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633329
• Total Posts
3011381
• ### Who's Online (See full list)

There are no registered users currently online

×