Introduction
Anders Hejlsberg has a lot to answer for. Perhaps not as well known as Bjarne Stroustrup (C++) or Dennis Ritchie (C), he’s responsible for the creation of Turbo Pascal, Delphi, J++, and C#. And, as the creator of the language that the majority of .NET developers have been using for the past ten years, it is fair to say that he knows a fair bit about language design.
October 1, 2012 heralded the start of the journey for another Hejlsberg creation. TypeScript is a superset of JavaScript that brings to it an additional object-oriented-like syntax familiar to .NET programmers that compiles down into JavaScript that any browser can run today. As I write this three weeks since its announcement, it’s interesting to see how, with hindsight, the loudest reactions have been, “Why do we need this?” or “Not in my backyard,” and so on—the naysayers getting their dimes’ worth before this Friday, when Windows 8 is officially launched and they can copy and paste the same reactions back into their slightly revised pieces about the new touch interface that isn’t called Metro. Now that the dust has settled, my personal favorite response to all the initial negativity was simply, “But this is Anders.”
TypeScript is an interesting project, considering the forces that will work at it and the target at which it is aimed.
It’s inevitably a well-timed boost for the development of Windows 8 applications using HTML and JavaScript rather than C# and XAML, or a hybrid approach between the two for lack of JavaScript structure.
How TypeScript is allowed to evolve will be interesting. In the meantime, we have the initial v0.8.x releases that this book targets. It covers the following:
Who Is This Book For?
This book is for .NET and JavaScript developers who want to get a head start incorporating TypeScript into their applications. I explain the tools and language features you need to get up to speed quickly and also the current, soon to be ex-limitations of TypeScript as it makes its way toward a version 1.0 release.
What Do You Need to Know Before You Read This Book?
You need a good knowledge of an object-oriented language such as C#, ideally from creating ASP.NET web applications or Windows 8 applications. TypeScript tooling is, in the main, based on Visual Studio, so a familiarity with that would also be good.
You also need a basic familiarity with JavaScript, but advanced JavaScript skills are not necessary.
What Software Do You Need for This Book?
Technically, you don’t need anything more than a text editor such as Notepad to write TypeScript applications. However, to take full advantage of the tooling that exists, you’ll need a copy of a non-Express version of Visual Studio 2012. If you don’t have access to that, there is support for Visual Studio 2012 Express for Web and also for Sublime Text 2, Vim, and eMacs, which are all free downloads.
You’ll learn where to download and how to install TypeScript in Chapter 1.
What Is the Structure of the Book?
This is a primer to get you started on TypeScript. As TypeScript is at such an early stage in its adoption and development, this book does not aim to be a comprehensive tutorial and focuses instead on the three key topics that you’ll need to consider in order to determine whether you’ll want to start using TypeScript now, and if so, how to do it:
18.189.171.153