PDA

Click to See Complete Forum and Search --> : Visual Basic or C#


DeanMc
Sep 15th, 2008, 12:23 PM
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
Jan 29th, 2010, 05:36 AM
nice article.straight to the point

DeanMc
Feb 6th, 2010, 06:18 PM
Cheers, people put way too much thought and energy into this question, energy that could be used for programming or Xbox!

Pc_Not_Mac
Nov 22nd, 2010, 08:03 PM
Thank you DeanMc.
I have started with vb.net, but now i will change into C.
Thanks again.
Rep added DeanMc. :wave:

Nightwalker83
Nov 26th, 2010, 10:09 PM
As a chick in my class says VB is for wannabe coders!

Pc_Not_Mac
Nov 26th, 2010, 11:20 PM
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
Nov 26th, 2010, 11:48 PM
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.