Search Unity

Why is C# so hard to learn?

Discussion in 'Scripting' started by Capnarchie, May 14, 2016.

Thread Status:
Not open for further replies.
  1. Capnarchie

    Capnarchie

    Joined:
    Nov 1, 2015
    Posts:
    62
    I know that all first languages are hard but people tell me that c# is easy. ive read the tutorialspoint pdf and watched some unity documentals and alot of unity game making tutorials(third person shooter i.e), yet i dont understand anything. i know what some commands do but thats it. even if i read a pdf file to its end i dont know how to start using what ive learned.
    one problem could be cause of my english understanding but i dont belive that. and age doesnt matter also

    Any suggestions how to "properly" learn C#?
     
    Mirage-wolf likes this.
  2. xAmrxxxx

    xAmrxxxx

    Joined:
    Jan 5, 2016
    Posts:
    56
    Watch c# begginer tutorial series from Youtube channel Awful media. That's how i started
     
  3. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    C# is certainly one of the easier languages.
    The best way to learn is to
    1) Watch C# specific tutorials
    People I recommend:
    Youtube/Brackeys
    Youtube/SpeedTutor

    2) Follow along Unity Tutorials.
    People I recommend:
    Youtube/Brackeys
    Youtube/Quill18Creates
     
    SparrowGS and Kiwasi like this.
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    Are you simply reading the books and watching the videos? Or are you following along duplicating the steps with your copy of the development tools?

    Getting started may seem difficult at first but it's basically a process of (A) identifying the goals you wish to meet with your program and (B) breaking each goal down and determining the simplest steps necessary to reach them.
     
    Kiwasi likes this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    If you're thinking there's an easier language, there probably isn't. Basically the hurdle is understanding logic and building experience, not what you're typing.

    You just have to do it until it is magically understood, there aren't short cuts. It will just make more sense after a while.

    Example:

    You try to follow a tutorial or listing, and it does not work. After losing an hour, you realise the problem is { } have to be matched and you were missing one somewhere. So that's one hour of problems that will not happen again.

    This happens a lot. A lot of delays but these delays don't happen twice, you learn to see the problems, and that experience teaches you a lot about why things work and why they don't. You can't really make a short cut.

    As a beginner you will be trying to drive a car by licking the steering wheel. Eventually you learn you turn the wheel, you operate the pedals. Use the ignition :D
     
  6. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    C# is a simple language by definition. Here is the first sentence of C# Language Specification 5.0:
     
    Ryiah and lordofduct like this.
  7. Capnarchie

    Capnarchie

    Joined:
    Nov 1, 2015
    Posts:
    62
    What good is it if you don't know how to use the code without depending on tutorials?
     
  8. Capnarchie

    Capnarchie

    Joined:
    Nov 1, 2015
    Posts:
    62
    Also if someone who fairly knows C# could they tell me how long they learned it so id know what to expect estimatedly
     
  9. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,537
    I've been programming for just shy of 10 years now.

    I started with C# in 2007.

    I'm still learning new things all the time hanging out in communities like this.

    It took me about 3 months to be competent enough to explore other languages, namely Actionscript/javascript/C++.

    By the end of the year 2007 I was freelancing in Actionscript and Javascript.

    BUT, time to competence varies from person to person... I had a long background in mathematics/logics/electronic hardware repair (all my TVs from the age 8 and on were TVs I pulled from dumpsters and repaired).

    You're going to get a different experience from me most likely... but it won't be super hard. It just takes practice.

    Just accept the fact that you're going to fail the first few times... it's a given. We all don't burst out the door running. Rather instead we trip out the door and faceplant over and over until you have all the scars of learning what you're learning (I should know, I've been electricuted enough times). Get ready to pour lots of sweat, blood, and late nights fueled by redbull/coffee/mtn dew.

    But it's worth it...

    I love my career.

    I'm a kid who grew up section 8 on welfare repairing TVs in a dumpster, the son of drug addicts and F***wits, the only kid in my family with a highschool diploma (and nothing more). I'm now middle class with a great paying job who spends my time doing what I love.
     
  10. Kona

    Kona

    Joined:
    Oct 13, 2010
    Posts:
    208
    Personally I watched, read and looked at S***loads of tutorials and example projects. After that I was given advice to check out both Unity's API aswell as the C# API on msdn , the API's can be confusing at first, but the more you get comfortable with C# I'm quite sure that you'll start using the API's more aswell, since it's a great resource.

    As far as I can recall it took me about a year to learn the language well enough to be able to create something on my own without following tutorials but it's hard to say since everyone has their own learning curve and depending on the amount of time you spend coding, and learning.

    I can also recommend checking your local library for books on C# for beginners. And don't be shy to post problems you encounter in the Scripting forums or the Unity Answers board, I've noticed alot of the community members around here give plenty of support and after all, if you ask me, the best way to learn is to fail a bazillion of times. One just have to be stubborn and keep trying. :)
     
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    I have been programming for twenty years and I still occasionally refer back to tutorials (along with documentation, code samples, etc). Modern programming, especially with frameworks like that for Mono/.NET, simply has far too many aspects to memorize them all.

    Eventually you will memorize those aspects you use the most often but you will still need to read reference material and sometimes tutorials are the best form available. Especially as Unity has incomplete documentation in some spots.

    Speaking of freely available books, I love recommending the following textbook.

    http://www.robmiles.com/c-yellow-book/
     
    Last edited: May 14, 2016
    Kiwasi and TaleOf4Gamers like this.
  12. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Are you saying you never went to school and have lessons on how to speak/type English? No one can just "grasp" things without a tutor of some kind helping to explain it.
     
  13. ericbegue

    ericbegue

    Joined:
    May 31, 2013
    Posts:
    1,353
    Are you learning C# or are you learning to program?

    C# is simply a language. Once you know the fundamental elements of programming (and OOP), using C# is just a matter of syntax. The most important thing is to understand the underlying concepts.
     
  14. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    You never completely how to program, it is a ongoing process just like trying to learning to play a instrument or speak a language.

    Even people who have spent 20+ years on a language and api, still will reference the docs to see how things work.
    A good practice while you are learning is, as you come accross information try and find a way to apply it to your own project. The information will stick in your head much better by using it than it would by reading about something or watching something.

    Don't think of a tutorial of one thing, but break it down to the many steps that were used to create that end product, and how each of these things works and interacts with the other.
     
  15. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Try learning C++ as your first programming language!!! It has a higher learning curve for most people. I learned it before, and then C# has become much easier due to my general programming knowledge.

    The best, and only real way to learn a language for most people, is to dig and and use it. Wanna learn C# with Unity. Make some basic games, games that require a bit of coding. Don't worry about the graphics. Just make some games. Pong is a good start, with some basic collision detection and response, and even some AI.

    You will run into problems that you don't know how to fix. Attempt to google things, as you can likely find solutions. You can also post things on the forums, but make sure you have tried google, and make sure you present exactly what you have already done, specifically any code you have written that is not working, or at the least a good question. Also, if you don't know it yet, learn how to ask questions. There is a technique to it, that will get you better answers. It involves knowing how to describe your problem, as well as showing what you have done so far. You will far more likely get better answers if you ask good questions.
     
  16. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    That is Terrible advice, would be best for him the learn the language that applies to his end goal, which is creating a game in unity where non c++ is needed at all. Not to mention no one really needs the added complexity of c++ when learning.
    But as a counter it is way easier to learn 2nd language than it is to learn the first, but your first might as well be what is most directly applicable to what you want to do.
     
  17. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    I apologize. I wasn't very clear on that I was joking. C++ is not a good language to start with for most people(though I managed to do it). It was a sarcastic thing, trying to say "If you thought C# was hard...try C++"
     
    Kiwasi likes this.
  18. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    ah, yeah i have had many misunderstandings on the internet due to a dry sense of humour, sorry it happens.
     
    kburkhart84 likes this.
  19. ericbegue

    ericbegue

    Joined:
    May 31, 2013
    Posts:
    1,353
    Forget about C# or C++ or whatever. If you are learning to program your first language should be speudocode. And your learning hardwares should be pen and paper.
     
    hippocoder likes this.
  20. Laperen

    Laperen

    Joined:
    Feb 1, 2016
    Posts:
    1,065
    C# is a means of communicating what you want to happen in, in this case, Unity. Learning how to write stuff in C# is like any other language, knowing the specifics and quirks of the syntax. I've never experienced learning the syntax to have a big impact helping me understand how to use, again in this case, Unity.

    Majority of learning syntax for scripting falls to learning how to write variables, functions, if-statements, for loops, and classes, in the specified language. They are like the sentence structure and grammar of the language. Everything else is when you develop your vocabulary in the language, but these few remain your basics.

    Majority of learning Unity is sieving through the Documentation, API, Tutorials official or 3rd party, and forums like Unity forums, stack-overflow, and even reddit. All of this is to understand the workflow Unity wants you to use, and you can choose to go with it or fight it, both are viable options and both have its pros and cons.

    Probably all examples of using C# you've seen has been in the context of using it in Unity, which is honestly a bad place to start learning C# if not impossible for some. Those tutorials are more about how things work in Unity than to teach you how to write in C#.

    You are probably better off learning C# isolated from Unity than alongside Unity. A simple google search on learning C# led me to this wonderful site which seems promising:

    http://www.learncs.org/

    It's broken up topics into more of less the basics I mentioned (in their proper terms). It even has a simulated compiler in the site giving you an immediate environment to test your code.
     
    Last edited: May 15, 2016
    ericbegue likes this.
  21. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    @Laperen yeah think you got a really good point here. Also likely why i can find it hard to help people new to both unity and programming. Since when i came to unity i was already a experienced programmer and formally did tech art work so had a good understanding of of the type of math needed for 3d as well. The langauge doesn't matter, it is the understanding of logic and how to use it that and the understanding of the basics they all share. Data types, conditionals, loops are what you need to get a good understanding of first, with out those concepts you cant hope to understand anything else as far as programming goes.
     
  22. Elminister

    Elminister

    Joined:
    Nov 23, 2015
    Posts:
    17
    Watch a few basic tutorials then try to make something yourself. Just watching tutorials / reading is not enough. Working on a project and sticking to it is best way to learn programming. As you run into problems, you start Googling stuff, finding examples, trying out different things. Eventually, programming should 'click'.
     
  23. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    This is a common attitude amongst new programmers. And it's actually a lie that gets in your way. Decent logic and problem solving is about half a programmers skill set. The other half is knowing how to look things up.

    When I'm coding most of my time is spent on MSDN, the Unity scripting API and SO. Once I've found all the pieces to my solution, the actual typing into VS is often the shortest part of the process.

    I've been doing this for years. And I still occasionally look up something as basic as an array declaration.
     
  24. Vedrit

    Vedrit

    Joined:
    Feb 8, 2013
    Posts:
    514
    I should probably put this in my signature, since it's my go-to advice
    As I said in another thread very similar to this one:
    If you learn by doing, rather than reading, follow along some tutorials and when a new line or function is presented, google it, fiddle with it, break it, figure out how that new thing is used and how it is not used, what works with it and what doesn't. Become an expert of that line or function, then move on to the next line or function, wash, rinse, repeat.
    Don't expect to learn how to make entire and complete scripts from the get-go. You don't learn a language by forming paragraphs or books, you start with words, then putting the words together to make sentences, then sentences together to make paragraphs, and on and on.
     
    Ryiah and Kiwasi like this.
  25. vikankraft

    vikankraft

    Joined:
    Feb 25, 2016
    Posts:
    88
    Don't start with C#, start with a more low lvl languange like C or C++ then learn Java and/or C# and you will understand what people mean when they say its "easy" to learn :) I'ts because they compare it to those first languanges they learnet which usually are more low lvl.
     
  26. bustee

    bustee

    Joined:
    Jun 10, 2015
    Posts:
    11
    I never learned C#, but only Java and so far I just improvise and it works pretty much as expected. C# definitely is among the easier to learn object-oriented languages, I recon (I guess they are all pretty similar).

    What I can recommend and am doing at the moment, is to pick a tutorial on the unity side and do it, then add different things you would like to this already existing game. This makes it quite accessible, as the main setup is already there. And you can do (and should at the start) baby steps and progress within an already existing framework.

    E.g. the first thing I did was to do the survival shooter tutorial. Then I added Controller support (which took me a while, but is actually super easy). Then I spawned a second player into the game, so I could play it with a friend in co-op. Both things were really easy to accomplish, but still taught me a lot about Unity and C#.

    And the further you progress, the bigger improvements you can make, so that eventually, your game will not resemble the original at all anymore.
     
    vrpjreigna likes this.
  27. Ryan227

    Ryan227

    Joined:
    Feb 28, 2017
    Posts:
    1

    So did you figure C# out in the end?

    I'm trying to learn right now, but I really don't get it.
    I'm starting to think that coding is personality orientated.
     
  28. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    It's a skill like any other, you either put in the effort or don't. Pure logic is not natural to anyone, it is an acquired profession. I've been programming since I was 9 and still get stumped. It's not about the language, but about the logic. If you know how to program with a pencil and paper, most (reasonable) languages are trivial to figure out.

    You are trying to learn logic, syntax, and game programming all at once. Distinct, difficult, fields. When someone says a language is "easy" they are referring to automation. You don't need to do allot of the nitpicky stuff that you would need to work with on the ASM or C level. Logic, will always be difficult, but rewarding if it's something you are truly passionate about.
     
    vrpjreigna and Kiwasi like this.
  29. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    what bits aren't you getting? (much better thread than "I don't get it"... might want to start a new one though)
     
  30. smacbride

    smacbride

    Joined:
    Jan 10, 2015
    Posts:
    50
    I would highly recommend taking at a minimum a 1 semester, college level introductory course in computer programming.

    Any language should do. I started out with Fortran and Pascal back in the day.

    Like most people have said, the starting language is not important, it's understanding the basic concepts of computer logic.

    Also, I've been in it for over 30 years and still learning new things, and still looking at the manuals occasionally!
     
    hippocoder and Kurt-Dekker like this.
  31. Deleted User

    Deleted User

    Guest

    Get familiar with the visual studio debugger. Set a break point on a line of code you want to inspect, press attach to unity in VS to start the debugger, start your game up in unity and when your line of code is triggered in play, your game will freeze and the debugger will kick into action letting you step through and over your script to see where it goes. I know enough to barely get by after quite a while of practice, which is why i'm here looking for the same answer you are. All i can say is if you have a problem, use the debugger. It will be much more help to you than going into the unity3d irc channel and trying to communicate with people who are so resentful of people who self educate.
     
  32. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    If you think c# is hard. you surely don't know other languages like c++,c,objective C, assembly,...
    In these languages like c,c++, you need to manage your memory yourself but in c# you create objects so easily like eating chocolate and the garbage collector copes to release unused objects. Also a lot of things we can discuss
     
  33. ZeroX0

    ZeroX0

    Joined:
    Feb 17, 2018
    Posts:
    1
    I would advocate that you might want to start incredibly small. Avoid starting with game tutorials and start writing programs like "FizzBuzz" or "StringCalculator".

    These programs will help you become accommodated to the language, without distracting you with frameworks or APIs.

    Coding Kata's would be a great place to start learning since they are geared towards practicing the basics:
    Programming is a long term investment, and, with continued practice, you'll reach that point where you can branch out and take on more advanced projects.

    Don't get discouraged, be patient with yourself and you'll get a hang of it with time.

    **Edit: I know nothing about Unity so we're in the same boat. No matter how much you know, you'll always be a beginner at something ^^;

    **Edit2: Actually, coding katas might not be helpful. This resource might be better for beginners because it provides you everything you need to get started: The problems and their solutions:

    Programming Problems and Solutions
     
    Last edited: Feb 17, 2018
  34. navjotsingh1317

    navjotsingh1317

    Joined:
    Oct 6, 2019
    Posts:
    1
    This is what i did.

    I went online and looked at OOP Design (look at UML diagrams and how C# can be represented using UML diagrams)

    Then i wrapped my heard around what the main method did. it is literally where all of the code gets executed, i know it looks intimidating but it is literally just the starting point.

    Once i did that, i learned how to take in user input and give the user an output. This was achieved by making a simple command line application.

    Once i did this, i picked up a book about data structues and algorithms then began implementing them.

    Once i felt comforatble with that, I then dug deeper into C# itself by reading the microsoft C# api documentation and at this point i was also reading the unity API documentation.

    Then i began using unity. I was more comfortable doing the previous steps first because it made me more prepared.

    This is how i recommened anybody to try C#.
     
  35. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    I started learning C# about a year or so ago, on and off. My only previous experience was with HTML and some PHP many years ago. I'm at the point now where I am prototyping my first, fairly complex game; after many "failed" attempts initially. Alot can be learned from trial or error. Think of coding as two main principles.
    - Something you want to do
    - The simplest, most logical way to achieve.

    I know that's rather vague but thats how I approach most things. Break the simplest of tasks into pieces, and then try to write code to do those tasks

    As for learning syntax etc. it can only come from practice. I didn't find tutorials too helpful, but people learn in different ways. For me it was taking apart a script and figuring out what each individual part was doing. The unity docs and forum are great ways to learn about the many different aspects of Unity and C#
     
  36. KingXander7

    KingXander7

    Joined:
    Apr 15, 2020
    Posts:
    1
    I've been working inside of unity and C# for nearly 10 years now. I can say this about it. Knowing c# and knowing unity's c# isn't the same. It takes time, and that will never change. I recommend starting by studying what singleton is.
     
  37. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    The post you're answering to is more than 4 years old, and this thread hasn't had activity in over almost a year. Seeing that you're new in the forums, please read the rules before posting.
     
    eses and Yoreki like this.
  38. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Try to learn by sample, get easy code first that can slso be visualized in editor and move to advanced
     
  39. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Check dates before responding to old discussions Closing, necro.
     
Thread Status:
Not open for further replies.