Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Unity - Script Languages

  • You cannot reply to this topic
8 replies to this topic

#1 CGXel   Members   -  Reputation: 120

Like
0Likes
Like

Posted Yesterday, 06:56 PM

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.


Sponsor:

#2 Nypyren   Crossbones+   -  Reputation: 5596

Like
1Likes
Like

Posted Yesterday, 08:01 PM

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".

#3 CGXel   Members   -  Reputation: 120

Like
0Likes
Like

Posted Yesterday, 08:05 PM

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.


#4 EddieV223   Members   -  Reputation: 1464

Like
1Likes
Like

Posted Yesterday, 08:08 PM

 

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


Edited by EddieV223, Yesterday, 08:12 PM.

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

 


#5 swiftcoder   Senior Moderators   -  Reputation: 11818

Like
2Likes
Like

Posted Yesterday, 08:11 PM

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 - Software Engineer @Amazon - [swiftcoding]


#6 CGXel   Members   -  Reputation: 120

Like
1Likes
Like

Posted Yesterday, 08:19 PM

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

 

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


#7 CasperAS14   Members   -  Reputation: 103

Like
0Likes
Like

Posted Yesterday, 10:03 PM

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!



#8 Gian-Reto   Members   -  Reputation: 2579

Like
0Likes
Like

Posted Today, 02:26 AM

+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. 



#9 Buster2000   Members   -  Reputation: 2000

Like
0Likes
Like

Posted Today, 02:58 AM

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#.







PARTNERS