To choose between C# and VB

I wish to start learning either C# or VB Express Editions. The aim is to write applications to communicate with 'homebrew' hardware on the serial port,or better still, USB. The communication requirements are modest - several different trigger signals to the hardware, read pushbuttons on the hardware, or collect slow speed data.

I would appreciate advice on the trade-off between the learning curves for C# and VB versus their communication capability. My programming background is intermediate level on embedded controllers using a form of Basic.

Thanks in anticipation.



Answer this question

To choose between C# and VB

  • Sunil_pachunde

    I'd like to think of VB.NET like I think of smoking. If you haven't started yet, don't, and if you have, now is a great time to quite.

    Being a C# and VB.NET "Professional" developer, I must say C# is much more pleasant. While C# positions do command higher salaries, it depends on the "Professional", not the language. I have a position now that is paying more developing in VB.NET than my previous position developing in C#. So salary really is not a factor for a "Professional" developer. VB.NET carries the baggage of previous version, while C# is new to the development world. C# has been created from the very syntax and grammar level, VB.NET has legacy traits still evident even in the 2.0 .NET Framework. You can find many more examples, books, and articles written in C# as opposed to VB.NET examples, books, and articles. One final note on the C# side is this, consider what the next 2 or 3 iterations of VB.NET will be like if they keep carrying the baggage of previous versions.

    C# is new and with all new things, a certain level of uncertainty exists. Version 3 of C# includes new features:

    · Implicitly typed local variables, which permit the type of local variables to be inferred from the expressions used to initialize them.

    · Extension methods, which make it possible to extend existing types and constructed types with additional methods.

    · Lambda expressions, an evolution of anonymous methods that provides improved type inference and conversions to both delegate types and expression trees.

    · Object initializers, which ease construction and initialization of objects.

    · Anonymous types, which are tuple types automatically inferred and created from object initializers.

    · Implicitly typed arrays, a form of array creation and initialization that infers the element type of the array from an array initializer.

    · Query expressions, which provide a language integrated syntax for queries that is similar to relational and hierarchical query languages such as SQL and XQuery.

    · Expression trees, which permit lambda expressions to be represented as data (expression trees) instead of as code (delegates).

    The problem is how does one keep up with an ever changing language because of its early stage of life.

    That's were the "Professional" developers separate themselves. Bottom line is this, where do you feel you strongest traits are as a "Professional", as a learner or as a teacher.


  • Mikaelm

    Just to confirm your choice (and for anyone else who reads this thread in the future), the language you work with is mostly about the syntax. If you want to become a good .NET developer, it is much more important to learn the Base Class Libraries (BCL). These are the classes, properties and methods that you will use to make magic happen, regardless of the .NET language you select. And odds are that advances, such as lambda expressions, dynamic classes, LINQ, etc will be either be implemented in the BCL or will be supported (albeit with a different syntax) in both languages.

    Happy learning ;)



  • hendrikswa

    hi,

    i can't tell you wich one is better because i'm still learning, but i'll tell you my experiance. i have a little back ground about vb so when i wanted to learn a programming language it was my natural choise to pick visual basic , when i tried to learn visual basic.net 2.0 i found microsoft changed it completly from the previous versions, so actualy most of the new stuff in vb is written by the formers of C#, even the guys that used to use visual basic suffer to migrate to the new version, so for myself i don't like to make extension to my hand and i hit the source C#

    both of them vb and c# will do the same thing i think because both of them talk to .net framework, but in vb you will counter hte historical back ground in toturials and things that no longer exit in the new version, c# is new and clean

    hope this will help



  • pawel.stanek

    Personally, I would suggest learning C# because the learning curve in some respects is about the same. After learning the semantic differences between the languages you need to learn the base class library (BCL) which would be the same regardless of the language used.

    C# was designed from the outset to support .NET development and besides that, C# developers tend to be in greater demand and with the right experiance can command higher salaries.

    Although the great thing about the .NET world is that it is language agnostic and you are therefore free to choose which language you would prefer.


  • QuanT

    Thanks to all those who answered my query. On the basis of what has been said, I have decided to go with C#. I had expected advice that C# would have had a more difficult learning curve. Possibly this is balanced by the 'cleaner' C# language versus the 'legacy' issues of VB

    Regards,

    Graeme Jenkins


  • Carsoni

    You identified one of the reasons why I would always recommend C# over VB, and that is that the VB language often lags behind C# one version in terms of new features.

    In the version of the C# language that was available with Visual Studio .NET 2003 developers could use the using() statement to define when a disposable object would be disposed. VB on the otherhand has just gained this ability in the current version.

    Primarily though, and this is just personal preference, I think the C# notation is cleaner than that of the VB language but that is likely because I came from the C and C++ path and not that of the (Visual) Basic language.


  • F.Costa

    : >>VB.NET carries the baggage of previous version,
    What 'baggage' are you referring to

    Isn't CInt still around YES Why not use the new converts Others suchas this are all still there.

    >You can find many more examples, books, and articles written in C# as opposed to VB.NET examples, books, and articles.

    Actually the trend is for vb examples and not C# examples. Please check this link:

    http://blogs.msdn.com/tomarcher/comments/495282.aspx

    You identifiy (1) link from (1) individual, hardly a good sample.

    >>C# is new and with all new things, a certain level of uncertainty exists. Version 3 of C# includes new features: <list of features snipped>

    Point being that C# is without issues either.

    sd


  • Fayed

    One other point of interest is this, a standard google search returns about 14.7 million pages with the keywords "C# code" as opposed to the google search of about 5.2 million pages with the keywords "VB.NET code" which really doesn't prove anything except C# is the talk according to google. Another note is that many of these sites do share VB.NET and C# examples, as do other books, articles, and examples.

    C# is just on the tips of everyone's tongue and I gets more attention, bottom line. In my opinion, it does so with good reason.


  • Mark Sletterink

    VB or C# is only a tool~~

    The most important thing is HOW TO REACH THE TARGET [Method] ~~

    I think vb or c# is OK since both of them base on the same .Net Frameworks


  • Stoyko Kostov

    My answer to this question was always 'it depends'. Specifically, it depends on the type of development you plan on doing. At 2.0, the differences in capabilities in the languages is minor. Very minor. Most of the differentiating factors are in the IDE. Visual Basic .NET is aimed at former VB developers. Their goal is to get working applications delivered quickly. They are less concerned with creating a 'perfect' solution and more with providing business value in a timely manner.

    The C# IDE is aimed more at what I call 'professional' developers. These are people for whom creating a more elegant solution is worth pushing delivery by a few hours (or more). They are more likely to be focused on the structure of the application and less incline to be satisfied with a 'good enough' solution.

    Now realize that these two descriptions are broad strokes. But I'd figure out which category you want to belong to and select the language on that basis. Also, realize that combining the languages within a single solution is trivial. So if you pick one language and find it lacking in a particular area, you can always use the other language to handle that gap.

    Hope that helps.



  • Rocker

    >>VB.NET carries the baggage of previous version,
    What 'baggage' are you referring to

    >>
    You can find many more examples, books, and articles written in C# as opposed to VB.NET examples, books, and articles.

    Actually the trend is for vb examples and not C# examples. Please check this link:

    http://blogs.msdn.com/tomarcher/comments/495282.aspx

    >>
    C# is new and with all new things, a certain level of uncertainty exists. Version 3 of C# includes new features: <list of features snipped>

    All of these features will be implemented in the next version of VB as well.

    I started .Net development in VB.Net. I am now using C#. I like C# but I can't say that I prefer it over VB nor vice versa. The bottom line is that you should learn both so that both tools will be in your toolbox. After a while, you will probably develop a preference or at least you will use one more often than the other, but you have the advantage of knowing both.

    Good luck.

  • To choose between C# and VB