C# or JavaScript for development of games

Please outhere, is there someon ethat tell me which should i choose lanuguage in creating games for Unity3D in terms of:

  1. Ease of learn: Cause i am just starting to learn languages, i only know HTML language, should i choose Javascript cause i know building webpage?

  2. Deprecating bugs: I know this is a dumb category but in terms of fixing bugs, which language should i use for this?

C#

Why?

What are the pros and cons of using C# over UnityScript (apparently the actual name of JavaScript)?

#1 Community support.
#2 The majority of resources you’ll find will be C#, so best to stick with what’s more widely used.
#3 Unity does not have JavaScript, it has Unity Script which they called JS but is a hack of JS.
#4…99 JavaScript sucks (sorry, subjective, but in my opinion it’s terrible) Ignore this stupid comment, reasons 1…3 are reasons enough.

So, why did the devs create UnityScript and why is it still around if it’s that bad?

Caveat: “Ignore this stupid comment, reasons 1…3 are reasons enough.”

Who knows why, historical reasons I expect and not a question that’s worth thinking about - waste of energy. Unless you have a pressing need to use Unity Script, use C# even if it’s just for reasons 1…3 listed above.

Unity Script is not JavaScript. It’s a different thing running above a different layer.
I started on Unity with Unity Script, then changed to C# after 2 years. Unity Script It’s not bad but I can say that you should go for C#. Visual Studio is amazing and C# is a very powerful and efficient language. It’s a industry standard so you will find more places to learn and get help on it. Unity lets you use pure C# to accomplish most of things so you want to learn many aspects of .net (or Mono) like generics, lambda expressions, LINQ, anonymous types, garbage collector, events and so on.

Please don’t totally change the original post to which we already replied to, it make an absolute mess of the replies which have now lost context and look like we’re answering a different question to what you’re asking. If you want to add more info or clarify your question, post a reply or add an edit to the original post (leaving the original content there).

1 Like

Same reason that the developers haven’t immediately removed Application.LoadLevel() despite it being obsolete. There are projects that make use of it. The same holds true for the Boo language by the way as you can still manually create scripts for it and they will compile and run. It’s just not officially supported at all and that will be the eventual fate of UnityScript.

1 Like

In the early days Unity was looking to fully implement their own language. The idea was to create something like JavaScript to attract web developers.

However UnityScript only has a superficial similarity to JavaScript. Underneath it has more in common with C#.

There are a few legacy projects that still use the language. And it’s doing no harm just by existing. So there is no urgent need to pull it.

There are a bunch of reasons

  • Community support
  • Documentation
  • Portability
  • Strong typing
  • Learning material

I’m sure I could come up with more if pressed.

In the intrests of fairness the main advantage of UnityScript is a less verbose syntax. However since you can’t look up that syntax anywhere, it doesn’t really save you much time.

3 Likes