by Tom Helvick
What is TypeScript?
TypeScript is a language from Microsoft.
Commitment to ECMA Standard
Static types are opt-in
TypeScript is known for its static typing. It’s in the name, after all. However, many devs who haven’t worked with TypeScript don’t know that the typing is optional. Therefore, you can add typing into your projects over time.
It’s simple to get started with TypeScript types. Just declare them with a colon:
var myGreeting: string;
myGreeting = “Hello World!”;
Overall, TypeScript’s types are easy to learn and fairly intuitive. Of course, many developers hate the overhead of static typing. Nevertheless, there’s a strong argument that typing prevents bugs. Implicit typing and type conversions are a common source of bugs.
When the Slack engineering team ported over their application to TypeScript, they found tons of small bugs like this. From the Slack blog:
“The more lines of code a human writes, the more inevitable it becomes to misspell a property, assume the parent of a nested object to always exist, or to use a non-standard error object.”
Another major benefit of TypeScript is the productivity tools for TypeScript developers. Since TypeScript is a Microsoft language, VS Code has lots of features built in for it. Autocomplete and linting are available on modern editors. This includes predictive and context-based code generation that make writing TypeScript much faster.
Additionally, in-line documentation can remind you of syntax or usage. Furthermore, type errors and compile bugs raise flags on the fly in the editor.
These aren’t just trivial, nice-to-have tools. Over time, the productivity gains from these features really add up.
Angular & Vue run on TypeScript
Angular’s decision to use TypeScript was a key catalyst for TypeScript’s rise. With the backing of both Microsoft and Google, it’s clear why the language is growing so rapidly.
According to RedMonk’s most recent ranking of programming languages, TypeScript sits at #12 and rising rapidly.
Founded in 1991, Intertech delivers software development consulting and IT training to Fortune 500, Government and Leading Technology institutions. Learn more about us. Whether you are a developer interested in working for a company that invests in its employees or a company looking to partner with a team of technology leaders who provide solutions, mentor staff and add true business value, we’d like to meet you.
Originally published at Intertech blog.