Sign in to follow this  
JKA99

Getting Started with C#

Recommended Posts

JKA99    122
I am making the jump into programming after many, many years away from it. C# looks to be the best framework for what I am interested in doing (low-end indie games produced by a team of 2-4 people). I am getting my feet wet with the .Net side of things, but am not sure what I need to do next. Do I try to dive into a project, like a pong, just to have a true starting point, or should I aim a little higher and fight through the tougher battles? Any suggestions will be nice.

Share this post


Link to post
Share on other sites
JKA99    122
The last language that I had a handle of was C and VB. I goofed around with a very little bit of C++ but was never interested in it. In a sense, I am starting from scratch.

Share this post


Link to post
Share on other sites
freakchild    572
If you have programmed before, even if it was a long time ago then you should be able to pick up the basics of a new language easily enough providing that you have programmed similar languages in the past.

Even so, you will still need to grasp concepts related to the new language and I would recommend you either find a simple guidebook (like one of the 'in a nutshell' type or reference types) or something a little more serious depending on how you feel about the basics. This will at least let you understand the rest.

Beyond that I would suggest to choose simple applications (like pong yes) and begin programming. Also, try to find some programs you've done in other languages and replicate them. Learn the equivalent ways of doing basic algorithms and things like linked lists in the same ways. As you do, look at what other people have done and use the reference books to see if the new language has functionality that offers improvements over old technique. You'll find C# has many features like this.

This is based on my own experiences (including with C#) where I usually find if I try to read a very comprehensive language tutorial books a large number of things are obvious to me merely from reading the syntax, thus I get bored quickly and I am unable to follow them, skipping many important details in the process. I have a lack of discipline and no patience, but not everyone is like me and maybe this is not your think either. However, by jumping in with a reference book handy and trying to do something meaningful I learnt by doing instead.

As it is, I only have two C# books - C# Language Pocket Reference and C# for Programmers. The latter had examples of many things in it, not only just C# but also many .net related things. Also reading the lines of code in such examples helped me to figure out syntax and language features in a very lazy way. It's amazing how many times being lazy actually helps to code...learning things, not re-inventing the wheel and so on. Anyway, I digress.

The downside of this approach is that I learn more as a go along, making earlier programs look like a mixture of obsolete approaches based on techniques more applicable to the previous languages I knew. However I don't really see this as any different to knowing better as you learn more, which pretty much goes for learning anything in life. I'm sure I was able to walk much better as a toddler once I had got over the initial novelty, stopped wobbling around for the sake of it and took time to piece together what I actually needed to do. There was no manual or class of course, so perhaps this way of learning by doing is what comes most natural.

Share this post


Link to post
Share on other sites
cignox1    735
If you're starting from scratch then be sure to have at least the basics or not only you will never see your project finished, but might also feel frustrating by the difficulties of the task... start with something simpler, you will be satisfied anyway :-)

Share this post


Link to post
Share on other sites
Agwan    122
Hey, diving into a project is always a good way to learn how to code, it's how i learn't but it's also always a good idea to read through what you can to get a good understanding of how the language works. Pong sounds like a nice starting point and the xna creators site will help with the game side of it.

Some C# Tutorials
http://msdn2.microsoft.com/en-us/library/aa288436.aspx

Share this post


Link to post
Share on other sites
freakchild    572
Quote:
Original post by JKA99
Thanks for the help. If there are any specific books/references that you'd recommend, please pass those along.


I'll re-iterate because I edited my post to include a reference while you posted the above. You might want to look at C# for Programmers ISBN 0-13-134591-5. The first 11 chapters are a good reference for C#. I have not read this in order, just picked up what I needed. The remaining chapters cover pretty much everything else that is fundamental to C# and .net programming. There's even stuff on writing network code, multi-threading - stuff I haven't needed to date but the depth of which influenced me to buy the book.

Share this post


Link to post
Share on other sites
OremLK    154
I would suggest steering clear of C# for indie games. Were you think Managed DirectX, or XNA? Either way, I don't think it's a wise choice, because distributing .NET games particularly is very difficult in the downloadable market.

For 2D games, I would suggest looking into BlitzMax. For 3D games, I'd grab an engine in something that's not .NET-based and run with it (Ogre, Torque, Blitz3D, etc).

Share this post


Link to post
Share on other sites
daviangel    604
Try the free Petzold .net zero book.
If you find that too overwhelming or it doesn't click then try
"Head First C#" it's the best C# book I've read so far and I've read plenty!
If you read that book you'll have the foundation to start making your own games and you'll realize how useful generics is compared to the old way when you need to start using collections of your objects which you will most likely need to do when your game gets larger than the simple pong type games.

Share this post


Link to post
Share on other sites
benryves    1999
You could take a look at the GameDev.net C# Workshop.

Quote:
Original post by OremLK
I would suggest steering clear of C# for indie games. Were you think Managed DirectX, or XNA? Either way, I don't think it's a wise choice, because distributing .NET games particularly is very difficult in the downloadable market.
However, SlimDX is as simple as dropping a DLL in your project directory. [smile]

In any case, installing the runtimes can be done by simply allowing the user to download and run the redistributables via your installer script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this