Thursday, July 9, 2009

Is c# that much different from c++?

Can you explain the difference to me about c# and c++? I am programming a game for xbox 360 with some friends, just about 2 days ago they told me that the game is going to be done i c#, i was like oh damn cause i only know c++. So do you think i could learn C# easily since i know GUI C++ and 3D C++?

Is c# that much different from c++?
It's not that much different from C++. It doesn't use pointers though. It uses references. It is very similar to Java. But, it is also similar to C++. You should easily be able to learn it. And, there are plenty of books available.
Reply:C# hasnt been used in games for years, tell them to click this link... http://www.xbox.com/en-US/dev/developing...





and download the .doc and then press ctrl+f and search for C++ they should read the following:





"Xbox 360 games are programmed using the Microsoft® Visual Studio® development system. The Xbox 360 development kit (XDK) supports development using either C or C++."





Then tell them they're idiots for using C# and your right because C++ is much faster. That should change their arguement forever to be honest, if they still want to write a game in C# don't bother with helping, it isn't worth you spending time and effort learning C# to make a crap game that runs at 20frames a sec.
Reply:Yeah its similar i think it has Java intergrated i think im not sure.
Reply:c# was based on c++ but is syntactically very similar to Java. If you're familiar with either, than c# won't be hard. Buy yourself a book or find a good online tutorial.
Reply:You need to go to the ITools.com website and ask this same question. You will get much more specific answers there. Set up an account for yourself and a profile. You can probably find the subject in existing conversation threads under C# or C++.
Reply:Yes, I can because I am good like that. Ok, first thing first. C# is closer to the structure and style of Java, but closer syntactically to C++. With that said, since you are developing a game with C# for the 360 you are probably using the XNA framework. If you know 3D with C++, you will be happy to the know that while syntax may be slightly different, 3D is 3D. You can find more out about XNA here: http://creators.xna.com/


The major difference is that C# is completely object-oriented and while C# supports pointers there is really no need to use them in regular programming. The reason is C# supports garbage collection. It is important to understand how this works in game programming, so as to not to take performance penalties by a garbage collection occurring at a bad time. The other important thing to understand is that most things in C# are objects. There is a lot to explain as far as XNA and C#.


I will recommend two books.


For XNA:


Chad Carter's "XNA Unleashed" from Sams publishing


For C#:


Andrew Troelsen's "Pro C# 2008 and .NET 3.5" from Apress





Good Luck!


No comments:

Post a Comment