Javascript or c#?

I just wanted to know which is best for game developement, Js or C#? is it ok to use Js cause its easier?

UnityScript/Javascript is just fine. You get almost everything without having to worry about a lot of the syntax that c# requires and you’re relying on Unity’s compiler to work out some of the details for you that in c# you would have to explicitly code. Examples are changes in structs(vectors, etc) that are immutable(can not change directly) appear to be mutable in Javascript but not in c#.


var t : Transform;
t.position.x = 4.5f;

That is totally fine in javascript and unity will take care of the techincal details when compiling/building, but in c# you would need to do it a little differently.


Transform t;

Vector3 tempV3 = t.position;
tempV3.x = 4.5f;

t.position = tempV3;

or in case of inlining it.

Transform t;

t.position = new Vector3(4.5f, t.position.y, t.position.z);

Try out both, see what language you find better to work with, but even though you could say there are more rules in c#(formatting syntax, etc), it is more explicit, doesn’t hide the details and is more transferable as a language into different applications, etc.

This has also been posted many many times, in a lot of cases ending in flame wars, but there are some good thoughts in some of the posts: