C# advantage
What advantages does c# have over visual basic?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Mar 5, 2014, 11:07 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 5, 2014, 11:32 PM EST
hi,
Please refer
http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Visual_Basic_.NET
http://stackoverflow.com/questions/2434825/vb-net-vs-c-net
hope this will help you.
VulpesRank #55 · 29.2K reputationPosted Mar 6, 2014, 12:20 AM EST
However, unless you work with memory-mapped devices or do a large amount of interop with unmanaged C/C++ libraries, it's of limited value.
Ehtesham MehmoodRank #719 · 3.3K reputationPosted Mar 6, 2014, 12:31 AM EST
http://www.vbrad.com/article.aspx?id=63
Mongezi Sithole36 reputationPosted Mar 6, 2014, 9:51 PM EST
Nathaniel Moschkin4 reputationPosted Mar 26, 2014, 5:41 PM EDT
One caveat that does not often get mentioned, and unless you study the CIL you probably wouldn't spot it: But in C#, you always return a variable from a function with a return statement. In VB you simply assign the function's name as a variable to the value, or you can use return.
So.
in C#:
void a(int x) {
return x + 4;
}
in VB:
Sub a(x As Integer)
a = x + 4
' or
Return x + 4
End Sub
The thing about VB code when compiled into the CIL is you will notice, if you use the return statement, that an extra stack push is made to transfer the returned variable. If you simply assign the function's name to the variable, the extra stack push does not take place, because in VB, as originally designed, the only way to return the variable was to assign the function to its value. The return statement was added later, and, from the looks of it, somewhat hastily. This is why for performance critical code in VB, I still use the assign function name method.
There's some trivia for you all for the day!
Joginder BangerRank #360 · 7K reputationPosted Mar 26, 2014, 7:40 PM EDT
don't worry and don't confused me also share a link. check a msdn official link
Nathaniel Moschkin4 reputationPosted Mar 26, 2014, 8:40 PM EDT
He probably just wants to gain more perspectives from more people.
Look at it in this manner: It is an important question because people keep asking it.
It's also a somewhat personal question, because sometimes, official answers do not satisfy the craving for knowledge.
He wants to know from people who have experience with both languages... from many different sources.
You should never chastise someone for asking a question. You should maybe chastise someone more for giving a bad answer.