Learning C#?

Started by
15 comments, last by moneal2001 11 years, 3 months ago

Hey guys, so I've decided to learn programming, and I want my first language to be C#. I know nothing. No programming terms or anything at all about it, but I know Unity 3D supports C#, so where should I start? Remember, I know nothing, so try not to be too technical. Thanks.

My Project info: My Dev Journal: http://www.gamedev.net/blog/1571-the-life-of-a-unity-developer/
I update this more: http://forum.unity3d.com/threads/158344-Not-Dead-Enough-a-zombie-apocalypse-simulator-now-in-production!
Advertisement

Unity is its own beast, you should look into getting used to the unity interface if thats the path you want to start down.

From pretty much everything I've read on unity the unityscript (javascript) is *better than c# for people starting out (This can be argued)

That being said if you don't want to learn javascript and you really want to learn C# before you get into unity (which you should), download Microsoft Visual Studio Express (It's free) it's a very good IDE to learn C#, I also purchased a few used beginner books off of amazon and it was fairly easy to pick up.

An IDE is the program you use to write your programs. (integrated development environment)

Start with small text based c# console applications, but realistically if you are starting from ground zero, there are a ton of c# just getting started tutorials online that would also be very helpful.

To start look for a tutorial on how to setup your IDE with a new project and how to compile that project.

Then move on to figuring out how to make the program output text to the screen.

If you can get that far the next step will be trying to get input from the user.

Yes, I've download visual studio express, and I've known unity's UI for months :D. I don't know programming, but I know Unity's interface well :).

My Project info: My Dev Journal: http://www.gamedev.net/blog/1571-the-life-of-a-unity-developer/
I update this more: http://forum.unity3d.com/threads/158344-Not-Dead-Enough-a-zombie-apocalypse-simulator-now-in-production!
Yes, I've download visual studio express, and I've known unity's UI for months biggrin.png. I don't know programming, but I know Unity's interface well smile.png.

Good, may I suggest that you learn C# outside of unity, it will make it much easier.

Check out this tutorial, I watched a bit of it and it seems pretty decent, give it a shot:

">

edit: You probably want to focus more on console applications now that I actually look at this

try this one:

">

I am not personally aware of any "C# For Beginners" that actually start from a 0 programming knowledge standpoint. Seems to be the majority (if not all) reference material on C# assumes that you are coming from C++ or Java and have a general understanding of programming techniques and verbiage before getting started.

I would say that if you are trying to learn C# to learn to program with it (as in not just for Unity games but for Windows Applications, Windows Phone apps and so on as well) then you will want to start learning the basics of either C++ or Java first. Once you have a decent understanding of the basics from really any programming language it's just a matter of learning a new syntax (the way you write it) and the different API's that are available. The good news is that C++, C# and Java all use a very similar syntax, meaning that once you learn one learning any of the others is really easy. C++ is extremely difficult for a beginner and offers little to no protection from newbie mistakes. To quote a line I saw in another thread "The C++ compiler assumes that you know what your doing". This means that unless you make a really really big mistake Visual Studio will compile and run your program without warnings or errors. Unfortunately this means that all your minor newbie mistakes will cause the program to crash with little to no reason as to why. This is a good thing in the means that it will teach you to debug your work and to do error checking as you code but it will make it seem like it's a nearly impossible uphill battle.

As you get more into C# and Java the rules are a little more strict and the compilers can discover your newbie mistakes easier (giving you more concise warnings that help you from making the mistake in the first place). Also the JRE and .Net runtimes (the power behind java and C# respectively) have better chances of recovering from minor mistakes for you. Although this might lead to garbage values in your program it's more likely it won't crash as often. Anyway, back on point here. If you are simply learning C# so that you can script for Unity powered games and have little to no expectations of using it for anything else I would suggest stop and learn Unity Script instead. You will find much easier tutorials to follow that directly teaches you what you want to know.

Dan Mayor

Professional Programmer & Hobbyist Game Developer

Seeking team for indie development opportunities, see my classifieds post

C# is not a good "first language to learn." You gotta understand that C# is multi-paradigm, meaning that you can program in many different styles (functional, imperative, declarative, object-oriented etc.). By learning different languages like say, Java, C, and Scheme you get a feel for how they work differently from each other. Because C# tries to encompass all these styles, I would imagine it difficult to grasp for a beginner. I don't mean to discourage you though. I'd say just try to teach yourself general programming in a few more common and easier but different languages first.

I am not personally aware of any "C# For Beginners" that actually start from a 0 programming knowledge standpoint. Seems to be the majority (if not all) reference material on C# assumes that you are coming from C++ or Java and have a general understanding of programming techniques and verbiage before getting started.

C# is not a good "first language to learn."

I have to disagree with you both on this one. While I feel other languages especially those that are interactive such as Python are perhaps a better choice starting out, I don't believe learning C# first is a bad choice. Suggesting that one learns C++ instead of C# because of C# being multi-paradigm seems even moreso hypocritical, considering that C# confines you more than C++ does in that way.

As for the OP's question, there are plenty of beginner C# tutorials and reference material you may find doing a search query on Google. I would recommend when looking at books on Amazon you also check reviews from programmers on said particular book. Don't necessarily rely on the reviews that are posted on Amazon itself.

I will however recommend if you are just starting out that you try Python. Many will argue that it is a much simpler language (though no less powerful) than C# and I agree whole heartidly, however my primary reason for recommending it is because of it's interactive prompt. This will allow you to quickly try new things that you have learned and encourages experimentation. When learning to program you won't learn just by reading but by further experimentation, and this format works well for that. There is also an excellent free online book, http://greenteapress.com/thinkpython/thinkpython.html, which is a great introduction to Python and programming in general.

[quote name='dmreichard' timestamp='1358289886' post='5021955']
Suggesting that one learns C++ instead of C# because of C# being multi-paradigm seems even moreso hypocritical, considering that C# confines you more than C++ does in that way.
[/quote]

I did not suggest that he learn C++ instead of C#, but rather C.

A C program is nondeterministic if you forget to initialize a single variable. This alone is sufficient reason to avoid recommending it as a first programming language.
A C program is nondeterministic if you forget to initialize a single variable. This alone is sufficient reason to avoid recommending it as a first programming language.

I think you have your definition of nondeterministic wrong. C is very deterministic. The same thing will happen every time you run your program.

This topic is closed to new replies.

Advertisement