Jump to content

  • Log In with Google      Sign In   
  • Create Account

Learning C#?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
16 replies to this topic

#1 dtg108   Members   -  Reputation: 394

Like
1Likes
Like

Posted 15 January 2013 - 10:41 AM

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.



Sponsor:

#2 yewbie   Members   -  Reputation: 665

Like
3Likes
Like

Posted 15 January 2013 - 11:02 AM

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, 15 January 2013 - 11:04 AM.


#3 dtg108   Members   -  Reputation: 394

Like
2Likes
Like

Posted 15 January 2013 - 11:16 AM

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



#4 yewbie   Members   -  Reputation: 665

Like
4Likes
Like

Posted 15 January 2013 - 11:18 AM

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:


Edited by yewbie, 15 January 2013 - 11:20 AM.


#5 Dan Mayor   Crossbones+   -  Reputation: 1712

Like
5Likes
Like

Posted 15 January 2013 - 11:34 AM

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.


Digivance Game Studios Founder:

Dan Mayor - Dan@Digivance.com
 www.Digivance.com


#6 xcacophonyx   Members   -  Reputation: 92

Like
-4Likes
Like

Posted 15 January 2013 - 03:27 PM

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.     



#7 dmreichard   Members   -  Reputation: 384

Like
4Likes
Like

Posted 15 January 2013 - 04:44 PM

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, 15 January 2013 - 04:46 PM.


#8 xcacophonyx   Members   -  Reputation: 92

Like
0Likes
Like

Posted 15 January 2013 - 09:21 PM

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.

 

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



#9 Nypyren   Crossbones+   -  Reputation: 4301

Like
0Likes
Like

Posted 15 January 2013 - 09:43 PM

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.

#10 ic0de   Members   -  Reputation: 839

Like
0Likes
Like

Posted 15 January 2013 - 10:50 PM

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.


you know you program too much when you start ending sentences with semicolons;


#11 Nypyren   Crossbones+   -  Reputation: 4301

Like
0Likes
Like

Posted 15 January 2013 - 10:58 PM

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, 15 January 2013 - 11:20 PM.


#12 ic0de   Members   -  Reputation: 839

Like
0Likes
Like

Posted 16 January 2013 - 07:07 AM

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.


you know you program too much when you start ending sentences with semicolons;


#13 dtg108   Members   -  Reputation: 394

Like
1Likes
Like

Posted 16 January 2013 - 12:07 PM

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



#14 RoyP   Members   -  Reputation: 202

Like
1Likes
Like

Posted 16 January 2013 - 12:45 PM

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


Northwest Arkansas Game Developer Group
Live in Fayetteville, Springdale, Bentonville, or Rogers?

Interested in making video games and having fun?
Check us out on Meetup.

#15 dtg108   Members   -  Reputation: 394

Like
1Likes
Like

Posted 16 January 2013 - 03:20 PM

Thanks guys!



#16 BCullis   Crossbones+   -  Reputation: 1813

Like
0Likes
Like

Posted 17 January 2013 - 01:57 PM

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.


Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#17 moneal2001   Members   -  Reputation: 607

Like
0Likes
Like

Posted 17 January 2013 - 03:40 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS