Start learning C# togheter with XNA?

Started by
9 comments, last by Svante 10 years, 7 months ago

Hello!

Ive been learning C++ for some weeks and i think its pretty hard but im still learning though. If you check up on TheNewBostons video tutorials im at video 50 maybe or so. Ive also read a bit in "Sams teach yourself C++ in 21 days".

Ive read alot about that C# is easier and i think i want to change to C# togheter with XNA to make games. Im not sure though. If i shouldnt change please tell me why and so on. Well now if i should change is it completly wrong to learn the language fram scratch with XNA? Should i first just learn C# and then XNA?Can someone link me to some site or video tutorial where i can learn C#/XNA?

Advertisement

If you want to change language just because you like the XNA API more than your current tech, then perhaps you could try to find an easier graphics library for C++. Allegro or SFML are probably immediately the closest (Though neither offer hardware acceleration AFAIK).

There is also SDL (which I personally prefer even though it is more C-centric) which also has some fantastic tutorials written by lazyfoo. Check these out and it might help you to decide whether to switch or stay with C++ (http://lazyfoo.net/SDL_tutorials).

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

If you want to change language just because you like the XNA API more than your current tech, then perhaps you could try to find an easier graphics library for C++. Allegro or SFML are probably immediately the closest (Though neither offer hardware acceleration AFAIK).

There is also SDL (which I personally prefer even though it is more C-centric) which also has some fantastic tutorials written by lazyfoo. Check these out and it might help you to decide whether to switch or stay with C++ (http://lazyfoo.net/SDL_tutorials).

Ok. But C++ is pretty hard for me and i think i would like something more easy. Ive also tried out the XNA and it was alot easier. So i think i will change. So do you think i can learn C# togther with XNA or do i need to first learn C# and then XNA?

What kinds of things to you find hard about C++?

Yes, C# is by many considered an easier language for beginners. But in my opinion you should make sure you understand the basic concepts of programming before jumping into XNA, otherwise it might be hard to grasp the XNA tutorials. Unfortunately I don't know any good C# tutorials, but a google search should bring up a dozen at least

When you feel ready to jump into XNA I recommend this site: http://www.riemers.net/

(and don't listen if anyone posts an "XNA is dead" comment, although it's no longer supported by Microsoft, it's still a great learning tool and can still be used to make games)

Generally speaking,

Learn C++ and HLSL if you want to get into graphics programming and manipulating direct3d on a "lower level".

Learn C#/XNA if you want to make an actual game, while becoming a oo programmer. You can always build HLSL onto this.

Learn Unity if you just want to make a game quickly.

That said, all programming is hard in the beginning. And what you should learn, depends on what you want to do, and how quickly you want to do it.

In your case,

With C# you should have a thorough understanding variables, conditionals, loops, functions and classes (delegates, generics and lambda are in the "nice to have" category) before even contemplating moving on to XNA.

In addition, C++ requires some knowledge of the memory model. The concepts of dynamic memory allocation and pointers are vital. This is why its harder. So, if you have a good knowledge of these concepts, I wouldn't switch so late in.


Allegro or SFML are probably immediately the closest (Though neither offer hardware acceleration AFAIK).


SFML offers hardware acceleration right off the bat as long your OpenGL is running on the hardware(you have the right drivers) :D While I like SDL's features I generally prefer SFML since it is way more modular/c++/oop/whatever and easier for me to structure programs with.


Generally speaking,
Learn C++ and HLSL if you want to get into graphics programming and manipulating direct3d on a "lower level".



I don't think you should limit C++ to HLSL, especially considering the wide array of both 2d and 3d graphics libraries/engines/frameworks available. There's still OpenGL with GLSL, Allegro, SDL, SFML, Irrlicht, Ogre3D and so many more. And OOP is not just limited to C#/XNA. You can achieve that with C++ just as fine, and SFML is structured really well for OOP. Also, switching languages shouldn't be an issue. At a certain point in learning languages you can easily draw parallels between languages and it becomes progressively easier to learn new languages. Yes C++ does have to deal with memory, and C# being a managed language has the luxury to gloss over this. I don't think you should ever lock in to any language. I do however second your suggestion on Unity. It's a wonderful program and I only wish I had more time to spend learning it :P


If you check up on TheNewBostons video tutorials im at video 50 maybe or so. Ive also read a bit in "Sams teach yourself C++ in 21 days".



Like you I also started with TNB tutorials on Java but quickly after I switched over to a variety of books in several different programming languages, as while he does teach the general idea pretty well, he does not follow a lot of coding standards and his instruction can sometimes lead to some bad programming habits. If you still want to give C++ another shot I recommend reading the tutorial at cplusplus.com or at learncpp.com Those are both great resources. If you do go this route I highly recommend SFML. The documentation is absolutely wonderful, and they have great resources available. Also if you like coding tutorials, CodingMadeEasy on YouTube(as well as on his personal website) basically walks through the SFML documentation using video examples and does a pretty good job at it(though he does assume fairly strong grasp on the C++ language).

I can't say much about C# as I've had minimal exposure to it, but from what I do know I can say that the language syntax and style is very similar to Java. I can't say anything about XNA as it lies out of my area of expertise.

I don't think you should limit C++ to HLSL, especially considering the wide array of both 2d and 3d graphics libraries/engines/frameworks available. There's still OpenGL with GLSL, Allegro, SDL, SFML, Irrlicht, Ogre3D and so many more. And OOP is not just limited to C#/XNA. You can achieve that with C++ just as fine, and SFML is structured really well for OOP. Also, switching languages shouldn't be an issue. At a certain point in learning languages you can easily draw parallels between languages and it becomes progressively easier to learn new languages. Yes C++ does have to deal with memory, and C# being a managed language has the luxury to gloss over this. I don't think you should ever lock in to any language. I do however second your suggestion on Unity. It's a wonderful program and I only wish I had more time to spend learning it


First of all this just is my opinion. I'm not trying to limit C++ to anything at all. Though, I like to use it when I do "low level stuff"; making a custom direct3d rendere, interfacing with C or assembly, embedded programming, dll injecting... you get the point. When I sit down with a UML class diagram, containing hundreds of classes (maybe describing a game?) I tend to pull out the C#/.Net combo. I do admit this is a personal choice and it does reflect the fact, that I was schooled in C# and thought myself C++ on the side, acknowledging the limitations of C#/.Net in a unmanaged capacity. I know that C++ can facilitate oo programming just fine, but I do like syntactic and technological "simplicity" of C#, when I have to build bigger systems. Again, it could just be the fact, that C# was my introduction into programming. I was taught with very strict oo discipline... all the jazz; KISS, UML, design patterns and automatic garbage collection etc. Bit of a ramble there, and probably off-topic, but I think you know what I'm getting at smile.png

I don't think you should limit C++ to HLSL, especially considering the wide array of both 2d and 3d graphics libraries/engines/frameworks available. There's still OpenGL with GLSL, Allegro, SDL, SFML, Irrlicht, Ogre3D and so many more. And OOP is not just limited to C#/XNA. You can achieve that with C++ just as fine, and SFML is structured really well for OOP. Also, switching languages shouldn't be an issue. At a certain point in learning languages you can easily draw parallels between languages and it becomes progressively easier to learn new languages. Yes C++ does have to deal with memory, and C# being a managed language has the luxury to gloss over this. I don't think you should ever lock in to any language. I do however second your suggestion on Unity. It's a wonderful program and I only wish I had more time to spend learning it


First of all this just is my opinion. I'm not trying to limit C++ to anything at all. Though, I like to use it when I do "low level stuff"; making a custom direct3d rendere, interfacing with C or assembly, embedded programming, dll injecting... you get the point. When I sit down with a UML class diagram, containing hundreds of classes (maybe describing a game?) I tend to pull out the C#/.Net combo. I do admit this is a personal choice and it does reflect the fact, that I was schooled in C# and thought myself C++ on the side, acknowledging the limitations of C#/.Net in a unmanaged capacity. I know that C++ can facilitate oo programming just fine, but I do like syntactic and technological "simplicity" of C#, when I have to build bigger systems. Again, it could just be the fact, that C# was my introduction into programming. I was taught with very strict oo discipline... all the jazz; KISS, UML, design patterns and automatic garbage collection etc. Bit of a ramble there, and probably off-topic, but I think you know what I'm getting at smile.png

Haha of course! I was just adding my side to it as well to make sure the argument was balanced and so it didn't just seem like there was not particularly many reasons to pick C++ Actually, after reading this post and my conversation with you I think I'm actually going to pick up C# again and see how it goes. Of course I'm still mostly going to be working with C++ and SFML :P

You shouldn't really dive into game programming if you aren't familiar or comfortable with the language, regardless of what language that may be. There is more to C++ than learning the syntax or memory management and the worst part is when things aren't working as intended it is very easy to assume its memory related when really it could be something just as frustrating to spot as saying "if (x = y)" instead of "if (x == y)".

If you want to work at a lower gfx level in C# you can use SharpDX which is awesome and remember languages unlike some programmers actually don't mind working with multiple languages at the same time in the same project if you ever decide you want to mix things up

E- I would recommend C# first, you can include C++ in your comfort zone once you are familiar with C#

This topic is closed to new replies.

Advertisement