Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Good books for learning c#?

Discussion in 'Scripting' started by surrounded001, Jul 15, 2014.

  1. surrounded001

    surrounded001

    Joined:
    May 24, 2014
    Posts:
    5
    Hello,

    I've been diving into the Unity realm lately and I absolutely love it - but I had a question. Could anyone point me in the right direction for any good books for learning C# that would apply at least somewhat to Unity. I am quite interested in making 2D games specifically and have some very light experience in programming (took a few classes in college).

    I found these on amazon.

    Programming C# 5.0
    http://www.amazon.com/Programming-5-0-Building-Applications-Framework/dp/1449320414/ref=sr_1_3?ie=UTF8&qid=1405433236&sr=8-3&keywords=c# 5.0

    Microsoft Visual C# 2013 Step by Step
    http://www.amazon.com/Microsoft-Visual-2013-Step-Developer/dp/073568183X/ref=sr_1_2?ie=UTF8&qid=1405432763&sr=8-2&keywords=c#

    I apologize in advance if I am not posting this in the right sub-forum.
     
    Last edited: Jul 15, 2014
  2. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
  3. Anti-Social Fred

    Anti-Social Fred

    Joined:
    Jul 15, 2014
    Posts:
    2
    You're not gonna like my answer (probably) but C# syntax is only part of programming in Unity. I had some C++ experience before I started with Unity / C#, but just because I knew how some pieces of code should look didn't mean I knew all of the Unity-specific / game-specific quirks such as Colliders, Lerping, Slerping, Clamping, Quaternions, Vectors, among others.

    IMHO, the best book is the Unity Scripting API, and I'm saying that after buying roughly 4 C# books. I learned syntax, but I was still lost in Unity until I understood a lot of the API.

    I CAN say though that it gets very easy to program in Unity once you're able to track down all of the Null Reference Exception errors.
     
  4. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    If all you got from 4 books is syntax then you're doing something wrong. Also - most of the other stuff you mentioned are more math related which, if you don't already know it beforehand, can be picked up on a case-by-case basis or from game-specific programming literature.
     
  5. Anti-Social Fred

    Anti-Social Fred

    Joined:
    Jul 15, 2014
    Posts:
    2
    I Might have misconstrued your message but it seemed kind of hostile. Especially when the response was toward someone is looking to learn coding specifically for the Unity environment, and the advice came from someone who was in the very same situation a few years back.

    The OP said "...C# that would apply at least somewhat to Unity" and as someone who tried to learn Unity through books alone, the main transferable skill I learned was syntax. Hence the emphasis.

    The Unity scripting API and Unity Gems were the most useful tools for me after I trudged through basic syntax errors that everyone has when they know nothing in regards to coding. Discovering design patterns holds no value if you can't even write unity-specific code because it involves classes that you've never seen before.

    Usually it's best to learn how to cook before going into a professional kitchen asking where the microwavable dinners are, is all i'm saying.

    So, as you suggested, I might have done something wrong in only picking up syntax / class design.

    Although, my books didn't include matrix math, what a quaternion is, or the relationship between Awake() Start() Update() FixedUpdate() LateUpdate() along with the many other Unity-specific methods. I went to the Unity API and Gems for all of that and I spent more time there than in my many books.

    ANYWAY.

    My suggestion:

    If you know enough coding to get by, use the API and UnityGems. Get yourself acquainted with Unity and then you'll be able to understand how to better code for projects you want instead of taking in extraneous information that may not be of any value to you initially.

    If you know almost nothing in regard to coding then I would learn the basics and then begin creating small things from there.

    If you do end up liking coding and yearning to learn more, then you can pick up a book and look at what will be most valuable to you in terms of implementation.
     
  6. crunchyoverseas

    crunchyoverseas

    Joined:
    Nov 27, 2013
    Posts:
    29
    Yeah, I'm not sure what it is, probably the programmer/nerd quotient. But there is a lot of people on here who only seem to post to try and show how smart they are and how dumb you are. I could just picture that dude pushing his taped glasses onto his nose and talking with a stereotypical nerd lisp while saying, "If all you got from 4 books is syntax then you're doing something wrong."

    Whatever, nerd. How about you shut the hell up before I stuff you in your locker...

    As far as the actual question of the original post that meganerd totally ignored, I honestly like running through examples better then books. I use books for reference but I like the live training videos and then some user videos on youtube. For example, this guy...
    Hack & Slash RPG - A Unity3D Game Engine Tutorial | BurgZerg Arcade
     
  7. surrounded001

    surrounded001

    Joined:
    May 24, 2014
    Posts:
    5
    Are you calling someone a nerd on the Unity forums? Seems a bit ironic haha.

    Anyways. Thanks for all the help, I will take a bit of each of the suggestions and try my best to wrap my head around all of this. I ended buying a book for intro to C#, and will read a bit of that along with Unity Gems and the API.
     
  8. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    My point was that syntax is not the only thing you should be gleaning from programming literature. Also - much of what you read about C# is going to be, at the very least, tangentially related to Unity. It won't teach you Unity's API of course but it will teach you how to use the language effectively and the features that are available in that language. More knowledge isn't a bad thing folks. My last point was that if you don't know anything about, say, vector math, then it's not the programming aspect of it that is confusing - it's that you don't know vector math and any API that does vector math wouldn't make sense to you.

    @crunchyoverseas Really? How old are you? In either case, nice job coming out of the woodwork to make your 7th post just to call someone a nerd in a programming forum. You're a real asset to the community.
     
    Beennn likes this.
  9. crunchyoverseas

    crunchyoverseas

    Joined:
    Nov 27, 2013
    Posts:
    29
    And you are so welcoming to new members...or a snobby elitist insider?

    "If all you got from 4 books is syntax then you're doing something wrong." <--maybe you don't get that this comes off as condescending. Or to put it another way, "Really? How old are you? Real asset to the community making a new community feel bad about not getting as much information out of something as you would..."
     
  10. crunchyoverseas

    crunchyoverseas

    Joined:
    Nov 27, 2013
    Posts:
    29
     
  11. crunchyoverseas

    crunchyoverseas

    Joined:
    Nov 27, 2013
    Posts:
    29
    How about this, let's declare a truce...I'll admit I took the nerd joke a little too far if you admit your "criticism" of Fred came off as a wee bit dickish. And that "established" members of the community sometimes overstep their criticism of newer members who, obviously, are new, and therefore in the midst of their own particular learning process but nevertheless deserve respectful discussion free of condescension and imprettylookatmeisms.

    How's that sound? #truce #bff
     
  12. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    While my tone may have not come across correctly, the criticism still stands. Search these forums for the number of threads asking what a NullReferenceException is. Or how to sort an array or list (hell - how to *use* an array or list). Or how to load data from an external file (txt, XML, etc).

    These aren't Unity-specific pieces of functionality and what you encounter sometimes is frustration from folks who have been here awhile who see these same types of questions again and again. If anything - knowing the language, at the very least, helps you to read the API documentation so that when you see this:

    public T GameObject.GetComponent<T>()

    you at least have *some* clue as to what that means. So - pardon me for jumping on someone who insinuates that reading C# specific literature is a waste of time.
     
  13. crunchyoverseas

    crunchyoverseas

    Joined:
    Nov 27, 2013
    Posts:
    29
    That's a fair
    That's a fair enough criticism, and I'm not disagreeing with that point. Just be careful with the jumping part is all I'm saying...
     
  14. Unitay26

    Unitay26

    Joined:
    Apr 20, 2014
    Posts:
    1
    How about you don't read a single book, but rather go look at Unity's tutorials, and figure out their value? :D That's what I'm doing right now, I started like a week ago. Now I just need to learn the rest...