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

Started by
4 comments, last by MrEvil 18 years, 8 months ago
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]
Advertisement
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.
Turring Machines are better than C++ any day ^_~
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.
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.

You can read more about that on msdn: http://msdn.microsoft.com

There are some differences in the languages (but that are minor details, go with what you like, everything has some advantages/disadvantages), read about this stuff here:
http://www.codeproject.com/dotnet/CSharpVersusVB.asp
http://blogs.msdn.com/csharpfaq/archive/2004/03/11/87816.aspx
Microsoft DirectX MVP. My Blog: abi.exdream.com
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.
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.

This topic is closed to new replies.

Advertisement