VC++ perfomance or VB.net RAD

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,016
Location
Cambridge, UK
Programming Experience
5-10
I know this isn't going to seem like a windows forms question but bear with me....
After dabbling in vb.net for around about a year or so now (started out my career in vc++) i am finding myself troubled by one question...

In terms of windows forms applications is VC++ really that much faster than VB.net, i mean i know it's faster but are we really talking about large amounts. I have written a project in vb.net and the same project in vc++ but i can't say that it made a MASSIVE difference other than the vc++ took longer to write!! Having heard a difference of opinion from most of my friends in the industry i thought i might post the question here and see what you guys thought. I know that most of you are going to be crying out that it really stems from prograaming background and personal preference when it come to the choice, but i would like to know if any of you have any hard facts that would make me sway one way or the other as i find myself at a career impass as to which route to follow.
 
When it comes to performance of managed code VC++.Net and VB.Net should be equal, they both are first stage compiled to IL (Intermediate Language) without optimization. When run IL is compiled to native code by JIT (Just In Time compile) and this is where optimizations happen on equal base. The difference is usually sloppy coding.

For unmanaged code C++ is where it's at, but VB.Net has got the highly optimized InterOpServices at hand and can also access the same unmanaged resources of Win32 libraries.

So much for hard facts, but C(++) has always been regarded "professional" and VB "hobbyist", so C# is perhaps the "money route" you ask for?

The true questions are perhaps: Is there a need for C++? Is there anything you can't do from managed code? Can managed code exist without C++ (ie can it be managed without a manager) ? Just some thoughts, and don't forget Assembly Code..
 
If you want to build WinForms apps then VB.NET/C# is a better bet. C++ will probably never die, or if it does it will not be for a long time. C++ is as good as required for anything genuinely high-powered or performance critical. A GUI is far from performance critical, so C++'s advantages are wasted and, as you say, it actually hinders the development process. It is great to be able to use C++ for performance critical areas in applications, but then you'd choose unmanaged C++. Someone else may be able to point one out, but I can't see where C++.NET has genuine advantage over VB.NET or C# in any area.
 
I appreciate the advice. Must admit though that i still find myself a bit clueless, however i think it's best if i keep using both. But just as a note, i prefer to write in vb.net.
 
if you want to use both I recommend moving into C# C++ better man. And like they mentioned already, the code runs the same. There is one slight difference though. Visual Basic has a built in checker for it's For Loops and all. A C# or C++ loop will generate results faster but it would require a massive scale. I personally appreciate the sacrifice the speed for the insurance. If you were to try and manage the loop in C# then you'd be adding more code and the result would then again be equal.


[Added Later] I learned that what I told you was true but not so true. As JohnH mentioned in this post they are equal when compiled to the IL but during the compilation procedure VB has an internal checking something or another that insures safety with your code. I don't know all the specifics just read a lil something about it here and there. So basically the only significant slowing is as it's getting compiled to the IL which is for the most part only done once in the programs lifetime from starting the process and dosn't matter much.
 
Last edited:
Back
Top