Breaking

TypeScript creator: How the programming language beat Microsoft's open-source fears - ZDNet
Sep 15, 2020 5 mins, 30 secs
After initial internal Microsoft resistance, open-source TypeScript is now a go-to language for building web apps.

Microsoft's open-source programming language TypeScript – the alter ego of JavaScript but with a type system – turns 10 years old this December. .

It's grown to become a go-to language for building apps that run in the browser but back in 2010 it had to pick its way through a Microsoft company culture that was still fearful of open source. .

TypeScript co-creator Anders Hejlsberg, a Danish software engineer and technical fellow at Microsoft, describes to ZDNet the moment in 2010 when, under the then Microsoft chief Steve Ballmer, his team decided that an open-source strategy was the only way to win over JavaScript developers. .

Ballmer in 2001 called Linux a "cancer" that threatened all Microsoft's intellectual property, and in 2010 open source at Microsoft was still a prickly issue for top management. .

Ballmer, who stepped down as CEO in August 2014, has since recanted that position and today, under Microsoft CEO Satya Nadella and with a focus on the cloud, the company loves open source and owns the open-source code repository, GitHub. .

Its other major open-source projects include the popular code editor Visual Studio Code (VS Code), .NET Code, and TypeScript, a superset of JavaScript with a type system that compiles into JavaScript.

Since its official release in 2012, TypeScript has become a crucial language to front-end development for browser applications, adopted by the likes of Slack, Airbnb and of course Microsoft, which built VS Code in TypeScript.

The language now has a firm spot in the top 10 programming languages along with Java, JavaScript and Python.

As the programming language approaches its 10th anniversary, Hejlsberg recalls how Microsoft viewed anything open source with trepidation.

"TypeScript was really just an idea of, 'Let's see if we can do a little bit better for JavaScript'.

But it was really clear that the only way we're going to appeal to the JavaScript community is by being open source.

Hejlsberg's TypeScript team "had to actually run it way up the flagpole with a bunch of people who had strong opinions about what we should do here", he says, without mentioning names of any execs who might have opposed it.

But he notes that at the time, under Ballmer, Microsoft was "very ambivalent" about open source and "afraid" of it.

But as TypeScript matured and open source gained acceptance at Microsoft in its pivot from Windows to the cloud, the company would in 2014 shift TypeScript to a model of "open development" via a public repository on GitHub.

Using GitHub allowed the community of TypeScript and JavaScript developers to influence its future.

Because of that different approach, his team now has "zero distance" to its customers – the developers who use either JavaScript or TypeScript.

"There's open source in the technical sense in that you give people your source code and give away your intellectual property rights, and technically that's open source," explains Hejlsberg. .

"But then there's open development, where you actually do your entire development process in the open, which we've been doing now since TypeScript moved to GitHub in 2014." .

Today, GitHub, which Microsoft acquired in 2018 for $7.5bn, is where the TypeScript team of about 20 Microsoft engineers do all its daily work, allowing for a "closeness to our customers like nothing I've seen before".

Hejlsberg has been at Microsoft since 1996 after a stint at Borland, building the Turbo Pascal compiler.

Before the move to GitHub, Hejlsberg says TypeScript users would submit bugs or demand requests at developer conferences, but his team would take a year to deliver new features that would often miss the mark.

With Internet Explorer losing share to Google Chrome, Microsoft would later launch its Edge browser in 2015 with the open-source Chakra JavaScript engine.

Developers by then had started to build huge JavaScript apps for the browser and were struggling to write them in JavaScript, a language he says lacked key features like modules, classes, and, importantly, a type system for creating order through rules in a program. .

"A type system is one way you can reason about your code.

Google had a similar cross-compiling tool called the Google Web Toolkit (GWT), which allowed its developers to write in Java and cross-compile to JavaScript.

They could get a real IDE with project features, modules and classes and IntelliSense and statement completion, and then they could just view JavaScript as an instruction language," he says. .

Before TypeScript emerged, Microsoft was looking to turn a tool called Script Sharp into a product.

But Hejlsberg wondered if these developers were willing to "bend over that far backwards to write in JavaScript".

"Because surely you're not going to build a best-of-breed development experience for JavaScript by telling people to write in a different language," he says. ?

The key was to add a type system to the language in a way that doesn't take away all the things that made JavaScript so popular in the first place.".

Hejlsberg and company decided to build an "erasable type system" – the component that makes TypeScript a superset of JavaScriptA

"The question is really, 'Are there languages that compete with JavaScript and/or TypeScript?' Yes and no

But every language you see on these lists typically have a point of affinity

If you're going to write a web application, you're going to write it in JavaScript or TypeScript."

Like JavaScript, Microsoft TypeScript tracks the development of the ECMAScript standard and increasingly TypeScript is being developed to cater to developers who prefer plain JavaScript. 

SEE: Microsoft's TypeScript 4.0 programming language arrives: It's a big milestone

Over the past two years, the TypeScript team have focused on building TypeScript "for the people who don't want TypeScript" through improved support for type annotations in JavaScript js.doc comments. 

"Because TypeScript is a superset of JavaScript, you could also think of JavaScript as a subset of TypeScript

And that means that our entire TypeScript toolchain is perfectly happy to process JavaScript and provide all the services on top of JavaScript," says Hejlsberg. 

"In a sense, JavaScript is like TypeScript with no type annotations

And so one popular way of using JavaScript is, instead of using type annotations directly in your source code, people will put type annotations in comments (js.doc comments) and a compiler can actually derive a lot of information from those comments. 

Microsoft: Windows 10 is hardened with these fuzzing security tools – now they're open source

C++ programming language: Microsoft's VS Code extension is out with these new features

Microsoft: VS Code update gets new features with programming language TypeScript 4.0

Microsoft: Windows 10 is hardened with these fuzzing security tools – now they're open source

C++ programming language: Microsoft's VS Code extension is out with these new features

RECENT NEWS

SUBSCRIBE

Get monthly updates and free resources.

CONNECT WITH US

© Copyright 2024 365NEWSX - All RIGHTS RESERVED