C# advantage
What advantages does c# have over visual basic?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nathaniel MoschkinPosted Mar 27, 2014, 12:40 AM
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.
Joginder BangerPosted Mar 26, 2014, 11:40 PM
don't worry and don't confused me also share a link. check a msdn official link
Nathaniel MoschkinPosted Mar 26, 2014, 9:41 PM
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!
Mongezi SitholePosted Mar 7, 2014, 2:51 AM
Ehtesham MehmoodPosted Mar 6, 2014, 5:31 AM
http://www.vbrad.com/article.aspx?id=63
VulpesPosted Mar 6, 2014, 5:20 AM
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.
Jignesh TrivediPosted Mar 6, 2014, 4:32 AM
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.
Lakshmanan Sethu SankaranarayanPosted Mar 6, 2014, 4:07 AM