Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Learning C# (New, please help)

Discussion in 'Scripting' started by LarryWells, Jun 18, 2016.

  1. LarryWells

    LarryWells

    Joined:
    Jun 1, 2016
    Posts:
    30
    Hi, I am learning C# for Unity to get a head start on a class I am taking next year on C# but I have ran into a problem. It seems like there is just an endless amount of things to learn in MonoDevelop. Is programming memory based learning? Or is their another way that I should try learning it?

    Right now I am taking courses in Udemy, Codeacademy and reading books on C# and C# in MonoDevelop. Am I simply supposed to play a game of memory with what they are saying and constantly add to that memory?
     
  2. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    Learning the syntax is memory-based. You memorize what an if condition looks like or what a function looks like.

    That's a very, very tiny part of what programming actually is.

    Learning the syntax is like learning how to use a hammer. It's pretty easy to learn how to hit things with a hammer, or how to saw some wood in half. Or how to use a drill to drill a screw in.

    But then when it comes to building a house, you have to know more than just how to use each tool. You have to know how each piece fits together, how to make the whole structure stable and sturdy. How each system in the house works with the other systems.

    Programming is about problem solving and creativity more than simply about memory. You have to be creative enough to build things out of the pieces you have available. You have to be able to solve problems. You have to understand algorithms and how they can be used to solve problems. You have to understand how to write code that's maintainable and that performs well. You have to understand how to code in a way that minimizes bugs and makes them easy to fix when they happen.

    And as the program grows larger and larger, it becomes more and more complex.

    So, to answer your question, yes and (mostly) no. Memorize the syntax, but beyond that it's much more about how you think than how well you can remember. You have to develop a mindset for programming.
     
  3. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Programming is a lot like math.
    You learn how each piece of code or syntax interacts with others, but unless you actually practice what you are learning about, you will find it hard to commit to memory.
    So, the best way to learn any programming, is to follow along with the course you are taking, and the books you are reading.
    Simply digesting the information is not enough, you must try to apply the information you just learned about.
     
    passerbycmc and LarryWells like this.
  4. LarryWells

    LarryWells

    Joined:
    Jun 1, 2016
    Posts:
    30
    How long on average does it take before you start to feel proficient in that language and even ready to tackle more?
     
  5. Zeronutty

    Zeronutty

    Joined:
    Feb 6, 2014
    Posts:
    3
    Well that completely depends on how well you pick up the coders mind set. C# is very similar but not the same as java. Learning a new coding language at least for me is not learning the code, because I know how to code in C++ so the base coding mind set it already there, its more about learning the syntax. I would start small and set goals, so For example by making a small 2d application, then once you feel that project is completed move to a project that is the same type of thing but introduces more advance coding. So your effectively repeating the same stuff so you remember it but learning new things.

    What are you trying to make maybe I could give you a hand.
     
    LarryWells likes this.
  6. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Assuming you stick with it, you should start getting the hang of things, at least the basics, in about a month, depending on how often, and how long you work on programming.

    For me, it took a few months of serious programming practice (after getting my basics down) before I actually started digging into programming topics that I had yet to learn, and trying to figure out ways of accomplishing, or improving some bit of code, or project I was working on.

    Another thing I learned, is that trying to decipher another's code also helps teach you, as you are actively thinking about syntax, and trying to figure out what exactly the programmer is doing. Often times, this can lead to you further understanding how the language works, and how some things interact with others, as well as possibly providing you with new ways of tackling a task.

    For example, I did not work much with delegates and events, and did not understand them a whole lot until I started digging into someone's code that contained them. After studying the code, and performing research on the topic, I learned how to use events, and now have a valuable tool in my tool belt. :)

    However, I do not suggest doing this until you have a good understanding of the basics of your chosen language.
     
    LarryWells likes this.
  7. LarryWells

    LarryWells

    Joined:
    Jun 1, 2016
    Posts:
    30
    I'm not actively in need of help I just know there is alot I need to learn in the future and I don't know if I'm really on track or not. In 2 months I learned and retained how to do these things in C#:
    • Basic C# (Variables, Arithmetic, Lists and Arrays, Enums, Loops, Methods, Classes, If, etc.)
    • Using user input to influence objects
    • Create and spawn objects
    • Move and rotate objects
    • Making things happen based on trigger and collision
    • Particle effects
    • Animation calls
    • Raycasts
    • programming the camera and minimaps
    • Using mouse input to influence objects
    • Loading scenes and trasitioning levels
    • Creating in runtime
    I don't know if I am on pace or track with a normal programmer or if I am going too slow. Other than that, my main problem is memorizing all of those methods unity has as I find myself using the API reference too much or is that OK?
     
  8. LarryWells

    LarryWells

    Joined:
    Jun 1, 2016
    Posts:
    30
    Thank you for all of your help, If I could ask one more thing. Could you compile a list of basics I should know just so I can kind of see where I am at. Even if not, Thanks for all your previous help <3.
     
  9. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    Don't bother memorizing APIs. You go to the documentation when you need to, and over time you automatically memorize the ones you use enough. It's not your goal to try to. You could have the entire API memorized and every bit of syntax from C# memorized too, and it wouldn't make you a good programmer. Not even close. You can't be thinking of it in terms of memorization.

    Can you make a game? A small, simple game. You need to actually make things. The only way to learn to program is to apply knowledge and do the work. Not reading, not watching things. Not memorizing things. Not doing silly school assignments. You have to make a real application.
     
    Last edited: Jun 19, 2016
    LarryWells likes this.
  10. LarryWells

    LarryWells

    Joined:
    Jun 1, 2016
    Posts:
    30
    Ok thanks. I was worried about the API for a second. About the second part, so far I can make 3d puzzle games like B-Cubed on Cool Math Games' website and some platformers. I don't have enough AI experience to make much more than that but so far I can apply what I've learned to making things. Thanks for your help too <3. The community on Unity is so great!
     
  11. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    Well, it sounds like you're doing just fine then. That's really what it's about - making things.
     
    LarryWells likes this.
  12. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    my tutorial. check signature
     
    LarryWells likes this.
  13. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    I beg to differ on this one, I learned quite a bit from my C++ Data structures course where I had to basically create an entire list system like the one in C#, from scratch, among other things.
    So no, "silly school assignments" are quite valuable, but only if you work on them, and actually attempt to apply the lessons you learned. After all, these assignments are practice.


    @LarryWells
    As Jason said though, don't worry about memorizing the API. :p
    Only go to it when you are looking for a specific functions, or block of code to further understand how it works.

    I think that the following list pretty much rounds out the basics for C#:
    > Syntax
    > Variables, and how to use them
    > Arrays & Lists
    > If & Switch statments
    > Loops (While, do-while, for, and foreach)
    > Methods
    > Calling methods with parameters
    > Constructor methods [Edit]
    > Method Overloading
    > Classes and class composition (classes with class variables)
    > Calling methods from outside sources
    > Classes and inheritance
    > Method Overriding
    > Enums
    > Namespaces

    Basics specific to Unity:
    > Monobehaviors
    > Raycasting
    > Detecting user input
    > Detecting collisions
    > Spawning
    > manipulation of an object's transform

    If I think of anything else, I shall let you know, but for now, this is all I can think of. :)

    EDIT: Added "Constructor methods" to the C# basics list.
     
    Last edited: Jun 19, 2016
    LarryWells likes this.
  14. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    I suppose I shouldn't have said they aren't at all useful. They are useful for teaching specific concepts that you can apply to real applications - a specific algorithm, a specific approach at solving a small problem, and others.

    I guess what I meant to say is I don't think they're useful for "learning how to program". I went through course after course and never came out any better of a programmer, because I couldn't wrap my mind around the 'bigger picture' of how programming works. I had to actually start making an application to learn it.
     
    TonanBora likes this.
  15. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Yes, learning "programming logic" is a big part of learning to program, probably one of the most important parts actually.
    And like you said, you can really only learn this through experience.
     
  16. jimroberts

    jimroberts

    Joined:
    Sep 4, 2014
    Posts:
    560
    Last edited: Jun 19, 2016