Why Microsoft has no VB examples

kdsdata

New member
Joined
Mar 22, 2016
Messages
4
Programming Experience
10+
When I search Microsoft site(s) for things that should include examples in vb.net code there usually is only c#.
And so it goes on most sites that are returned for Google searches.

One survey for late 2019 says vb.net is as strong as ever, something like in the top 5 platforms.
So why is it so hard to find a reference (google returns) for vb.net?

What am I missing when I search?
A simple search for tutorial vb.net, the google return to Microsoft leads you to an article that creates a Hello World, but the example is in C#.

Any help to find good vb.net article, codes, etc. would be very much appreciated.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,314
Location
Sydney, Australia
Programming Experience
10+
There's no doubt that Microsoft favours C# when it comes to .NET development. There are indeed more code examples available in C# than VB and the community/industry at large follows suit. There are even some .NET technologies that only support - or only fully support - C#. That's just something you need to live with.

One thing that I would suggest is to use Bing as a search engine. I haven't used Google in a long time, so maybe it's better now, but I always used to find Bing provided superior results when it came to searches on .NET development. I assume that it's because they are both Microsoft properties so .NET is provided special treatment by Bing. I also subscribe to Microsoft Rewards so I just use Bing all the time and I have no complaints.

Another thing I would suggest is that you download Instant VB from Tangible Software Solutions. It is a code converter that does a far superior job to anything you'll find on the web and the free version will be enough to convert most online examples from C# to VB.

Finally, if you haven't already, make sure that you have selected VB as the display language on the Microsoft Docs site. Some examples are only available in C# but there are many that are available in VB but you have to select that as the language. Be aware that I have seen a few pages that seem to be broken and show C++ when you select VB. Unfortunately, there's no great secret to finding VB examples or VB-specific information. Just be sure to include VB.NET as a keyword in your search to increase your chances of getting more relevant results.
 

kdsdata

New member
Joined
Mar 22, 2016
Messages
4
Programming Experience
10+
I suspected as much. @jmcilhinney you have given me, and perhaps some others, very interesting advice. I'll be trying this. The Microsoft language select I had never heard of. And I may find that I won't miss Google search :) Hopefully it lead to better results. Thanks very much.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,314
Location
Sydney, Australia
Programming Experience
10+
One thing that I didn't mention before is .NET Core. There has been a lot of focus on .NET Core recently and that lacks full support for VB at the moment, so that would also explain a lack of focus on VB in documentation, etc. .NET Core 3.x actually does support VB but not fully, so it's not supported in VS yet. VB is not supported in ASP.NET Core at all. I'm not sure exactly what VB support in .NET 5, which I believe is supposed to basically combine .NET Framework and .NET Core. I'm guessing that VB functionality will be better than it is in .NET Core currently. I doubt that that will help to state of VB-specific documentation and examples too much though.
 

Sheepings

Senior Programmer
Staff member
Joined
Mar 7, 2014
Messages
131
Location
UK
Programming Experience
10+
You shouldn't be using a search engine like bing or google. Instead use the .NET API Browser and search for whatever it is you are looking for. For example, If I search up click you get a result of all the different events and methods involving things that involve click.
Screenshot_59.jpg


Note that the default display code examples are already in C#, but Microsoft allow you to change this for the different languages available :

Screenshot_60.jpg


Setting the appropriate dropdown will update the page with an example in the language you selected. There are some very old pages which are not part of the documentation but are only pages or articles of interest which may be wrote in the preferred C#, but that doesn't mean that an example doesn't exist in the documentation when searching through the API browser.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,314
Location
Sydney, Australia
Programming Experience
10+
You shouldn't be using a search engine like bing or google. Instead use the .NET API Browser and search for whatever it is you are looking for.
That's a bit too definitive, I think. Certainly, you should be using the .NET API Browser to find specific information about a particular type or member. That documentation is very focused though, so it's certainly not the only place you should be looking, depending on the circumstances. I always use the documentation first when I know what type or member I'm specifically looking for and I recommend that everyone else do the same, but that doesn't mean that I don't use a search engine to find information too, particularly on broader topics.
 

Sheepings

Senior Programmer
Staff member
Joined
Mar 7, 2014
Messages
131
Location
UK
Programming Experience
10+
but that doesn't mean that I don't use a search engine to find information too, particularly on broader topics.
I can understand if you don't know what you're looking for, and for that, you may want to bing around or whatever to find out how something is done. But if you are a good developer, you ought to know what it is you want to do and you should at least know what it is you need to look up on the API browser instead of relying on search engines to hopefully return a result or a direct answer. That's the trouble with a lot of "developers" now-a-days, they google howtos for half the projects they make, instead of teaching themselves the framework and writing their own code based off of the documentations they should have been learning from the start.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,314
Location
Sydney, Australia
Programming Experience
10+
That's the trouble with a lot of "developers" now-a-days, they google howtos for half the projects they make, instead of teaching themselves the framework and writing their own code based off of the documentations they should have been learning from the start.
I do agree that many people search for extremely broad topics and expect to find an "example" that basically does exactly what they want to do from end to end. I would also agree that many more people than do should spend more time familiarising themselves with the types they're using and their members, fewer questions would need to be asked. That said, it's not always possible to narrow a question down to a specific member or even a specific type, so sometimes you do need to broaden the search. In this specific case, @kdsdata did mention searching the Microsoft site first, so I think that he may land in our good books. I'm guessing that your second screenshot might well address the main issue. I'm surprised how many people aren't aware that you can change the preferred language on the MS Docs site. Maybe it's because you couldn't or didn't have to on the old MSDN site (if I'm remembering correctly).
 

Sheepings

Senior Programmer
Staff member
Joined
Mar 7, 2014
Messages
131
Location
UK
Programming Experience
10+
I'm guessing that your second screenshot might well address the main issue. I'm surprised how many people aren't aware that you can change the preferred language on the MS Docs site. Maybe it's because you couldn't or didn't have to on the old MSDN site (if I'm remembering correctly).
You're remembering very correctly. The old website if memory serves me correctly used to have its documentation mostly split-up in different pages where all various Microsoft supported languages would be in different sub-sections.

Even though Microsoft had UpdatePanels in ASP.NET as part of the .Net Framework, they didn't make use of UpdatePanels to add the functionality we see on their website today, which allows us to change the code language to our preferred choice of language without refreshing the page or needing to visit a different page, and we can acquire the same explanatory explanations as to the 'whys' and 'hows' of how things work in all of the different pages without needing to navigate to a new page for a different language variation. Today, the API info is all on one page, and we can select our language example from the drop down menu.

The old website was designed with each of the languages being separated from each other and on separate pages entirely. It was also horrible because some pages had way more detail on a VB.Net page than a C# page had with exactly the same topic covered in less detail. Thankfully the editors have since removed most of these static pages and merged them into the new API Browser. There are only a few remaining pages to be moved now before its all finally inside the new API Browser. Oh yea, the old website was terrible for sure.
 

kdsdata

New member
Joined
Mar 22, 2016
Messages
4
Programming Experience
10+
Wow, I am amazed at the good advice I have received. Each one in itself may apear small, but all of them together have helped me a lot. I am already finding things that are much more applicable to my project. In one respect the best tidbit has been the language selection hint. That's the one that opened up a whole new world. Yes, I had translation tools, but they usually distract one, and make the learning process harder, often because the translations are not always perfect.

You may have seen that I have programmed for 10+ years, in fact its more like 40 years. Yes, I started in '79 with machine language. We started with printer drivers for the first Applewriter. Never did it as a fulltime job, only unofficially with special apps on almost every project as electrical engineer. I have gone from paper manuals (that actually was the nicest, because they were very detailed), to online help in bulletin boards that you had to dial up (anyone remember the acoustic phone connector), eventually to the Internet. My latest beef is that too often one winds up in a loop, "for more info click here", leading to more clicks, and more clicks, and too often back to the original point. In essence you really don't get "more info", just the same info, often the text is a copy. Yes, the old website was terrible, but not so in the early days. microsoft.com/files was super. It was "all" there. There was a time when Microsoft actually wanted to listen to it's users, and we had user group meetings where Microsoft sent their developers to talk to us. I don't see that happen anymore. Unless I am too old to notice. But it's time to get of my soapbox.

Anyway, thanks again for all your advice. It has been really helpful.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,314
Location
Sydney, Australia
Programming Experience
10+
Yes, I had translation tools, but they usually distract one, and make the learning process harder, often because the translations are not always perfect.
Try the one I recommended. It produces vastly superior results to anything else I've seen. Many tools haven't even been updated to support LINQ but Instant VB is regularly updated to support new language constructs. There's Instant C# to go the other way too, if you ever need that.
 

kdsdata

New member
Joined
Mar 22, 2016
Messages
4
Programming Experience
10+
Try the one I recommended. It produces vastly superior results to anything else I've seen. Many tools haven't even been updated to support LINQ but Instant VB is regularly updated to support new language constructs. There's Instant C# to go the other way too, if you ever need that.
@jmc..., that's the latest I am using now, after your recommendation. Thanks.
 
Top Bottom