C# or C++ anyone know which one I should buy?

Discussion about everything. New games, 3d math, development tips...
Post Reply
hopeful

C# or C++ anyone know which one I should buy?

Post by hopeful »

http://www.microsoft.com/PRODUCTS/info/ ... t=0&page=2

I read conflicting nonsense, and mostly what I find on the net is people whinning about their personal feelings of Microsoft or java or whatever. Please don't post any of that here.

I'm trying to decide to buy Visual C++ .net or C# .net, both from Microsoft, both the same price.

Please do not link to any sites promoting C# that then mention that the writer of the artical is selling a book about it. He'd tell you it was good just to sell his book, so you can not trust his opinion. Also, I don't want to read some trillion word rambling artical that switches back and forth between a thousand and one differant things.

When I take C++ code and try to use it with C# do I:
1. Have no trouble. It works perfectly.
2. Some modifications are necessary, but nothing too complicated.
3. Most things require little or no effort to transfer, but some things don't translate well and will therefor take a long time to transfer over.
4. Any program of any length will take forever and then some to transfer over.

Does a long program run faster when compiled in C# than C++, slower, same speed, or only mild differance no one would notice unless using some crappy computer that was 10 years old?

Can you turn garbage collection off if there is a need to do so?

I'm hoping that someone who has used it will reply to this.
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

My opinion:

Converting C++ to C# is likely a 3.. most things would not take too much effort as the syntax is pretty much the same, but some things may take effort. For instance, converting from using the STL to C#'s API will likely take more then just a few method calls. The GUI aspect of C# is completely different from C++ as well. If you've ever tried to convert from C++ to Java, I imagine the process would be pretty much identical.

C# is promoted as being as fast as C++, and for the most part this is true. It is of course slower, but not by much. Unless people are running CPU intensive operations that take 5 minutes in a C++ program, they would not notice (ie. the normal < 0.1 second operations will still be too quick for the human eye).

You cannot turn off garbage collection in general, but you can tell the garbage collector to not delete specific objects, and other such manipulations on an object by object basis.

Another thing to note: There is no C# wrapper for Irrlicht, so if you intend to program with Irrlicht, you must either create your own wrapper, or use C++.

Edit: C# is also much nicer to work with. The standardized API makes higher level programming easy, you don't have to worry about creating your own class for many simple things, or searching the web in the hopes of finding good C++ code to do what you want. The GUI development in C# is also great. If you ever used the Visual Basic 6 GUI development or higher, it is the same; drag/drop buttons, text boxes, etc onto the form, set all the properties through a visual interface, and all you have to do is add in a few lines of code to handle button clicks, etc. But of course all this is mostly for app development, not so much game development.
Last edited by Boogle on Tue Dec 16, 2003 7:00 pm, edited 1 time in total.
wornaki
Posts: 54
Joined: Sat Aug 23, 2003 1:18 am
Location: Argentina, South America

Post by wornaki »

Let's see. As far as I know, C# is the ultimate language for the .NET platform. That means that you can turn garbage collector off when using this particular language.
C# is an extended language that is not so different from C++ yet similar to Java. That basically means that c++ code can be translated to c# with some kind of effort for it to get adapted to some new features and styles... I would say point 3.
There should be no difference in speed between apps program in any of both languages. However, the .NET platform is in fact, heavy and you should be aware of it.
Visual C++.NET is not C++ anymore because it will be MSIL compiled with the JIT to give the same result as C#, supposedly.
Cheers
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Having used C++, C++.Net, C#, VB.Net, and VB 6.0 here is my take on it all.

C++.Net, C#, and VB.Net all start on the path of managed code and a CLR. I have no clue what the anacronym is, but it works like a DLL in the respect to how VB 6.0 does COM. At that point, you will get a slight performance hit in some areas and a performance boost in others. It had most to do with the restructuring of containers.

The managed code path is interesting, but finding large sources of support for these frameworks is difficult. You can find out how difficult by starting to look for "Managed DirectX in C++" or "VB". Now, the strange thing is that since all three of these goes through the same CLR, the languages themselves are just a different front end. If you program the same application on any of them, it will come out as the same in the binary form.

The thing I liked about C++.Net from MS is that you can use the .Net libraries and managed framework or not. =)

Now, transferring from C++ to C# is a chore and a half and similiar to the amount of work that it would take to port a C++ application to JAVA. The language is similiar, but the differences are broad expanses.

The only other hinderance to C++.Net, C#, and VB.Net are that the user would have to have the .Net runtimes installed (a 40 meg download).
Crud, how do I do this again?
hopeful

Post by hopeful »

Thanks for the replies.

http://www.gamedev.net/community/forums ... _id=196172 is a long debate I was linked to by someone else after asking them about this. I looked through part of it.

So I diffinately need C++ to use the Irrlicht Engine. I'll order it then.

I was also told about http://www.icsharpcode.net/OpenSource/SD/ being "a nice alternative for a C# IDE. (The compiler from Microsoft which is included in the SDK is free anyway)."

I just downloaded it and I'm going to try it out.

But if Irrlicht code is too hard to port over to it, I'll buy Microsoft's Visual C++ .net. Its only $109 after all. Not that big of a deal.
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Keep in mind you don't have to port Irrlicht's code over to C#, you just need to create a managed wrapper around the unmanaged DLL. I'm not sure how to do that myself but I'm sure there would be info about how to create managed wrappers if you search google.
stampsm
Posts: 142
Joined: Mon Nov 10, 2003 5:52 pm
Location: Las Vegas

Post by stampsm »

if you don't want to buy C++.net you can always use devcpp it is a free download(use google to find it), i and a lot of other users here use it and irrlicht works with it right from the download like it does with MSc++
it may not have all of the extra stuff to do windows graphics built right in but irrlicht doesn't need that so it doesn't matter
it also seems to follow standards closer so it can be easier to port working code to other compliers that can compile for linux and hopefully for mac when irrlicht supports it
i tried to learn how to program using MSc++ but i gave up and eventually started to use devcpp

ps. where did you find C++.net for $109 is it a educational version, it is usually alot more for the full retail
hopeful

Post by hopeful »

http://www.microsoft.com/PRODUCTS/info/ ... t=0&page=2
As mentioned in my first link, that is where you will find the product. Its the full version. I don't know why you would think it would cost more.

And dev-C sucks. There are too many examples I download from across the net that will not run with it.

Anyway, last night I ordered Microsoft Visual C++ .net for $109.

Since more people use it still, and C# is a new language from Microsoft, and we all know that anything new from Microsoft will have severe problems that need to be patched up bit by bit over the next 8 months or so, I just went with it.
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Jokes about Microsoft aside, C# has been out for more then 8 months. In fact they are up to the .NET Framework version 1.1.
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

hopeful wrote:And dev-C sucks. There are too many examples I download from across the net that will not run with it.
I agree... Dev C++ sux dirty weasel butt. VC++ rules all. Bow down b4 Emperor Gates!
wornaki
Posts: 54
Joined: Sat Aug 23, 2003 1:18 am
Location: Argentina, South America

Post by wornaki »

I agree... Dev C++ sux dirty weasel butt. VC++ rules all. Bow down b4 Emperor Gates!
If you say so :P . I can't buy VC++ because 109 dollars is almost 330 units of my local currency and that is more or less the half of a middle monthly salary :!: Way too much.
Besides, I prefer gnuu compilers. They are cleaner to me.
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

Cg should be good too. Difficult to learn but, you can use all fx effects and that kind of poop! Loading a small model, Yust stay duplicating in your game and when you have a FX videocard your framerate doesn't drop!

Nice language
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
FleshCrawler
Posts: 108
Joined: Fri Aug 22, 2003 1:04 pm
Location: Kerkrade, Netherlands
Contact:

Post by FleshCrawler »

VeneX wrote:Cg should be good too. Difficult to learn but, you can use all fx effects and that kind of poop! Loading a small model, Yust stay duplicating in your game and when you have a FX videocard your framerate doesn't drop!

Nice language
Cg is only for Nvidia Cards, and you cant program anything other with it then their Pixel Shaders.

I'm not 100% sure about this.
but when downloading the Cg SDK and trying to compile it i also need to complie the Cg's with a differend compiler included in the SDK.

so thats why my opinion is that Cg isnt a real Language like C/C++/C# and the rest :P
I've been absent for really long, but i'm ready to reign my terror on you once again, mwuahahahahaha
Post Reply