Top 10 reasons why TypeScript will be widely adopted

Friday, October 05, 2012 gc 11 Comments

TypeScript is a new programming language launched this week by Microsoft. TypeScript is an open source JavaScript superset that adds classes, interfaces, modules, and arrow lambdas to JavaScript.

With a computer science career (or any other for that matter), it pays to pick the right technology; the one that will ultimately prevail. We invest a lot of time and energy in learning a new technology—granted it is fun—but it helps to be on target. It is easier. Companies and projects benefit as well; the development velocity increases when you pick a good technology, the approach, and business processes are simpler. Training and architecture are inherently easier. No matter the size, these matter.

Here are, in my view, the top 10 Reasons why TypeScript will be widely adopted:

#10: Works well with existing projects
TypeScript can be easily be adopted by any project that uses JavaScript today.

#9: Uses structural interfaces
Structural interfaces are automatically implemented by any object/prototype that complies structurally. This means that you can define an interface for existing JavaScript library as long as the object/prototype complies structurally; that is, it has the same properties and functions. It is powerful and practical.

#8: Generates JavaScript
TypeScript is compiled into Javascript to ensure compatibility. This means that it can instantly run in just about any browser—just needs to be ECMA Script 3 compliant.

#7: Great tool support
Even though TypeScript is at 0.8, there is great tool support especially in Visual Studio. Also, text editor support for Sublime Text, EMACS, Vim. Visual Studio IntelliSense is amazingly good for the TypeScript plug-in and the compiler is built-in.

#6: Simplicity
TypeScript has a simple design. The TypeScript compiler is written in TypeScript—an example of computational reflection—a beautiful thing. The C# compiler will only be implemented in itself in the next version. The typescript compiler is less than 25k physical lines of code excluding test cases and harness. Check it out the code out for yourself at CodePlex.

#5: Open Source
Microsoft has open-sourced the implementation and libraries. This is still in the best interest of Microsoft—internally they have large JavaScript projects to support Office, web properties that they own such as MSN, Windows 8 apps, etc. The code is available at CodePlex under an Apache 2 License.

#4: Anders Hejlsberg is involved
Anders Hejlsberg is a prominent Microsoft Fellow who co-designed several popular and commercially successful programming languages and development tools. He was the original author of Turbo Pascal and the chief architect of Delphi. Anders is the lead architect of C# and core developer on TypeScript.

I have admired Anders’ work since his first product: Turbo Pascal. Turbo Pascal, an amazing compiler and IDE, was written single handedly by Anders and it ran in less than 64k of memory. It was also lightning (turbo) fast. 

#3: TypeScript is a Javascript superset
TypeScript extends the JavaScript syntax. Any existing JavaScript program or library works with Typescript without a change. Existing frameworks such as JQuery and Node.js are full supported. In addition, type declarations are provided. You can also install via Node.js.

#2: Aligned with future JavaScript standards: ECMAScript 6
TypeScript is essentially an ECMAScript 6 bridge for us. Microsoft's aim is to get the class, interface, and module constructs added to the upcoming ECMA script 6 standard.

#1: Enables programming in the large
Introduces classes, interfaces, and modules—essential ingredients for programming in the large. JavaScript has often been criticized for not allowing programming in the large. In essence, moving us back. In my view, a great developer can produce good code in any language, but it is essential to have modules and other constructs to help with large teams.

Closing
Do not necessarily jump ship from .NET and start writing all your code in TypeScript. No doubt, we all have to write JavaScript from time-to-time and TypeScript can help improve the structure of it and increase its scale. Large scale JavaScript can be necessary for Windows 8 JavaScript/HTML apps.

This week, Scott Hanselman (@shanselman) tweeted, "he who is most likely to make declarative statements is most likely be to called a fool in retrospect." In my view, TypeScript will be widely adopted (or I am a fool). Tell me what you think?

Additional Resources
There are many ways to contribute to TypeScript: discuss the spec, write libraries, contribute to the CodePlex project, write code, submit bug reports, answer questions, learn it, provide feedback, and tell others.

TypeScript: http://www.typescriptlang.org/

Anders Hejlsberg introduction video: http://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript

TypeScript Dart vs. TypeScript comparison by a Dart team member: http://www.reddit.com/r/programming/comments/10rkd9/welcome_to_typescript/c6g37xd

It is all about elegant code: simple yet powerful—the more the better; otherwise, much less is better. Enjoy.

You Might Also Like

11 comments:

Unknown said...

Thanks for you insight...good points.

gc said...

Thank you very much Wolf.

Unknown said...

Hi Greg, I really wish TypeScript will be adopted widely by the community, I felt like meeting an old friend when I first saw the language's syntax, maybe because my background is Delphi :).

I'm quite sure I'll have TypeScript supported in the future in my live html/css/js code editor (with a Firebug-like UI), at http://liveditor.com. :)

gc said...

@Edwin I hope so too. One thing that TypeScript definitely needs to take off is better support in other tools (besides Visual Studio). The syntax--even though sugar--is pretty.

Thanks for your feedback.

Anonymous said...

Wonder why not adopt Script#

Mike.James said...

For an introduction to TypeScript see:

http://www.i-programmer.info/programming/other-languages/4884-getting-started-with-typescript.html

Patrick said...

Hi Greg, nice post !
There is a typo. It's Hejlsberg, not Hejlsburg...

gc said...

Thank you Patrick and for the catch, too.

Anonymous said...

I started coding in ActionScript 3 a few years ago to target Flash/Flex/AIR. ActionScript was based on the proposal for ECMAScript 4 which was killed by Microsoft but Adobe took forward for their own platform. IMHO ActionScript 3 is a truly beautiful language that I've loved working with (esp coming from a C# and previously a Delphi background). For me ActionScript 3 and TypeScript look incredibly alike. For me personally I don't like JS purely because of it's prototypal inheritance and functional programming which is so alien to anyone coming from "old school" languages. I have (unlike many who criticise it) learnt to use JS and have worked with it a lot over the past couple of years and have a love-hate (mostly hate!) relationship with it. So for me to have the opportunity to develop in something like AS3 but compile to JS (something which Adobe failed to deliver and have now abandoned) is an opportunity too good to miss! :OD If someone can port the Flex framework and APIs to JS/Typescript I'll be in seventh heaven.

Anonymous said...

TS is borrowing from ES6 drafts, but some of those draft proposals may not be adopted by ES6 (in favor of some alternative proposal).

So TS-isms may diverge from ES6-isms... except TS2 will likely adopt those ES6-isms when it becomes a standard, and deprecate or obsolete old TS1-isms (i.e., break code). Anders has said as much, and future compliance for "cut and paste" of bona fide ES6 code will be paramount for TypeScript moving forward.

Once the kinks in source mapping are worked out, that should make TypeScript go from "I like it, it's cool... debugging sucks" to "OMG, THIS IS FANTASTIC!"

TypeScript facilitates programming in the large, but it has some sharp edges and still requires diligence and discipline. (Keeping in mind that JavaScript was originally designed for the domain of small snippets of event handling code and DOM manipulation. It fulfills that charter extraordinarily well.)

gc said...

@anonymous Thanks for your thoughtful comment. I do wonder where things will land with ES6. Your comment helps.