Skip to main content
gamedev.net
🔒 Locked

Learning C++ while using XNA?

Started by DeanMc Jul 26, 2010 at 3:09 PM 6 replies 1.2k views
Original Post
DeanMc
DeanMc
This isn't a C++ vs C# thread, I have come to the conclusion that if one wants to be a professional game developer C/C++ is the way to go. What I would like to know is if anyone used XNA while learning C++...

I know little of C++ and a bit of C# so I thought XNA would suppress my hunger for building prototypes while I get the basics of C++, opinions welcome!
Windryder
Windryder
If you want to learn C++, I don't think that the managed version is the way to go. If you want to use XNA, use it with the language it was built around - C#. If you want to learn C++, I suggest you work with a library like SFML or SDL instead.
DeanMc
DeanMc
I think you misunderstand, I essentially would like to learn both and would like to know if anyone else has followed this method.
Windryder
Windryder
Quote:
Original post by DeanMc
I think you misunderstand, I essentially would like to learn both and would like to know if anyone else has followed this method.


Oh, I didn't misunderstand. :) I am by no means an expert on XNA and its compability (if any?) with C++; I was merely trying to give you a piece of advice. Microsoft's managed C++ is not the same language as the ISO-standardized C++ - many things that a C++ programmer is expected to know, you will not learn from working in managed C++. Likewise, you'll pick up neat features and practices from managed C++ that don't translate to standard C++. In addition to that, if you learn managed C++ you won't be acquainted with the C++ standard library, which may help the day you go looking for an industry job.

If you want to use XNA, go ahead and do it with C#. Learn to program and make games, then learn C++ when and if you get serious about working as a professional game developer.
DeanMc
DeanMc
Ah I see, thanks for my reply. Its also good to know that there is a difference in C++ to what is used for windows and what is used for games!
NightCreature83
NightCreature83
Quote:
Original post by DeanMc
I think you misunderstand, I essentially would like to learn both and would like to know if anyone else has followed this method.


I personally haven't but I have created tools that use both C/C++ and C# as there are somethings you just can't do in C# (DirectInput for example).

It is a possibility but it makes your life harder then when you were doing all this in C#. You will most likely also not create native classes as you want most of your system to be able to interact with XNA, which means your classes have to be managed classes. If you want to learn C++ syntax this way that is ok, it won't however teach you stuff like templates and memory management.
DeanMc
DeanMc
So between myself and yourself in the long term it's simply more productive long term to just go with C++.
nobodynews
nobodynews
Quote:
Original post by DeanMc
So between myself and yourself in the long term it's simply more productive long term to just go with C++.
That may be true in particular situations, but it isn't necessarily true and in my opinion is generally untrue for most people.

You should learn both C# and C++ at some point. Call the time it takes to learn C++ then C# X. Call the time it takes to learn C# then C++ Y. I strongly believe that Y is less than X.

Another way to look at it: Imagine that you wanted to walk from one place to another. You get a map and you see that if you go straight to your ultimate destination the total distance is 2 miles. But there's a catch: that route involves going up a very steep hill and will even require climbing in places. It will be easy to stumble and you may even find out you have to backtrack several times because the path isn't clear.

You look at the map again and you see another path that winds up the hill at a more gradual rate and will probably be a greater distance, but the path is clearly marked and will be much easier to travel on.

You can go any route you want, but personally I'd work my way up to the first route some other time after I actually get to where I'm going. Remember, sometimes the challenge is the whole point, but usually we just want to get somewhere. So to with C++ and C#.
C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) ,

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.