Ironic Games - Some Serious Fun

  • HomeFun Starts Here
  • AssetsUnity Assets Reviews
  • CodingGame Development
  • CultureGaming And Lifestyle
  • About UsPlay and Code

Unity Language Dilemma. JavaScript vs C# - Which One Should I Use?.

Unity language JavaScript vs C# Dilemma

The choice of Unity Language is one of the first decisions a new developer has to make. When I started with Unity3D I wondered myself: man, do I really need to spend time learning C#, when I already know enough JavaScript and I can just power through with UnityScript? After a couple of years, I can tell you definitively:

Dear friend, if you are serious about game development in Unity, do yourself a favor and learn C#.

Which Unity language to use - JavaScript vs C#

Why? Short answer: to make your life easier later on. Sooner or later you will start to:

Which Unity language to use - JavaScript vs C# usage statistics

Percentage use of programming languages in Unity

  1. Use other people’s Unity Assets – and most of them are written in C#.
  2. Learn from and follow along tutorials – most of which implement C#.
  3. Look for answers to particular and exotic coding problems – and most of the answers and examples will be published in C#.

 

I’m not a language purist. I’ve created projects in JavaScript, PHP and C#, and I normally just look for the optimal tool for the job. I personally love the versatility of JS; on the other hand, C# is an Object-oriented programming language, which generally adds clarity at the price of complexity. Performance is practically the same with both.

However, remember that UnityScript is a proprietary language which doesn’t comply with the ECMAScript specifications. This leads to surprising results like the introduction of classes instead of using the typical (and mysterious) JS prototypes. While this and other changes are pretty neat, they often make UnityScript more similar to C# – which, you have to admit, kind of defeats the purpose of avoiding learning C#.

In the end, as soon as you get familiar with C#, you will appreciate its structure.

If JavaScript resembles a whip because of its flexibility, C# is a large battle axe.

In the beginning you might drop the heavy axe on your foot a couple of times (e.g. one of the first things you’ll do is use an Array instead of a List<T> Class), but in time the language will win you over with its organization, power and focus.

Ready to start? Unity’s learning center has an excellent introduction to scripting section here: https://unity3d.com/learn/tutorials/topics/scripting

Good luck!

P.S. For completeness sake I should mention that Unity used to support a (Python-inspired) third programming language named Boo. Poor Boo was dropped in 2014 due to a small user base. Some worry that UnityScript might follow Boo’s fate, but that’s unlikely. Even though C# is clearly favored by most Unity developers, the popularity of JS outside of Unity and its use as a low-bar entry point into the world of Unity-based games will ensure its survival and longevity in the U3D ecosystem.

Jan 8, 2017Jordan

Did you enjoy this post? Share it! :)

  • Post on Facebook
  • Tweet about it
8 years ago The Joy and Fury of Coding Gamesc#, javascript, programming language, unity, unity language2,914
Jordan

Focus on game design, development, gaming culture and freelance lifestyle.

Playmaker Overview
 Recent Posts 
  • Unity Personal vs Unity Plus vs Unity Pro vs Enterprise
  • Best Pathfinding Tools in Unity 3D
  • Visual Scripting and Unity AI
  • Unity Terrain Generators: Battle of the Four
  • Exploder: Blow Stuff Up with Style
 Ironic Games 
Dizzy
Blog about Game Design, Development, Pop Culture and a Freelance Lifestyle.
Read carefully, we take fun very seriously.
 Most Viewed Posts 
Unity Personal vs Unity Plus vs Unity Pro License Comparison
Unity Personal vs Unity Plus vs Unity Pro vs Enterprise
18,661 views
Unity Terrain Generators Featured
Unity Terrain Generators: Battle of the Four
13,847 views
2019 © Ironic Games | Terms of Use