Crockford asks - what is our job as developers? Most answer to write code. The business gains nothing from code, interestingly. Our job is to write BUG FREE software. Write a bunch of code that fails, the business fails, you lose your job. You are here to take a value prop and deliver it quickly and with high quality.
<blink> function in Netscape. That was about it. Now we are asked to build huge, bug free software with essentially the same loosely typed, module-less, class-less, global namespace stew. And by the way it needs to run in multiple browsers with varying levels of support and oh yes, on different versions of node.js today, and tomorrow.
Every developer should know - that code has a long, long life. If we succeed in adding value, and having a job, your code lives on and on. Cue the Titanic theme song. What starts small, gets big. We have to engineer this in early in order to save what little hair we have left.
The syntax is better and cleaner, and someday will transpile to another target. Today I transpile with :
--module AMD --target ES5 but someday I will use CJS or ES6. The code remains the same.
Object orientation is not the right answer to every software challenge, but when it fits, writing
class Foo extends Bar implements Bing is a huge timesaver and saves repeating yourself. TS writes better OO js than you ever would manually. The prototype inheritance scheme is just too hard and awkward.
Your fastest path to using TypeScript today is to rename file.js to file.ts, do an
npm install typescript and then run tsc file.ts and start seeing what is output. You can transpile in grunt or gulp or for a good baby step try Visual Studio Code and do Ctrl+Shift+B and use the TS transpile task within VSC.
@csnover is finishing up Dojo 2 in Ts, take a look https://github.com/dojo/dojo2/tree/master/src