Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

878424 Posts in 32923 Topics- by 24333 Members - Latest Member: blackarm

May 21, 2013, 09:43:30 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)What are the differences between C++ and C#
Pages: [1] 2 3 ... 5
Print
Author Topic: What are the differences between C++ and C#  (Read 14088 times)
Neo1493
Level 0
***


View Profile Email
« on: November 03, 2008, 01:17:42 PM »

I am trying to decide which one to learn and use what are the pros and cons of each one
Logged
Ivan
Owl Country
Level 10
*


alright, let's see what we can see

Valaam0
View Profile
« Reply #1 on: November 03, 2008, 01:25:43 PM »

I'm assuming you're talking about C# in the context of .NET?
Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
Michael Buckley
Level 0
***



View Profile
« Reply #2 on: November 03, 2008, 01:29:39 PM »

Well, the list of differences could go on for pages, but I think that you might be able to make the decision based solely on your target platforms. Microsoft's XNA uses C# exclusively. If you're targeting your game to the 360, you'll need to use C#. However, XNA is pretty much only for Windows and the 360. If you want your game on Linux, Mac, Wii, PS3, PS2, DS, or PSP you'll need to go with C++.

EDIT: Obviously C++ works for Windows as well. The only platform C++ won't work on is X Box 360.
« Last Edit: November 03, 2008, 02:33:46 PM by Michael Buckley » Logged
Powergloved Andy
BANNED!
Level 6
*


{I'm not really banned} Ladies love the Powerglove

kidwell@live.com Spiffy5ver
View Profile WWW
« Reply #3 on: November 03, 2008, 01:32:06 PM »

Learn C++. C# is great, but learn C++. If you learn to do C++, you can do anything. Simple.
Logged


PANDA COOKIE NATION!
Neo1493
Level 0
***


View Profile Email
« Reply #4 on: November 03, 2008, 04:26:12 PM »

Thanks so I guess Ill go start learning C++
Logged
Farbs
Man
Level 9
*



View Profile WWW Email
« Reply #5 on: November 03, 2008, 04:45:03 PM »

EDIT: Obviously C++ works for Windows as well. The only platform C++ won't work on is X Box 360.
Clarification:
You can code for the 360 in C++, but you need proper dev status and equipment. It's only XNA that's limited to C#.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #6 on: November 03, 2008, 08:16:06 PM »

Thanks so I guess Ill go start learning C++

I did not know that! Thank you for correcting me. I was under the impression that Microsoft was moving all of their devs over to C#, but I'm glad to find that's not the case. Nothing against C#, but all of my code is in C++.
Logged
Zaknafein
Level 4
****


renaud.bedard@gmail.com
View Profile WWW Email
« Reply #7 on: November 03, 2008, 11:38:02 PM »

If you want to learn one of them quickly, I'd look at what prior experience you have with Java or C, or other languages.
C# is much more like Java than like C; it's a managed, garbage-collected language.

Edit :
I'm assuming you're talking about C# in the context of .NET?

There's another C# I'm not aware of? Shocked
« Last Edit: November 03, 2008, 11:42:58 PM by Zaknafein » Logged

bateleur
Level 10
*****



View Profile
« Reply #8 on: November 04, 2008, 03:14:38 AM »

I am trying to decide which one to learn and use what are the pros and cons of each one

C# is a better language, but C++ is way more important and useful in the real world.

If you don't mind programs taking forever to write and crashing a lot, C++ is definitely the right choice. :D
Logged

Hajo
Level 5
*****

Dream Mechanic


View Profile
« Reply #9 on: November 04, 2008, 03:21:26 AM »

If you don't mind programs taking forever to write and crashing a lot, C++ is definitely the right choice. :D

It's not that bad. C++ is just a double edged sword, very powerful, and spanning the whole range from "seeing the bits in hardware registers" to very high level constructs (if you have the proper libraries), and even meta-programming if you let the compiler do calculations on templates.

It's a very broad language, which makes it time consuming to learn, and since it's so powerful on many levels, it gives you plenty of ways to make mistakes.

I use to call C++ a beast. Very powerful, but very dangerous. Tame it, and the power is at your hand. Fail, and it'll eat you.
Logged

Per aspera ad astra
Cymon
Level 9
****


Computer Kid


View Profile WWW Email
« Reply #10 on: November 04, 2008, 09:06:16 AM »

C# is fantastic for rapid development. Unfortunately it ends up being the very definition of "quick fix" because Microsoft is going to change C# and .net on you every 6 months meaning something is going to break. So your rapid developed product becomes something you have to support and revisit every 6 months or risk it becomming obsolete. The consequence is you end up spending so much time on your old projects that you can't ever go on to your new ones, which is most likely exactly what Microsoft wants.

A vote for C++ is a vote for freedom!
Logged

Cymon's Games, free source code, tutorials, and a new game every week!
Follow me on twitter
dmoonfire
Level 3
***



View Profile WWW
« Reply #11 on: November 04, 2008, 09:11:11 AM »

I wouldn't go as far to say it will break every six months. It seems to take forever to get your user base to move major revisions and since you can install most of the different versions side-by-side, it really doesn't break. Most of my original stuff from years ago still runs rather smoothly on C# today.

There are advantages of C#. Memory collecting, classes are a bit easier to understand (mainly by the virtue of single inheritance), and Visual Studio is pretty nice for coding in it. There are advantages of C++, mainly more established and larger library selection.

But, it comes down to preferences. I prefer C# over C++, but I use both on a relatively daily basis (two products at work).

I also like that Mono runs pretty well on Linux for C#, so I get the cross-platform stuff I happen to enjoy.
Logged
Skofo
Level 10
*****



View Profile
« Reply #12 on: November 04, 2008, 07:35:46 PM »

Hidden third option: learn python. It is yummy.

But between those two, learn C++. Why would you want to restrict yourself to only Microsoft's [crappy] proprietary platforms?
Logged

If you wish to make a video game from scratch, you must first invent the universe.
isaac
Level 2
**



View Profile WWW
« Reply #13 on: November 04, 2008, 07:44:26 PM »

Hidden third option: learn python. It is yummy.

But between those two, learn C++. Why would you want to restrict yourself to only Microsoft's [crappy] proprietary platforms?

Yesss. I decided to try python out yesterday, and it's super fun! Though I find the lack of curly brackets slightly disconcerting.
Logged

Alex May
...is probably drunk right now.
Level 10
*


hen hao wan


View Profile WWW Email
« Reply #14 on: November 05, 2008, 06:29:07 AM »

I am trying to decide which one to learn and use what are the pros and cons of each one

C++ gives you lower level access to the computer and generally gives you the power to do more efficient and powerful code. That said, the cost of this is having to use a fairly outdated and unwieldy language that is fairly laborious to use.

It will take you years to get good at programming in general, regardless of which you choose, and in that time you will probably reach a higher level of coding standard if you learn a lower level language like C++. But it is a long and frustrating and complicated road.

You may get better short term results from learning C#, and speaking personally now that I have started using C# for my own work I find it very tiresome and boring to go back to using C++, regardless of the implications for the future of my code as guesst points out (personally I believe a short period of code rehab every 6 or so months is a small tradeoff for the bonus I net in coding performance by using an interpreted language, and I should point out I've been using C# for well over a year now (actually more like over 2 years I think) and haven't had to do any such maintenance).

It is important to know what you are getting yourself into and what you intend to use the language for before committing to it; as also pointed out C++ and C# are not your only options and C# is certainly not your only option for interpreted language game dev.

I would say that the Visual Studio IDE for C# really is a massive bonus, it just makes coding anything a lot faster as you have a lot of shortcuts and things made faster, plus there is edit and continue and all sorts of other stuff that is just faster to work with using C# and .NET than with C++. Not having to worry so much about memory is also a boon and not having to trudge through the process of making millions of header files and shit like that is really great too. It feels like a breath of fresh air after using C++ for 6 years but it may just be confusing and awful for a person new to both.

Hope that helps.
Logged

Pages: [1] 2 3 ... 5
Print
Jump to:  

Theme orange-lt created by panic