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

Java-based (JDBC) data connectivity to SaaS, NoSQL, and Big Data. Download Now.

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.

 

 

 

Connect any Java based application to your SaaS data.  Over 100+ Java-based data source connectors.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}