• Advertisement
Sign in to follow this  

Learning C#?

This topic is 1829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Edited by yewbie

Share this post


Link to post
Share on other sites

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 :).

Share this post


Link to post
Share on other sites
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:

http://www.youtube.com/watch?v=sOPM3jFo-qQ

 

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

 

try this one:

https://www.youtube.com/watch?v=3KtlQPyRctM

Edited by yewbie

Share this post


Link to post
Share on other sites

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.     

Share this post


Link to post
Share on other sites
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.

Edited by dmreichard

Share this post


Link to post
Share on other sites

[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. 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

No. An uninitialized variable will have whatever value that previously existed in the memory address it gets assigned to. Memory is not initialized beforehand, which is one of the (minor) ways C can produce faster code than languages which initialize everything to zero.

Each time a program starts, memory is effectively random, since it has been altered by other things running on the system. If you don't initialize a variable, it starts with what is effectively random, and this may cause your program to do something TOTALLY different from the last time you ran it.

The value of the uninitialized variable comes from other processes in the same way that a threading race condition can set the value of a variable nondeterministically. A race condition is one of the textbook definitions of nondeterminism in algorithms.

C# is the complete opposite. It initializes all member variables to null/false/zero and produces compiler errors if you try to read from any uninitialized local variables. Edited by Nypyren

Share this post


Link to post
Share on other sites

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.

No. An uninitialized variable will have whatever value that previously existed in the memory address it gets assigned to. Memory is not initialized beforehand, which is one of the (minor) ways C can produce faster code than languages which initialize everything to zero.

Each time a program starts, memory is effectively random, since it has been altered by other things running on the system. If you don't initialize a variable, it starts with what is effectively random, and this may cause your program to do something TOTALLY different from the last time you ran it.

The value of the uninitialized variable comes from other processes in the same way that a threading race condition can set the value of a variable nondeterministically. A race condition is one of the textbook definitions of nondeterminism in algorithms.

C# is the complete opposite. It initializes all member variables to null/false/zero and produces compiler errors if you try to read from any uninitialized local variables.

 

This is true. But in C often your compiler/IDE will give you warnings about uninitialized variables.

Share this post


Link to post
Share on other sites

I'm going to stick with C#, for one because Unity supports it and not Python, I plan on sticking with unity :D.

Share this post


Link to post
Share on other sites

I started learning C# a few months ago using Rob Miles' C# Yellow Book.  It's a free download and it helped me get up to speed pretty quickly with C#.

 

Here's the link again ...

 

Just scroll down the page until you find the 2012 edition.

 

Hope it helps.

 

Roy

Share this post


Link to post
Share on other sites

I'll just throw a recommendation in for the "Illustrated C#" series.  I found them very approachable, moved on to the "Accelerated C#" version and keep that one around for more in-depth reference.  I refer to them as series because there keep being new printings as the language spec continues to grow, but just grab the latest and you should be good.

Share this post


Link to post
Share on other sites

OP Check out RBWhitiker's site rbwhitaker.wikidot.com .  it has online written tutorials on c# and xna.  its where i started learning c# and xna.  he also has a book on c# written for beginners as well.  it is advertized on his site.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement