I use javascript, but i'm not a programmer or anything. I also came in with some prior experience with javascript, back when the entire documentation was all in js. There is some functionality missing from js that C# has and boo might have(?). Practically no one seems to use boo though, so it's a bit harder to find support and snippets.
C# is probably the "best" language, since that's what everything ends up as internally anyway, but javascript is probably easier to pick up.
I was pumped to use C#, but after trying to get stuff done quickly and seeing a ton of JS examples, I've only been using. I think I'll switch for my next project though.
I used to use Unityscript but now I would definitely recommend C#. Unityscript might be slightly easier to learn but the only advantage it has is dynamic typing. You can pretty much do dynamic typing in C# too by casting to Object. C# also has some really nice features that Unityscript doesnt like variable accessors (get and set functions for variables).
Also the intellisense thingy for MonoDevelop doesnt work very well with Unityscript.
actually i use boo as i was more used to the python like syntax, worked out pretty good so far. as not many seem using it, its a bit sad that there is not so much ready to use code around, but most of the time its quite easy to convert from c# to boo.
im thinking about switchting back to c# - but im quite happy for now with boo.
C#! Very clean language and very easy to learn. And then there's this badass stuff like events and delegates, LINQ, Generics (although you can use those as well in UScript I think), etc...
I've been using UnityScript (JavaScript) for my stuff but I kinda wish I'd started with C# - there's lots more examples of regular C# code around the place that you can use.
I've been using unityscript as well because I already had experience in javascript. I also like the speed and that I don't have to be very strict and can be a bit messy . If I would switch to C#, what would be the big wins? I've been trying to figure that out, I guess I just need to try it.
Talon: C# isn't all that different imho. Especially if you have a background in C or Javascript. I always thought of it as a type-safe version of Javascript.
Granted, some of the LINQ and Lambda syntax can be a bit daunting, but you get used to it.
Speed-wise, uscript scripts compile to a mono/.NET assembly, and so do the C# scripts, so I reckon performance will be pretty much equal. Although I have never really tested this. So don't take my word for it.
For me personally, C# leverages you to be more considerate about what you write, how you use it and when. Due it's much less forgiving nature then Unityscript. I think this holds you somewhat back from getting super messy code really fast, although that entirely depends on the person. I myself am very prone to write messy code so I prefer statically typed languages because it makes me think before I put something down.
There's also the much better access to delegates, generics, reflection and most importantly events. The latter is VERY important for game dev imho. Especially in a component driven model such as Unity where dependencies can become a real hurdle.
And if you tend to use SendMessage a lot, it's actually a good idea to start checking out .NET type events. As SendMessage uses Reflection, which is a bad idea if you're pushing a lot of those to a lot of GameObjects all the time.
You can also use the more traditional OO methods of abstract classes, interfaces, virtuals, statics, etc...
And then there's also the tools. I absolutely despise MonoDevelop because it makes my poor little macbook slow down to a grinding halt, but Visual Studio (Express) is an absolute godsend. But that's a personal preference, what is important is that you have auto completion so you don't need to constantly have the docs on hand to see what a particular method is called, what parameters it takes and what it returns. And the auto error checking is an absolute must if you want to be productive. The time I've lost fixing Javascript syntax errors is beyond retarded. This may sound stupid, and the more seasoned programmers will mock me for this, but a good IDE is imperative to being productive with code imho.
Auto completion is just a hell lot harder in a dynamic language like Javascript or uscript or whatever. I've still yet to find a really good Javascript editor.
c# may be a little more daunting but the Intelisense more than makes up for it. good autocompletion and typed variables remove a massive number of potential bugs from your code.
I believe you can only do proper hash tables in C# correct? There is a hacked version you could do in Java as well but not as efficiently. Correct me if I'm wrong.
Since the performance is the same regardless of what scripting language you use (This has been officially confirmed AFAIK) I usually just use Unityscript (Javascript) since most Unity examples are in javascript.
I believe you can only do proper hash tables in C# correct? There is a hacked version you could do in Java as well but not as efficiently. Correct me if I'm wrong.
Nah, I'm using regular hashtables in Unity using Unityscript.
Just add #pragma strict at the top of your .js scripts to switch off dynamic typing. Voila, easy to debug unityscript.
I'm learning C# coming from an as3 background though, since it seems like a more generally useful language overall. Only so much room in my poor artist brain for computer languages.
Replies
C# is probably the "best" language, since that's what everything ends up as internally anyway, but javascript is probably easier to pick up.
Also the intellisense thingy for MonoDevelop doesnt work very well with Unityscript.
im thinking about switchting back to c# - but im quite happy for now with boo.
I find the US syntax a lot simpler, though.
Granted, some of the LINQ and Lambda syntax can be a bit daunting, but you get used to it.
Speed-wise, uscript scripts compile to a mono/.NET assembly, and so do the C# scripts, so I reckon performance will be pretty much equal. Although I have never really tested this. So don't take my word for it.
For me personally, C# leverages you to be more considerate about what you write, how you use it and when. Due it's much less forgiving nature then Unityscript. I think this holds you somewhat back from getting super messy code really fast, although that entirely depends on the person. I myself am very prone to write messy code so I prefer statically typed languages because it makes me think before I put something down.
There's also the much better access to delegates, generics, reflection and most importantly events. The latter is VERY important for game dev imho. Especially in a component driven model such as Unity where dependencies can become a real hurdle.
And if you tend to use SendMessage a lot, it's actually a good idea to start checking out .NET type events. As SendMessage uses Reflection, which is a bad idea if you're pushing a lot of those to a lot of GameObjects all the time.
You can also use the more traditional OO methods of abstract classes, interfaces, virtuals, statics, etc...
And then there's also the tools. I absolutely despise MonoDevelop because it makes my poor little macbook slow down to a grinding halt, but Visual Studio (Express) is an absolute godsend. But that's a personal preference, what is important is that you have auto completion so you don't need to constantly have the docs on hand to see what a particular method is called, what parameters it takes and what it returns. And the auto error checking is an absolute must if you want to be productive. The time I've lost fixing Javascript syntax errors is beyond retarded. This may sound stupid, and the more seasoned programmers will mock me for this, but a good IDE is imperative to being productive with code imho.
Auto completion is just a hell lot harder in a dynamic language like Javascript or uscript or whatever. I've still yet to find a really good Javascript editor.
c# may be a little more daunting but the Intelisense more than makes up for it. good autocompletion and typed variables remove a massive number of potential bugs from your code.
http://robotduck.wordpress.com/2009/11/04/88/
http://www.youtube.com/user/BurgZergArcade#grid/user/E5C2870574BF4B06
http://www.walkerboystudio.com/html/unity_training___free__.html#unity3game2
http://www.youtube.com/user/Luciotsampacabelo#grid/user/AA4177C28BC55C2A
Not a big difference, but I like the more clearer code that C# forces you write.
I'm learning C# coming from an as3 background though, since it seems like a more generally useful language overall. Only so much room in my poor artist brain for computer languages.