Convert self from C # to VB.NET

I am a C # programmer (hobby), but I want to convert to a VB.NET programmer. I have seen many posts written in both C # and VB.NET, but I need links that explain the most advanced ones from the basics (like void main void).

Note: Microsoft blogs (so far everything I've read) are not core knowledge / things at the core level.

+4
source share
7 answers

Besides books / blogs, a good way to find out the other side of the C # / VB wall is to write C # code, compile it and open the DLL in Reflector and view it as VB code. This will allow you to answer your questions about VB.NET.

For example, suppose you want to see how to make generics in VB.NET. You are writing a simple library in C #:

void SomeMethod() { List<int> list = new List<int>(); } 

Compile this, then open in Reflector and it will show you:

 Sub SomeMethod Dim list as List(Of Integer) = New List(Of Integer) End Sub 

or something like that...

If you know how to do this in C #, you can probably teach yourself how to do it in VB.NET, easier than looking for samples on the Internet.

+6
source

C # and VB.NET are just syntactic sugar on top of the .NET Framework. The .NET Framework APIs are the same for both, and there are some features that are available for one and not the other.

One thing you discover is to put ";" after each statement when you switch from C # to VB.NET (which is forbidden in VB.NET).

+5
source

The thing about Visual Basic.NET is that it has a huge history in versions prior to the .NET version. This caused some odd constructs and keywords that aren't completely logical from a C # point of view, but make sense when you have a background in VB.

e.g. And, AndAlso, Or, OrElse. Look at them and find out that it's all about keeping VB6 programmers happy.

Get a good book if you really need / need to do this. This is more than one question on this forum.

+4
source

Visual Studio magazine featured useful articles in January 2008.

You may also be interested in the questions " what is allowed in VB, which is prohibited in C # " and " Converting C # knowledge to VB.Net "

+2
source

An MS blog will not talk about basic things, unless they are something recently released or ongoing. I suggest MSDN instead of http://msdn.microsoft.com/en-us/library/2x7h1hfk.aspx

+1
source

I found the Code Draft Complete Comparison for VB.NET and C # , which makes an in-depth comparison of VB.NET and C # for the 2005 language version. Hope this helps.

+1
source

May I also recommend VB Language Spec

+1
source

Source: https://habr.com/ru/post/1336912/


All Articles