Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Why we decided to move from plain JavaScript to TypeScript for Babylon.js

DZone's Guide to

Why we decided to move from plain JavaScript to TypeScript for Babylon.js

· Java Zone
Free Resource

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

One year ago when we decided to sacrifice all of our spare time to create Babylon.js we had a really interesting discussion about using TypeScript as main development language.

At that time, TypeScript was not robust enough (even if we did some experiments) so we decided to use plain JavaScript language. But I am really excited to announce that we started the port of Babylon.js to TypeScript this weekend!

Before going further, here are some numbers you may need to correctly understand my explanations. Indeed Babylon.js is:

  • An average of 1 version per month
  • 21 contributors
  • 32 releases
  • 365 commits (one per day Smile)
  • 14000+ lines of code
  • More than 120 files of code
  • More than 200 forks
  • A bandwidth of 1TB per month for the website
  • All my spare time (I cannot even remember the last time I went to see a movie)
  • 1.3GB (Code and samples)

Let me explain you what the main reasons for this decision are.

Because it is transparent for users

TypeScript is a language that generates plain JavaScript files. The code produced follows all the JavaScript rules (the “good parts”) and thus is clean and modular (one file per class). You can export namespaces (modules) and to be honest most of the time the produced JavaScript is fairly the same as what we can do.

Developers that use Babylon.js will not be able to see the difference between previous version developed with JavaScript and new version developed using TypeScript.

Furthermore, we can reach more users who can be afraid by JavaScript. TypeScript is for instance a good way for C#, Java and all strong typed languages developers to start developing for the web.


Continue reading for 5 additional reasons to use TypeScript instead of plain JavaScript.

 

 

 

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.

Topics:

Published at DZone with permission of David Catuhe, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}