By Fobwashed 27 Comments
What the hell is this huge block of text about?
On rare occasion, I'm asked about programming and how I learned what I've learned and if I have any suggestions or whatnot so for anyone interested, here it is. This is pretty much, the process I went through, and my recommendations for anyone thinking about doing the same. I am by no means a reliable source of information, and I take no responsibility for anything resulting from this. Unless it's awesomeness, in which case, I'll take as much credit as you'll give me.
If you have absolutely no programming experience
then you're just like me when I started. I came into this knowing pretty much zilch about programming and/or any languages. The closest thing I'd ever done to coding was about 15+ years back when I "programmed" snake into my TI-86 graphic calculator by copying lines of code into it from a printed out sheet. I think that anyone can become proficient at anything as long as they invest the time. Some things will be harder for some than others but with the right commitment, short of an actual disability or physical inability, I feel anyone can do anything. Maybe not exceptionally well, but at least competently. Under this line of thinking, I took it upon myself to create a game and if you want to, you can as well. I think.
Where to begin?
There are probably as many ways to learn as there are reasons for wanting to. Also, depending on your current situation, (work, life, whatevs) your options will vary drastically. For myself, I have a full time job and can't afford to just quit and go take classes at some school. I think schools that are actually focused on teaching the art of making games are awesome, and I'd love to go, but I realistically can't. The route I took is self teaching. Once I decided that I was going to go with using the XNA framework and learn C#, it was pretty easy to find tons of tutorials and sources for learning on the internet. If you're a complete noob like myself, I'd recommend downloading Microsoft Visual Studio Express (it's free and awesome) and then running through a few basic tutorials on youtube. You'll literally start with extremely rudimentary things like getting a program to start, then saying "Hello World".
Syntax is King
Once you've tried a few tutorials and building the most basic of programs, I highly suggest actually learning the language. If you've ever tried learning a foreign language in school, learning C# is sort of like that. . . except about a hundred times easier. I know how to write, speak and understand 3 languages. 2 very well, and a third on about the level of an 8 year old -_-;; I'd say the hardest part of learning a new language is memorizing the alphabet (if it's not the same as English), followed closely by learning the grammar and syntax of the language. Finally after tackling those, it's expanding your vocabulary so that you can actually use the previous two things to USE the language. That's oversimplifying, but you get the idea. Learning C# was a piece of cake. For starters, you already know the letters and alphabet. The hardest part then becomes learning the rules of the language and how to construct sentences that make sense. Now, initially, this is pretty daunting. Everything seems like goddamn gibberish and nonsensical but as you begin to learn what's going on, you'll begin to realize it's all very clear and makes perfect sense. Everything has it's place and everything always does exactly what it's supposed to do. The entire thing breaks down into simple math, and logic. Hell, you look at any C# book, and you'll know the core of the way the language works within the first two to three chapters. After that, it's all about expanding your vocabulary.
Aside from the amazing amount of free information available on the internet, I suggest the following books. For starters, Microsoft Visual C# 2010 Step by Step by John Sharp. This book was written for people who have zero programming experience and are learning for the first time. If you can get a good grasp on the first few chapters here, you're more than half way there. A very nice side book to have that is specifically for C# is the C# Pocket Reference by Joseph Albahari. It's a pocket bible sized little book that gives the most concise and to the point description and examples of everything C#. It's basically cliff notes and I reference it a lot when I just need to remember one little thing and don't want to go searching through a huge book to find it. Also, I can carry it around and browse through it frequently so it's mighty convenient. Once you've gotten your feet wet in C# and want to start diving into making games on XNA, I suggest XNA 4.0 from O'Reilly by Aaron Reed and XNA Game Studio 4.0 Programming by Tom Miller. Both these books will sort of assume you're new to programming but won't cover C# as in depth as the previous books. They will however, get you up to speed on XNA which is pretty much, more vocabulary/words for you to use to help you build your game.
What I mean by Vocabulary
Once you know the syntax, you have the core of it. You can build out anything you want from what you have but it'll be damn difficult. That third language I know, I can survive with it, but I'd have a hard time telling a story. I'm limited by my vocabulary -_-;; It's sort of the same way with C#. The words you learn in C#, are all things built using the same tools you already have, and have code behind them that you can look at, but really, it's just giving you the result without you having to put all that work into it. Say for example, I were to tell you about this thing, that is alive, and it has a warm body temperature, and it breathes air, and has live babies. . . or I could just say mammal. It's the same thing with C#, instead of writing out something like "(int i = 0; i < list.Length; i++)", you can just write "foreach()". That's sort of a bad example but there are things that would take you lines of lines of code, that can be condensed into a single word. In fact, once you get further into it, you'll be making words of your own called objects. If there is a set of lines of code, that you'll be using more than once, you can group those lines yourself into your own word, that you can call at any time whenever you need it. All XNA is, is a book filled with words you can use that have been made to make life easier for you. That's pretty much all any framework is. C# has an extensive amount of vocabulary and even now, a year+ in, I'm still learning new words that are built into C# itself that make my life easier. A lot of times, when I learn something new, I realize I could have done something better so I'll go back and fix it and use it in the future. You never stop expanding your vocabulary either because you're learning existing words, or creating your own. It's when you start creating your own that things get really exciting =)
With all that, you're pretty much ready to make whatever it is you want. I've already blogged about how you can do anything in programming and I still think it's true. At this point, or before you reached this point, it'd be a good idea to peruse the XNA forums and also download and dissect the starter kits they have available. One of the biggest things that helped me throughout learning the language was actually using it as I was learning. If you go back to my earliest videos, you can see that I was coding as soon as I could. Start creating as soon as you can, and just keep at it while learning at the same time. You forget words you don't use -_-;; In addition, I recommend going through the forums at the XNA site for questions other people have. The community there is great and a lot of times, reading other people's questions, and the answers they receive will help you out in the longrun. Sometimes, it may not seem even remotely related to what you're currently doing, but the mechanics of it are all the same so you may figure out something else that seems to have nothing to do with the question being asked. . . that sentence doesn't make sense. Anyway, that's it.