?
Solved

Efficiency of VB vs C#

Posted on 2004-10-10
3
Medium Priority
?
377 Views
Last Modified: 2008-02-26
I already know vb.net and I am taking the plunge to learn C#.  My question is this; Say I write two identical programs (performs the same tasks and looks the same) , one in VB.net and one in C#.  Is there a speed difference between the two programs?  I have heard C# is more efficient than VB.  Please clue me in on this. Thanks.
0
Comment
Question by:hunterdnance
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Expert Comment

by:JR2003
ID: 12271656
I don't see that C# would be anymore efficient than VB.NET. For each VB.NET line there is an equivalent in C# and the .NET compiler should compile then to the same .NET framework common language code.
0
 
LVL 3

Accepted Solution

by:
KeithWatson earned 2000 total points
ID: 12271778
The only significant difference between C# and Visual Basic with respect to performance is that C# allows you to declare "unsafe" sections of code (given the correct compiler options). Unsafe code allows you to manipulate memory directly using pointers, much as language like C and C++ do. Using pointers, there is the potential to improve performance in certain circumstances; the tradeoff being that it's more difficult to program and easier to introduce defects, which can often be tricky to track down.

However, your question assumes you write identical programs. They both compile into MSIL, so give or take any failures in the compilers, there's no reason why one would run faster than the other.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question