Jump to content
  • Advertisement
Sign in to follow this  
Avenyr

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
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 this post


Link to post
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.

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

Share this post


Link to post
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 this post


Link to post
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 Encoding
unsafe
{

Dim p As Encoding* = &x
}



from


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



This converter seems to work better.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!