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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

What should I use? Java script or C#?

Discussion in 'General Discussion' started by Theonesuperx, Nov 8, 2014.

  1. Theonesuperx

    Theonesuperx

    Joined:
    Sep 19, 2013
    Posts:
    24
    Which one should I use? Also if I use C#, would I be able to program things that I couldn't program in the other or would my game be more better?
     
  2. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    I prefer c#, if you don't have a preference I'd go for it. The alternative is Unityscript, which is not javascript like you use on the web. C# has a ton of uses outside of unity.
     
  3. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    360
  4. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
  5. Theonesuperx

    Theonesuperx

    Joined:
    Sep 19, 2013
    Posts:
    24
    Well, ok. C# it is. So where can I learn this. I am a complete Newbie. Any good site to learn C# with unity?
     
  6. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    Yeah. Lots. Books too. YouTube, Google. Any of those will bring up crap tons of content. You are literally swimming in a sea of learning material.
     
  7. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,132
  8. andmm

    andmm

    Joined:
    Nov 21, 2013
    Posts:
    37
    No 2 ways about it, c#.
     
  9. yaapelsinko

    yaapelsinko

    Joined:
    Nov 16, 2013
    Posts:
    102
    Real men do it in C++!
     
  10. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,445
  11. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    The one that you are comfortable with. Try and decide.

    When C# works out for you then preferable C#. Since that is the most used Unity language nowadays. Which puts you at the safe side. The Unity learning section is mainly written for C# nowadays. Which gives you more documenation at the tutorial side.

    When you are in big trouble to find your way into programming with using C#, then JS is still a valid choice. You miss nothing. Most Unity books are written with and for JS, means you have more documentation here in the books. And it is more forgiveable and easier to learn.

    Some special things aside, no. At least not within Unity. You can make the very same game with both languages. They will look the same, they will run in the same speed. You will not be able to say which game is made with what language without the source code.

    There are of course some differences, else it would be the same language, but they don't play a role really. Especially when you are new to programming.
     
  12. Seth-McCumber

    Seth-McCumber

    Joined:
    May 26, 2013
    Posts:
    141
    C# All the way :rolleyes:
     
  13. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    C#. There are more resources and libraries ready to use with it, and in my opinion it has better syntax and language features overall. See here for a list of differences: http://www.holoville.com/blog/?p=820

    About the libraries, Unity does let you call C# from JS and vice-versa; but it's still preferred to keep it all in one language, so that you can easily copy code between files, and not have to care about the compile order at all. As for resources, using C# helps when you need help with something online, since there are more people familiar with C# code that can help with 3D game creation issues and general good coding practices. (JavaScript syntax, as UnityScript is based on, is used more for web development, which tends to be looser and less suited for large, structured applications)
     
    Last edited: Nov 8, 2014
  14. Defero

    Defero

    Joined:
    Jul 9, 2012
    Posts:
    200
    C#, you're better off in a long run
     
  15. RJ-MacReady

    RJ-MacReady

    Joined:
    Jun 14, 2013
    Posts:
    1,718
    As opposed to taking a short trip around the block, where JavaScript would be the clear choice.
     
  16. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,150
    If only UnityScript was actual JavaScript then the answer might not be so clear cut. If you're going to use Unity, you're better off with C#. JavaScript should be learned separately as there are enough differences that it might confuse someone new.

    http://wiki.unity3d.com/index.php?title=UnityScript_versus_JavaScript
     
    Last edited: Nov 8, 2014
  17. Theonesuperx

    Theonesuperx

    Joined:
    Sep 19, 2013
    Posts:
    24
    Ok, thanks for the useful information. This will be handy for me later on.