# VBForums UtilityBank > UtilityBank - Tutorials >  Visual Basic or C#

## DeanMc

This article is intended to help people facing the C# or VB debate that is raging over the internet. You will notice that there are no code examples, no side by side comparisons and most importantly there are no lengthy paragraphs. Essentially what you have here is a genuine article devoid of all the useless nonsense that permeate other articles of this nature.

First let me start with the most asked questions. Bear in mind that these are my views and that they are based on using code for production not academics. This is because I'm sure you eventually want to make money out of programming and academic coding is wildly different to production coding.

*Which is the most powerful:*
Technically C# is the most powerful simply because it allows the use of unmanaged code. While many people will argue that VB has, for instance the MY namespace many of VB specific features tend to be wrappers to make certain tasks easier. This means, while C# does not have the MY namespace it can still achieve all of its functionality. If VB gained the ability to use unmanaged code it would be functionally as powerful as C#.

*Is C# safer than VB:*
No,  option strict and explicit exist to allow the language to be more flexible, if they are used incorrectly this is not the languages fault. Using option Strict/Explicit is analogous to using pointers in C#. Academically they should be avoided but production code sometimes requires a less than perfect approach to coding for a number of reasons.

*Which is easiest to read:*
This again is subjective. C# is written in a "C" style format. Visual Basic on the other hand is written in a pseudo-English style format. Which is "better" is a case of personal choice. Some people argue C# is overtly complex because of its heavy use of symbols, while many argue that VB is simply too verbose and that complex equations become hard to read. The only way to find out which one you like is to try both first hand.

*Which pays the most:*
At the time of writing C# pays the most. This is because of economics rather than language features. While C# does pay more its not a huge amount more and could change drastically in the future. Do not let this be the deciding factor as economics is beyond your control and a good programmer will always find properly paid work regardless of current trends.


So that's the most popular questions out of the way now its time to get down to brass tacks. Which language should you code in and why. Well the answer is both. Yes you should know C# just as well as you know VB. The fact of the matter is both of these languages target the same framework.  You will have twice as many job prospects by knowing the two main dot net languages rather than just one. It will also help you to understand the framework better because sometimes there are slight differences in how you utilise the framework in each language.

Obviously you should not try to learn both languages at the same time. Using your first choice learn how to program for windows, the web and database programming. Never throw out any of your written programs, now matter how trivial. When you are comfortable with writhing programs in your first language move to the second. The best way of doing this is to convert your old programs by hand. You may find you actually enjoy using the second language more than the first but always try to keep programming in both this will leave the door open for many more jobs and allow you to leverage each languages strong points within an application.

Hopefully this article helps you out. Remember many articles out there of this nature are simply blowing hot are around. They argue about keyword names and curly braces. Do not even bother reading a different article. The best thing you can do now, if you want to become a successful programmer is to open up your chosen editor and start programming in your chosen language, because wasting your time arguing over languages and abstract features means your coding less, which ultimately means your not making as much money as you could. Or if your into open source: Shine on you crazy diamond!

----------


## ReconX

nice article.straight to the point

----------


## DeanMc

Cheers, people put way too much thought and energy into this question, energy that could be used for programming or Xbox!

----------


## Pc_Not_Mac

Thank you DeanMc. 
I have started with vb.net, but now i will change into C.
Thanks again.  
Rep added DeanMc.   :wave:

----------


## Nightwalker83

As a chick in my class says VB is for wannabe coders!

----------


## Pc_Not_Mac

I would have say that Visual Basic is easy to learn compared to let say C++. 
But, if you start doing larger\difficult projects with VB then the story quickly changes.  
Back at post four i said that i will being starting to learn C, but then after making some test projects i quickly realized that its VB, but with C++ syntax.
Sure it allows you to use unmanaged code, but that's the only difference.
I will still move away from VB to C++ because of many reasons.

----------


## DeanMc

No its not, VB is a perfectly fine language for any scale project. .Net is .Net and aside from minor SKD's the are both the same. The idea of this thread was to stop chats like this, they are not conductive tho programming in general and tend to be biased to personal preference.

----------


## Shaggy Hiker

Most of the comparisons between VB and C# were written back in the days of 2005. Since then, MS decided to converge the two languages, and by 2010, the differences between the two were down to the trivial. There are a few to consider, though:

1) C# isn't just a language, it is a member of a family of languages that all use a similar syntax. If you learn C#, it will be easier to pick up any other C-style languages, such as C, C++, Java, and so forth. The use of operators and constructs is similar between all of these, though each has some particular quirks to it. The C-style language family is certainly the most popular and diverse in use today, which makes any C language appealing to learn just because of the ease of understanding other languages.

2) The C-style family of languages are also quite old, and the major problem with the whole family has roots in the very age of the family. There are features to the language that are maintained and perpetuated despite being clearly detrimental to the function of the language. Two of particular note in the C-style languages are the semicolon and the case sensitive naming style. Both of these features were forced on early C due to the limitations of the machines the early compilers were running on. Case sensitivity, in particular, was forced on C because the computers lacked the reserve processing power to case correct. That limitation no longer applies, yet all languages in the C family retain this legacy feature. Therefore, the languages are somewhat ossified when compared to a more modern language such as VB. However, even VB has some legacy features still dragging along with it from its early days, such as GOTO.

It would be reasonable to wonder whether or not these legacy features really matter. In the case of the C family, the answer is a modest yes. Case sensitivity isn't all that important, but if you mix proper and camel-casing into your coding style, then you can make use of case-correction to catch bugs and flaws. Basically, if you typed the name in all lower case, and it didn't case correct, then something is wrong. You can ignore that warning and wait for the code to fail at runtime, or you can track it down. This makes for slightly more reliable code (very slightly, though) by adding a features that is explicitly prevented in C-style languages. The semicolon is a more serious example, though. Nobody who has ever written in a C-style language has avoided spending some amount of time tracking down a bug that resulted from either leaving out a semicolon, or adding one where it shouldn't be. Yet, there is no reason for the semicolon to be in the code at all. All it does is indicate the end of the line. VB used to have the underscore to indicate when a line continued (opt in rather than the opt out of the semicolon), but even that was removed with 2010. The compiler has enough processing power that it can figure out where the line ends without requiring the user to indicate the fact, which was necessary to allow for multi-line lambdas in VB. C# got multi-line lambdas right away, since it had the semicolon to indicate where the line ended, but VB got the functionality without resorting to an explicit indicator. Therefore, C-style languages remain burdened with a character that is demonstrably unnecessary in that it adds no benefit to the language, but which is essential to the language for reasons that are now archaic.

Therefore, the second point is just that C# adheres to its family relationship, and maintains features because of the family relationship, while VB is more free to progress.

----------


## Spoo

Dean 




> ... You will notice that there are no code examples, no side by side comparisons ...


I see that its been a few years, but if you're still around, a few side-by-side comparisons
would be nice.

One in particular I'd be interested in is a MSFlexGrid comparison. It is a snap in VB6, but 
I imagine that a fair amount of coding would be required in C (unless it too has built-in
controls).

Spoo

----------


## Nightwalker83

> One in particular I'd be interested in is a MSFlexGrid comparison. It is a snap in VB6, but 
> I imagine that a fair amount of coding would be required in C (unless it too has built-in
> controls).


I believe he was comparing VB.NET and C# not VB6 and C#.

----------

