title: What are the pros and cons using ES5 JavaScript for Angular 2 applications and those for using TypeScript?
body: <p>I work with Angular 1 for years now, and I'm starting to learn how to use Angular 2 instead.</p>
  
  <p>But before writing any line of code, I struggle to whether I have to use TypeScript or JavaScript.</p>
  
  <ul>
  <li><strong>What are the pros and cons using TypeScript ?</strong> </li>
  <li><strong>What are those for using plain old JavaScript ?</strong> </li>
  </ul>
  
  <p>Bonus question :</p>
  
  <ul>
  <li><strong>Is there a best practice for choosing between JavaScript and TypeScript in an Angular 2 context ?</strong></li>
  </ul>
  
  <p>I don't know TypeScript but from the few pieces of code I have seen, it seems the major features are :</p>
  
  <ul>
  <li><p>Type hinting </p></li>
  <li><p>Prototype mechanisms hidden under a most common used Class syntax. </p></li>
  </ul>
  
  <p>My first impressions after browsing the web :</p>
  
  <p><strong>Type Hinting :</strong></p>
  
  <p>I love type hinting, but I think it's a little overkill to use a new language just to add this feature and will produce more work for the devs to use libraries with loose type (from the docs, there is some ways to do this).</p>
  
  <p><strong>Class-based styntax :</strong></p>
  
  <p>What about the new class syntax (which is close to the ES6) ? The Prototypes are the most misunderstood feature of JavaScript but I think it's more important to understand how it works (to know what you really do) than simply put it aside. </p>
  
  <p>ES5 is a Prototype-based programming language so why do you want to use a pseudo Class-based programming language, which will eventually produce prototypes ? It seems weird to me.</p>
  
  <p><strong>Code generation :</strong></p>
  
  <p>The last point is about code generator. I've already used code generator in other context, and I don't really like it : in most case, a human will produce a better written code (I have taken a look to the generated js : anonymous functions, anonymous function everywhere !) and more concise (when it comes to load the generated js files in the browser the size is important to reduce loading)</p>
  
  <p><strong>To conclude :</strong></p>
  
  <p>For instance I'm not really convinced of the interest to learn TypeScript instead of sticking to ES5 JavaScript. So I would like to have feedbacks from the community to know the advantages of using TypeScript.</p>