Advertisement

C# books for beginners

Started by October 29, 2016 10:54 AM
1 comment, last by ZaTrox 8 years, 1 month ago

So i started learning C# from free tutorials about a month ago and i was able to learn a little bit, butttttttt it didn't really worked out for me. So now I think that it would be better if I bought myself a book that I could read and learn c# language. I would also appreciate if this book talked about unity, visual studio, android app store and other stuff like these, I do not mind buying different books about these topics but the most important one is a book from which i will be learning C#. Any suggestion?

RB Whitaker's "C# Player's Guide" is my favorite C# book. I had been programming for well over a decade and programming in C# for a couple of years when I first read it. So, it's difficult for me to say how it is for an absolute beginner. But even with my previous experience, I learned quite a bit about C# from it that I didn't already know, largely because I had gaps in my knowledge about C# due to the fact that I never "learned" C#; I just woke up one morning and started coding in it. (I had started learning VB.net because I had done VB6 before that, and I had been programming in C++ for years before that. So, it just kind of came naturally to me due to my previous experience and so I didn't learn it from a book or anywhere else other than maybe to look up syntax here and there.)

But Whitaker's book, I think, is very clearly written and easy to read while at the same time containing knowledge for all skill levels from beginner to advanced. It would be the first C# book I would recommend to anyone.

Of course, it doesn't meet any of the other criteria you gave. So, perhaps someone else has some recommendations. However, if someone really wanted to learn C#, I would say forget all that and learn it the way I did with XNA.

I think Unity is pretty awesome. But one of the things that I think is a problem with it is that it kind of encourages you not to learn anything. I only have about 6 months experience with Unity, but I already knew C# when I started Unity. From what I've seen, Unity uses it's own scripting C# like language. And so, a lot of what you need to learn there is actually unique to Unity. You might find a C# Unity book, but you're probably never going to learn C# at the same level as if you actually coded in C#, I'm afraid. Of course, maybe that's all you want to do is to learn to use Unity. So, a C# book specifically for Unity might get you what you want. You sound like you really want to learn C#.

Another factor is if you want to do 2D games or 3D games. With 2D, I would be much more inclined to do Unity and learn enough C# to get by. If you're developing for Android, you may be thinking more along the lines of 2D. With 3D things get a bit more complicated and for that I would especially recommend learning C# the hard way.

So, along with RB's book, the advice I would give my own family is to go learn XNA 3.1 if you can still find it and get it working. For learning 3D, I know of no better path. And some of the XNA 3.1 books were some of the best that I've ever read targeted for beginners. (Many of them did not get rewritten for XNA 4.0 because by that time XNA was starting to die off and Unity was really taking over, but there were probably a few good XNA 4 books too.) Of course, XNA 3.1 worked with Visual Studio 2008, I believe it was and finding the free version of that could be a real chore. I'm not sure if you can even find the XNA 3.1 download anymore. Looks like it's here. But again it installed in VS2008. Not sure if you could get it working with more recent versions, and if you could it would probably involve installing 2008 and then manually transferring all the files into something like VS2016 and setting up your own template; we did that once for XNA 4 which also expects an old version of VS.

RB's website actually has a lot of tutorials for various things C# related including just some flat out C# tutorials. I'm pretty sure he was doing XNA back in the 3.1 days, but I think he's since converted his entire site to XNA 4.0 and then eventually went to MonoGame. MonoGame is the "current" XNA. You could do that and install it with a modern version of VS. The XNA 4.0 books are probably mostly good with MonoGame; last I knew MonoGame was very close to XNA 4. There was a huge leap in the way the code was written between XNA 3.1 and XNA 4 to the point the code between the two is not really compatible, unfortunately. Microsoft claimed they did it for the future of XNA, and then promptly abandoned XNA, giving it little to no future. So, that's why I might recommend actually doing XNA 3.1 because of all the really great books on it. Another possibility is to install MonoGame (free) and go through RB's tutorials (probably starting with the C# stuff if you don't know C# very well). I've still got some intermediate to advanced XNA tutorials that would probably work with MonoGame with just a little tweaking including two projects I actually converted to MonoGame.

MonoGame, unlike XNA, will run on Android I believe, which might be another big plus for you. Everything about it is far more up to date. The only reason I hesitate to recommend it is because the best books were really written for XNA 3.1 which is quite a bit different than XNA 4 which again is a bit different from MonoGame. With experience I could probably convert between the 3 and still get use of the XNA 3.1 books using MonoGame, but someone just starting out would probably not be able to. You have to kind of get to at least an intermediate level to possibly advanced before you can reasonably convert between XNA 3.1 and the others. Using 4.0 books with MonoGame might go just fine.

But the main reason I would recommend going down this XNA/MonoGame path is because it's much more focused on actual C#. You can program in actual C# and use all the more advanced features of C# with XNA/MonoGame. Plus, unlike Unity, you have to do everything in code pretty much. So, you're getting a lot more coding practice and learning a lot more about C# than if you were in Unity learning to use their C# script.

Still, if you just want to do 2D games in Unity, this may be over-kill and maybe a Unity book on C# scripting might suffice. For 3D, the MonoGame path makes much more sense because - if you can get the knowledge out of those XNA books still - it really prepares you for DirectX 11 and C++ in a way that nothing else does. XNA/MonoGame takes you from the absolute beginner level right to the doorstep of advanced game programming as you are ready to learn it. You can use the built in sprite and model classes and build all kinds of stuff with just a few lines of code, but as you learn and grow you can start exploring vertex buffers and indices and start writing your own HLSL shaders. I strongly suspect that if you mastered XNA/MonoGame you could probably produce AAA titles with it. And yet, at the same time starting out it's accessible to the absolute beginner.

And the great thing is you could probably go through RB's C# tutorials, read his book, and with nothing more than that just jump in and start doing XNA or MonoGame and be working your way up to an advanced knowledge of C# as you "play". That's basically how I learned C#, although I was fortunate enough to get in back in the 3.1 days and read through those great 3.1 books just before 4.0 came out (which I then had to learn to do).

So, you might just install MonoGame and check it out. It's free. RB's tutorials are free too. So, you can try all that for free and be getting some experience with C# as you do it. Then maybe consider buying some of the XNA 4 books, which you might find in a bargin bin. And if that's something you want to pursue, then maybe find the XNA 3.1 books.

If you do this for a couple of years, the C# in Unity will be a lot easier if you were to then go back to Unity. It would still be different though and much of what you need to learn for Unity is actually specific to the way Unity does things in C#. I've done C# for quite awhile and there was a whole lot I had to learn about Unity scripting when I was playing around with it.

This path makes a lot more sense if you're wanting to do 3D. For 2D, some simple C# scripting would probably take you a long ways in Unity. I looked on Amazon and there are at least a couple books on Unity scripting that have been written in the last year or two. If you go that route, you probably want to make sure they teach Unity 5. I don't know that the scripting changed a lot from Unity 4, but I know there were a lot of fairly big changes between the two.

Advertisement

RB Whitaker's "C# Player's Guide" is my favorite C# book. I had been programming for well over a decade and programming in C# for a couple of years when I first read it. So, it's difficult for me to say how it is for an absolute beginner. But even with my previous experience, I learned quite a bit about C# from it that I didn't already know, largely because I had gaps in my knowledge about C# due to the fact that I never "learned" C#; I just woke up one morning and started coding in it. (I had started learning VB.net because I had done VB6 before that, and I had been programming in C++ for years before that. So, it just kind of came naturally to me due to my previous experience and so I didn't learn it from a book or anywhere else other than maybe to look up syntax here and there.)

But Whitaker's book, I think, is very clearly written and easy to read while at the same time containing knowledge for all skill levels from beginner to advanced. It would be the first C# book I would recommend to anyone.

Of course, it doesn't meet any of the other criteria you gave. So, perhaps someone else has some recommendations. However, if someone really wanted to learn C#, I would say forget all that and learn it the way I did with XNA.

I think Unity is pretty awesome. But one of the things that I think is a problem with it is that it kind of encourages you not to learn anything. I only have about 6 months experience with Unity, but I already knew C# when I started Unity. From what I've seen, Unity uses it's own scripting C# like language. And so, a lot of what you need to learn there is actually unique to Unity. You might find a C# Unity book, but you're probably never going to learn C# at the same level as if you actually coded in C#, I'm afraid. Of course, maybe that's all you want to do is to learn to use Unity. So, a C# book specifically for Unity might get you what you want. You sound like you really want to learn C#.

Another factor is if you want to do 2D games or 3D games. With 2D, I would be much more inclined to do Unity and learn enough C# to get by. If you're developing for Android, you may be thinking more along the lines of 2D. With 3D things get a bit more complicated and for that I would especially recommend learning C# the hard way.

So, along with RB's book, the advice I would give my own family is to go learn XNA 3.1 if you can still find it and get it working. For learning 3D, I know of no better path. And some of the XNA 3.1 books were some of the best that I've ever read targeted for beginners. (Many of them did not get rewritten for XNA 4.0 because by that time XNA was starting to die off and Unity was really taking over, but there were probably a few good XNA 4 books too.) Of course, XNA 3.1 worked with Visual Studio 2008, I believe it was and finding the free version of that could be a real chore. I'm not sure if you can even find the XNA 3.1 download anymore. Looks like it's here. But again it installed in VS2008. Not sure if you could get it working with more recent versions, and if you could it would probably involve installing 2008 and then manually transferring all the files into something like VS2016 and setting up your own template; we did that once for XNA 4 which also expects an old version of VS.

RB's website actually has a lot of tutorials for various things C# related including just some flat out C# tutorials. I'm pretty sure he was doing XNA back in the 3.1 days, but I think he's since converted his entire site to XNA 4.0 and then eventually went to MonoGame. MonoGame is the "current" XNA. You could do that and install it with a modern version of VS. The XNA 4.0 books are probably mostly good with MonoGame; last I knew MonoGame was very close to XNA 4. There was a huge leap in the way the code was written between XNA 3.1 and XNA 4 to the point the code between the two is not really compatible, unfortunately. Microsoft claimed they did it for the future of XNA, and then promptly abandoned XNA, giving it little to no future. So, that's why I might recommend actually doing XNA 3.1 because of all the really great books on it. Another possibility is to install MonoGame (free) and go through RB's tutorials (probably starting with the C# stuff if you don't know C# very well). I've still got some intermediate to advanced XNA tutorials that would probably work with MonoGame with just a little tweaking including two projects I actually converted to MonoGame.

MonoGame, unlike XNA, will run on Android I believe, which might be another big plus for you. Everything about it is far more up to date. The only reason I hesitate to recommend it is because the best books were really written for XNA 3.1 which is quite a bit different than XNA 4 which again is a bit different from MonoGame. With experience I could probably convert between the 3 and still get use of the XNA 3.1 books using MonoGame, but someone just starting out would probably not be able to. You have to kind of get to at least an intermediate level to possibly advanced before you can reasonably convert between XNA 3.1 and the others. Using 4.0 books with MonoGame might go just fine.

But the main reason I would recommend going down this XNA/MonoGame path is because it's much more focused on actual C#. You can program in actual C# and use all the more advanced features of C# with XNA/MonoGame. Plus, unlike Unity, you have to do everything in code pretty much. So, you're getting a lot more coding practice and learning a lot more about C# than if you were in Unity learning to use their C# script.

Still, if you just want to do 2D games in Unity, this may be over-kill and maybe a Unity book on C# scripting might suffice. For 3D, the MonoGame path makes much more sense because - if you can get the knowledge out of those XNA books still - it really prepares you for DirectX 11 and C++ in a way that nothing else does. XNA/MonoGame takes you from the absolute beginner level right to the doorstep of advanced game programming as you are ready to learn it. You can use the built in sprite and model classes and build all kinds of stuff with just a few lines of code, but as you learn and grow you can start exploring vertex buffers and indices and start writing your own HLSL shaders. I strongly suspect that if you mastered XNA/MonoGame you could probably produce AAA titles with it. And yet, at the same time starting out it's accessible to the absolute beginner.

And the great thing is you could probably go through RB's C# tutorials, read his book, and with nothing more than that just jump in and start doing XNA or MonoGame and be working your way up to an advanced knowledge of C# as you "play". That's basically how I learned C#, although I was fortunate enough to get in back in the 3.1 days and read through those great 3.1 books just before 4.0 came out (which I then had to learn to do).

So, you might just install MonoGame and check it out. It's free. RB's tutorials are free too. So, you can try all that for free and be getting some experience with C# as you do it. Then maybe consider buying some of the XNA 4 books, which you might find in a bargin bin. And if that's something you want to pursue, then maybe find the XNA 3.1 books.

If you do this for a couple of years, the C# in Unity will be a lot easier if you were to then go back to Unity. It would still be different though and much of what you need to learn for Unity is actually specific to the way Unity does things in C#. I've done C# for quite awhile and there was a whole lot I had to learn about Unity scripting when I was playing around with it.

This path makes a lot more sense if you're wanting to do 3D. For 2D, some simple C# scripting would probably take you a long ways in Unity. I looked on Amazon and there are at least a couple books on Unity scripting that have been written in the last year or two. If you go that route, you probably want to make sure they teach Unity 5. I don't know that the scripting changed a lot from Unity 4, but I know there were a lot of fairly big changes between the two.

WOW that's some effort right there, if i could i would give you a medal for writing this 'essay'. Anyway, I think that i will download MonoGame and buy that book and if i become bored of reading i will just listen to the tutorials, and since all of this is done by one person i will (hopefully) not get confused. Also, you said that you are very experienced with C#, can you tell me what kind of jobs that you did required c#? I want to know this because when i google it up, almost everything says that 'c# can be used for anything' and it feels like that its not even an answer.

This topic is closed to new replies.

Advertisement