PDA

Click to See Complete Forum and Search --> : C# or VB.NET


kiwis
Jun 11th, 2009, 08:53 PM
I've made a few programs in VB.NET and i've still got loads and loads to learn just taking each hurdle as it comes, I've been looking at simple game examples now and they seem to all be done in C# so was thinking what is the difference other than the format of the code, I've googled it but a lot of search results talk about the difference in code not the difference in performance or capabilities...

Can someone please explain it to me, if I want to make powerful programs and games later on is it better to switch and start learning c#?

DeanMc
Jun 12th, 2009, 04:56 AM
As true today as when I first wrote it Visual Basic vs C# (http://www.vbforums.com/showthread.php?p=3334461#post3334461)

JuggaloBrotha
Jun 12th, 2009, 08:09 AM
kiwis, one thing most people fail to realize is that c#, vb.net, c++.net, j#, etc all run on the same framework which means all the c# managed code and all the vb.net code is running on the same framework inside the same clr. So performance really only matters when you start including things (dll's, com objects) that dont run on the .net framework otherwise vb.net and c# run with the same performance. It also helps to know that when vb.net and c# get compiled to the MSIL code, the MSIL code is virtually identical, there's extremely subtle differences between the two once compiled.

kiwis
Jun 12th, 2009, 05:31 PM
but for advanced programs and games which will almost always use dll's it's better to learn C# or C++

What about those two what's the difference?

DeanMc
Jun 12th, 2009, 05:54 PM
It's still a subjective thing, really you should know as much as one as you should the other, I started with VB and changed to C# because that is the way jobs are going in Ireland but I still do the odd program in VB because sometimes its better to have both on your CV.

As JB said the differences are few and far between and knowing the framework is the key to advancing your knowledge!

Dark Anima
Jun 13th, 2009, 08:53 AM
kiwis, one thing most people fail to realize is that c#, vb.net, c++.net, j#, etc all run on the same framework which means all the c# managed code and all the vb.net code is running on the same framework inside the same clr. So performance really only matters when you start including things (dll's, com objects) that dont run on the .net framework otherwise vb.net and c# run with the same performance. It also helps to know that when vb.net and c# get compiled to the MSIL code, the MSIL code is virtually identical, there's extremely subtle differences between the two once compiled.

Does c++ with VS run against the .net framework? As there's so many things you can do with c++ but not do with C# or VB, I always thought vc++ and c++ were the same, visual studio was just another compiler. If not, how come those things can't be done in VB or C#, as it's built into the framework? Are visual c++ apps just as slow as any other .net app?

Atheist
Jun 13th, 2009, 08:58 AM
Does c++ with VS run against the .net framework?

C++/CLI contains managed extensions that requires the .NET framework. Visual Studio can create these types of projects aswell as unmanaged c++ applications.

As there's so many things you can do with c++ but not do with C# or VB, I always thought vc++ and c++ were the same, visual studio was just another compiler. If not, how come those things can't be done in VB or C#, as it's built into the framework? Are visual c++ apps just as slow as any other .net app?
What things that cant be done in VB or C# are you refering to?

Dark Anima
Jun 13th, 2009, 09:05 AM
As a brief example, injecting into a process and opening a form inside it. I'm speaking of the pretty advanced stuff, which simply isn't built into VB at least.

JuggaloBrotha
Jun 13th, 2009, 09:21 AM
Does c++ with VS run against the .net framework? As there's so many things you can do with c++ but not do with C# or VB, I always thought vc++ and c++ were the same, visual studio was just another compiler. If not, how come those things can't be done in VB or C#, as it's built into the framework? Are visual c++ apps just as slow as any other .net app?c++ and vc++ as far as I know are similar, vc++ uses the Visual Studio compiler is my understanding.

c++.net is the only .Net implementation that I know of that runs on the .Net Framework

Here's how I think of it:
If there's no ".Net" in the name, other than c# and f#, odds are it doesn't run on the Framework.

penagate
Jun 14th, 2009, 07:11 AM
As a brief example, injecting into a process and opening a form inside it. I'm speaking of the pretty advanced stuff, which simply isn't built into VB at least.
Managed code can't be injected into unmanaged threads.
(I suppose you could inject unmanaged code into managed threads, but I've not seen it done in practice.)


Similarly, code that relies heavily on runtime library calls (like VB6 code) can't be injected into processes that don't have those libraries loaded.

DeanMc
Jun 14th, 2009, 12:18 PM
And .Net applications are not slow either. I've seen examples compared on the internet and they tend to be skewed. .NET was conceived for LOB, enterprise and other such applications in was never intended to say build games (Which is why the XNA framework was built).