Unity - Script Languages

Started by
12 comments, last by Orymus3 9 years, 1 month ago

I've heard that Javascript is the easiest of the languages that Unity supports, but I was wondering what are the differences between (for example) using Javascript besides C#?, what are the pros and cons?, or does Javascript isn't able to do some task that C# does?

Please explain :) thank you in advance

Don't tell me I can't do it.

Advertisement
Unity lets you use Unityscript, which *looks* like Javascript, but is not.

Unity also lets you use C#, which is *actual* C# and not a special interpretation of it.


Beware of people that tell you that a particular language is "easy". When people say "easy" when talking about programming, they *usually* mean "easy to throw code together without thinking about writing good code" and not "easy to write good code and maintain large games".

Beware of people that tell you that a particular language is "easy". When people say "easy" when talking about programming, they *usually* mean "easy to throw code together without thinking about writing good code" and not "easy to write good code and maintain large games".

So basically... C# its better?

Don't tell me I can't do it.

Beware of people that tell you that a particular language is "easy". When people say "easy" when talking about programming, they *usually* mean "easy to throw code together without thinking about writing good code" and not "easy to write good code and maintain large games".

So basically... C# its better?

It will serve you better in the long run. Most Unity developers use c#, and by most I mean 90% or so. Plus it's a general purpose language that runs managed or native(vs 2015 .net native/IL2CPP), so you could also use it outside of Unity for anything.

Also since you are starting out you should watch these videos or else.

http://unity3d.com/learn/tutorials/modules/beginner/your-first-game

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

I've used both C# and Unityscript (and even a little Boo, which is a Python-like language in the same way that Unityscript is Javascript-like), and it's very evident that C# is the correct choice. It's better supported, the documentation is better, and it has fewer strane performance quirks.

TL;DR? Use C#.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Thank you Nypyren, EddieV223 and swiftcoder :) I will try to learn C#

Don't tell me I can't do it.

Just to add my two cents (I also much prefer C# to UnityScript and Boo, by the way): when learning C#, do not underestimate the importance of having a strong understanding of Object Oriented Programming and (arguably to a lesser degree) the .NET framework as a foundation. This can be the difference between "knowing" and "knowing enough to be dangerous".

Happy learning!

+1 to C#...

You can use proper OO Concepts with it... that will help you become a better programmer for many popular languages like Java or C++ also. Whil you will not become a Java expert from using C#, getting your head wrapped around the concept of OO usually is the biggest bump at the beginning learning any OO language, so it will be much easier learning a new OO language in the future (also seeing how much Java, C# and C++ share in other concepts and syntax because of their common roots).

One thing to keep in mind is that OO programming sometimes clashes with the Component based architecture of Unity. Unity wants to enforce you using Components, which can sometimes make it hard using proper OO Concepts.

For example, you cannot call a Constructor on a Monobehaviour, if you need to hand parameters to it at start time, you need to come up with some Init() method that you call just after instantiation of the prefab containing the behaviour or adding the behaviour to an existing gameObject. It isn't really a problem, but it breaks with OO Concepts enough to be a nuisance.

And as an OO programmer, you sometimes have the habit of creating your non behaviour classes (like small helper classes that do not need to be called by the engine) as proper OO classes, which can then lead to jarring code, where first a Monobehaviour is instanciated with Unity's own method and feed with data over an Init() method, while the helper class just below is properly instantiated with a normal C# constructor.

That doesn't make Unityscript the better choice though, at least IMO. Just keep in mind that Unity is not REALLY using a proper OO model for its own system, and C# code from other sources might not always work without proper conversion because of that.

Neither of the languages is easier or better than the other. In the context of Unity they both do the same thing. One may have a little syntactic sugar here and there whilst another may have some built in containers or utillities.

One thing you will find though like has already been mentioned above is that nearly everybody uses C# in Unity so if you look up a tutorial it will be in C#. If you download something from the asset store and want to fix it then it will be in C#.

do not underestimate the importance of having a strong understanding of Object Oriented Programming and (arguably to a lesser degree) the .NET framework as a foundation.

I'm watching a video about OOP to understand what's that :) (still have no idea what's .NET Framework)

+1 to C#...

You seem to know about this :) (OO = OOP?, Object Oriented Programing?), I'll note all you said and give it another read when I have a proper understanding of this subject, because at the moment I'm having a hard time understanding all that, but thanks again!, any useful information is always welcome

Neither of the languages is easier or better than the other.
One thing you will find though like has already been mentioned above is that nearly everybody uses C# in Unity so if you look up a tutorial it will be in C#.

Interesting :) Yea, so I guess if I do my code with C# and ran into a problem I could easily find help since most people uses it

Don't tell me I can't do it.

This topic is closed to new replies.

Advertisement