C# or JavaScript

Hi guys,

I’m new to Unity3D and I have no previous experience in Scripting.:idea: What should I begin scripting with? C# or JS? :face_with_spiral_eyes:
Please help me guys, also give me some links to tutorials what you thing is the best.

Thanks.

I believe C# is more rewarding on the medium to long term.

However, JS is maybe a bit easier at first.

Personally, I would go with C# any time.

Actually the unity documentaction is enough for knowing the functions available in unity. for programming skills I recommend visiting w3 schools site

Do a search and have a look at all the other c# vs JS threads. This topic has beaten to death.

You can make the very same game in Unity with all three languages, in similar time. It will look the same, it will have the same performace. So the question is not what language is better, but what language is better for you. Try it out.

People really need to stop calling UnityScript JavaScript. UnityScript is NOT JavaScript. At all. The fundamental feature of JavaScript is the prototypal type system. US is JS in the same way that JS is Java.

And UnityScript is only as productive as C# if you don’t use any of the things that make C# more powerful and more productive. Even then, I’d say UnityScript will have a higher maintenance burden.

Try writing something like Smooth.Slinq in UnityScript. It’s simply not possible.

I’d consider that a bad analogy.

Unityscript is based on the ecmascript standard. This is the same standard javascript is based on (though technically ecmascript is based on javascript because javascript came first, then everyone started copying it like Microsoft’s jscript and the sort, so then it was standardized as ecmascript). Other languages also fall under ecmascript.

Javascript
JScript
Actionscript 3
QtScript
TypeScript

and many many more

It’d be better to say:

“Unityscript is Javascripit in the same way Javascript is Actionscript 3”

Java is a completely different beast. Where as US and JS are actually very closely related. US and JS are both ecmascript.

But here in lies a problem… ecmascript isn’t the commonly known name for the standard. Javascript is the commonly known name, since the first ever version was called javascript (before the standard was even created a couple years later). Everyone just knows it as javascript. Javascript is synonymous with ecmascript. So really, it’s not wrong to say US is JS… as long as you understand that there’s a difference between javascript/ecmascript the standard, and javascript the web browser scripting language.

I should also point out even more so… Internet Explorer doesn’t use javascript, it uses JScript. Mozilla and Chrome both use different implementations of ecmascript BOTH called javascript. In the browser world… javascript (mozilla) isn’t javascript (chrome), but both are javascript(the ecmascript standard).

And ALL of them aren’t javascript because javascript was the engine used in Netscape… which technically isn’t around anymore (Mozilla is netscape open-source, but the project radically diverged from the original netscape communicator 4.0 early on and has since repleced the javascript engine with various other engines that implement the ecmascript standard).

So, technically, you could kind of say NOTHING is javascript anymore.

BUT

You can go back to unityscript and say it technically isn’t ecmascript, but instead is ecmascript inspired, because it doesn’t fully implement the ecmascript standard (do note, adding syntax to it doesn’t make it not ecmascript, Actionscript heavily modifies the ecmascript syntax).

But Unity actively refers to it as javascript through out their documentation, editor, and several other places. The community by large does as well. And since the term has become very loose in its actual meaning (may it refer to the standard, or any of the various implementations that happen to share the name), it’s not really a stretch to say “sure, it’s javascript, just another kind”.

Though this just leaves room for confusion. But a confusion that existed long before unityscript even came along.

Maybe… call it javascript-like? A sub-set of c-like languages? Which are a sub-set of ALGOL languages… ? Though those diverge some.

Oh… classification… you are such a fickle beast.

unitscript is to javascript like VisualBasic is to BASIC.

The basis of that analogy is that JavaScript / ECMAScript was originally named JavaScript in order to cash in on the hype of Java, and comes from the same syntax heritage but is a completely different language at a fundamental level, including a radically different type system.

IMHO, UnityScript is / was purposefully conflated with JavaScript in order to cash in on the hype / mindshare of that language, comes from the same syntax heritage, but is a completely different language at a fundamental level, including a radically different type system.

http://www.ecma-international.org/ecma-262/5.1/#sec-4.2.1

I disagree still.

And you completely ignore the entire history of ecmascript in your argument.

And I would say that it was conflated with javascript, because it’s based on javascript.

So what do you guys say I must go to?
What language can I understand easily?

Probably just would go with us, if you’re a beginner cause you dont have to worry about types.

If so, what’s the most powerful?

Scratch that, just go with good 'ol fashioned IL. It’s the MOST powerful, beating c#, us, and boo by many magnitudes! Those don’t even stand a chance against the ultimate, IL. Plus writing in IL means no compilation!

Unityscript misses some features C# provides. So i would consider C# more powerfull. Those features are not relevant for the beginner but if you intend to stay with developing C# clearly has more to offer for you (also outside of Unity). And as learning and reading is so important for beginners be aware that Unityscript is only documented on Unitywebpages whereas C# is documented “everywhere”. So you will find way more examples tutorials tips books and information for the latter.

Edit:
also i need to add that C# is the more strict language what is an advantage in my opinion as it prevents you from erros and mistakes and the compiler helps you (hints you) when something is wrong. Unityscript did some weird stuff to me thats why i “hate” it. C# was always logical.

Beginner or not, C# is the way to go. Simple :slight_smile:

You guys do know this is nothing but a flame post.

It is a question that has been asked countless times. A quick search of the forums will find it.

Please do not respond further to this thread.

And C# misses some features that US has. So what? Some things are more comfortable in C#, some things are more comfortable in JS, some things are more comfortable in BOO.

In the end you can make the same game with all three available languages. In equal time. You win or loose nothing really.

There is none. All three languages uses the same API, the same Unity features. There is no Unity feature that you can use with C# but not with Unity’s Javascript. And a mesh doesn’t mind if it is moved around with C# code or US code or BOO.

Try the languages up to the point where you understand the concept, then decide what is better for your own needs. YOU have to work with it. Not a fanboy that tries to push you towards this or that language.

I’ll go with JS since I did some tutorials with Java.

Thanks guys for the help.

A fitting end to a thread like this… A bad decision for a completely hilarious and wrong reason.

I agree that is rather hilarious response after reading through the little back and forth there.