Using both VB.Net and C#? (Lisa Feigenbaum)

Using both VB.Net and C#? (Lisa Feigenbaum)

  • Comments 8

It's common today to switch back and forth between VB.Net and C# for different projects, jobs, teams, etc. VB MVP Kathleen Dollard and C# MVP Bill Wagner have gathered some tips to keep in mind when you make these transitions. They both write for Visual Studio Magazine, which is where these articles were released last week as part of the December edition.

What C# Devs Should Know About VB by Kathleen Dollard

What VB Devs Should Know About C# by Bill Wagner

Editor in Chief, Patrick Meader, also wrote an Editor's Note for this issue On the Benefits of Learning Multiple Languages. He explains that "Developers of VB and C# can learn a lot from the similarities -- and differences -- between the two." It's an interesting read, so be sure to check out all three!

Leave a Comment
  • Please add 7 and 3 and type the answer here:
  • Post
  • Nice. I learnt how to program using VBA, VB 5, 6 and .NET 1.0. Professionally I mostly use C#, and when I mention that I like to use VB.NET in my hobby projects ppl instantly looks down on me. Explaining that both languages ends up as MSIL doesn't help much. That's the reality in Denmark.

    Well, I wasn't really going to talk about myself. Instead I want to thank the VB team for your cool blog, and then I wish that one of you VB ppl will team up with one of the C# ppl and write an article or two about the new features in C#4 and VB10. The important thing for me is to learn what new features both languages share and what new features that are unique for each of the languages.

    Every time a new VS is released we get articles that explains some of the new features in the respective languages but it always take me some time to figure out what features are common and what's unique (and guess if I was extremely disappointed when I found out that VB9 didn't have auto properties :-P).

    __________________________________________

  • I'd like using both VB.Net and C# to write a class. VB doesn't dupport important .Net features like iterators, anonymous delegates etc.

  • I'll quote the articles here:

    What C# Devs Should Know About VB by Kathleen Dollard:

    "The most significant thing missing in VB is iterators. "

    What VB Devs Should Know About C# by Bill Wagner:

    "One of the more important points for a VB developer using C# to keep in mind is that iterator methods using yield return and yield break make it easy to create methods that generate, examine, or modify sequences. "

    "You can see that at work in almost every LINQ query written (in either VB.NET or C#). Select, Skip, SkipWhile, Take, TakeWhile, and Where, among other methods defined in System.Linq.Enumerable, are implemented as iterator methods."

    "Iterator methods are one of the core building blocks used to create the LINQ functionality you might have already used in your favorite .NET language."

    If the Visual Basic Team was unable to implement (copy from C#) this feature for 3-5 years and says that it cannot be done in another 1+ year... you can understand people loosing faith in VB.

  • Hi Fduch,

    We understand that functional parity between VB and C# is a very important goal for us to achieve. In Visual Studio 2010, you will see a concerted effort by both languages to add features which previously only existed in the other. We will continue progressing in that direction in the future.

    Lisa

  • Hi Anders,

    Please see a follow-up post that I've added here, on the new features in VB 10.0 and C# 4.0:

    http://blogs.msdn.com/vbteam/archive/2008/12/23/what-s-the-list-of-new-language-features-in-visual-basic-10-0-and-c-4-0-lisa-feigenbaum.aspx

    Thanks,

    Lisa

  • Is there some example using .NET 3.5 (VB) for C#'s

    yield return "some string";

    and

    yield break;

    I am converting a C# app to VB.NET and am stuck on this part.   Any help?

  • @Sheir,

    Here's an example which demonstrates how you can achieve this today:

    visualstudiomagazine.com/.../use-iterators-in-vb-now.aspx

    We are also working on a feature for the next version of Visual Studio which will make this even easier:

    msdn.microsoft.com/.../gg497937

    Cheers,

    Lisa Feigenbaum

    Community Program Manager

    Visual Studio

  • The C# Yield functionality is part of a feature called iterators.    Iterators are not currently supported in VB.NET but is being worked on as part of the Async Functionality for which there is a CTP that you can download and try but this should not be used in production code as this is still only a CTP.

Page 1 of 1 (8 items)