I prefer C# easy to use and IDEs exist that have intellisense like systems. It is an imperiative language just like JavaScript and the version unity is using so not much difference there. I just really dislike dynamic typing as Javascript contains as it can lead to some time spent debugging simple type errors. Other than that think they are fairly equal in learning curve. I have never used Boo so dunno about that.
Guess one way is to look at some of the tutorials and see which one you find the easiest to pick up.
given you have C script experience, JavaScript is most likely the simplest to go as they are familiar. Unitys Javascript isn’t real javascript. Only a syntax that looks alike. Its something between JavaScript, higher capable C-Script and who knows what else
Have to disagree with the dynamic typing/slower code thing with Javascript. Type inference takes care of most of the dynamic typing. You can manually statically type everything if you want to be 100% sure, or you can just turn off dynamic typing entirely.
But yeah, C# is probably the “hardest” to pick up of the three (but really, it’s not bad). JS seems to be the forum favorite and it’s rather easy to get into. I really like Boo as a language, it’s great. Syntax like Python (no yucky braces to deal with, uses indentation to signify scope instead) and has some more of the advance language features C# does and Js doesn’t. Only downfall of using Boo in my opinion is the lack of popularity among forum members and UT staff (seems UT likes to use JS and C# for everything).
If Boos popularity has to do with its python similarity perhaps?
To me its simpler to program in Ruby and LUA than in Python, I just never got warm with that language. Even Perl was better
No, not really. It’s per-script, so if you have a particular script that you want to make sure goes as fast as possible and doesn’t use dynamic typing under any circumstances, then you can disable it by using “#pragma strict”. Otherwise you leave it on for those occasions when dynamic typing makes things easier to program and it’s not in a speed-critical script.
JavaScript (in Unity) basically means less typing. In C# everything you do requires more typing.
e.g.
“using UnityEngine;”
don’t need to type this in JavaScript, it’s understood.
“public class ActivateTrigger : MonoBehaviour {”
You name your file “ActivateTrigger.js” and this is understood (and you still need to name the file “ActivateTrigger.cs” in C#.
Basically C# is full of useless typing that conveys ZERO INFORMATION to the compiler.
Your class vars in JavaScript are public by default (“var fred = 3” is public) whereas you’ll need to type “public int fred = 3” in C#. Note that fred is an int in JavaScript whether you type “var fred = 3” or “var fred : int = 3” Again, less typing in JavaScript).
Oh in JavaScript you’ll need to type “function” whereas in C# you might only have to type “void” or something … so there’s a possible win for C#.
On the other hand, a major advantage of C# is that the capitalization convention of C# matches that of Unity and Mono (C# is a CamelCase language whereas JavaScript is a camelCase language). Mono feels like a natural extension of C# (because it is) whereas it’s slightly alien to JavaScript.
If you’ve read this far you’ll have noticed that there’s very little difference between the two and furthermore that’s pretty much all you need to know to convert C# code to JavaScript and vice versa.
… unless you do use that C# IDE, in which case C# means significantly less typing because the IDE types almost everything for you. I might be wrong, of course: Not sure if there’s something like Visual Studio for JavaScript…
As an example, I just typed:
p TAB v TAB MyNewMethod(st TAB myParam) {
Do DOWN TAB(th TAB .g TAB);
}
and Visual Studio created for me:
public void MyNewMethod(string myParam) {
DontDestroyOnLoad(this.gameObject);
}
(perfectly formatted, of course - without me even thinking about how this should be formatted )
Of course, if you use Unitron, C# is a real pain (but so is any other language, to me, including JavaScript).
Less typing but ignoring typing, less meaningless detritus.
I agree though that autocompletion for JavaScript would be nice. (Coding JavaScript in TextMate seems pretty slick, although it’s not Intellisense.)
In C# you’re typing more stuff (or having it typed for you) that doesn’t actually add any logic to the program. If you take one script and another script and look at all the code they have 100% in common that contributes nothing to make one script different from another script – that’s pollution.
It may be pollution in perspective of compiling it, but often times it may the aid clarity to the code of program. I usually find C# easier to read than Javascript
Other way around here…I find wading through the unnecessary repetition tedious and annoying, and it makes it harder for me to see at a glance what’s actually happening.
In the end, it comes down to what you work best with, how you think, how you work, and what you are actually doing.
I love C#, and really don’t like JS for several reasons, but that’s just because of how I work and what I am doing.
I do recommend, however, that people learning programming learn C# first, then move to JS if they prefer it. The reason for that, is C# forces you to design your code very well from the start and understand what’s going on behind the scenes, while JS is more forgiving in that area.
Once you get a good grasp on how things work, if you still prefer JS (or Boo) then by all means go for it.
Just my suggestion, and like a certain programming language, it won’t apply to everyone either.
Being a java developer, I started out with JS just to keep the minimal resemblance. Quickly we all went over to C# and (for me) Visual C# Express (free).
Moving an entire game over from JS to C# didnt take more than a few days, and cant really say that I want to look back.
Only issue that you will run in to is documentation being JS, so you constantly have to “translate”.