TypeScript’s popularity has been on a steady increase over the last few years and it’s one of the most promising programming languages coming into the new year.
This is 7 things you need to know about TypeScript.
Last year’s annual developer poll put it as the second most loved programming language amongst those surveyed, soaring to the seventh most used language on GitHub in just a few short years. Even Netflix has jumped on the bandwagon, announcing that all their user interface libraries would be running on TypeScript in the near future.
But why all the interest?
SO, WHAT IS IT:
WHY USE IT?
- IT’S TYPED:
- GREAT DESIGN:
The language design is what makes TypeScript relatively unique amongst its peers. It’s a clean, elegant programming language that despite taking some time to learn, is fantastic to work in – comparable to things like Go, Kotlin, and Rust.
- DEVELOPMENT SCALING:
- DEVELOPER APPROVAL:
- GOING STRONG:
Excellent features aren’t enough to make a programming language popular. Scala and CoffeeScript gained huge initial popularity before fading away into relative obscurity. This won’t be a problem for TypeScript, as its growth hasn’t halted due to widespread adoption in the software industry – with over 12 million downloads per week, a figure that is constantly increasing.
- BIG BACKING:
TypeScript is open source, and backed by Google and Microsoft – that’s 2 out of the big 4 titans of the tech industry right there. With such a massive backing, and constant development and support from these two massive companies, there’s really no reason not to make the switch to what will be the most popular programming language in the not-too-distant future.
THINGS TO LOOK OUT FOR:
- IT’S NEW:
- IT’S NOT ALL THE SAME:
Most tutorials and documentation will cover what you need to know about writing an application. The issue arises when you move on to library code – it’s a different can of worms. Getting TypeScript to work with React is significantly more complicated, and is another skillset in itself.
- DITCH THE HANDBOOK:
The official documentation is a nightmare to navigate. You’ll have a lot more joy if you seek out other resources that will help get you started faster. In particular, Shawn Wang’s React TypeScript Cheat Sheet is a godsend. Basarat’s guide to Typescript is also an excellent must read, and will hold your hand and take you through the basics.
- ASK FOR HELP:
Don’t be afraid to explore type helper libraries. Learn and leverage utility type language and methods to make your life a bit easier. Once you’ve mastered the syntax, there are powerful community-built packages to do away with the monotony of repeated code, leaving you to rely on things you’ve already defined and refactor your code.
- TOO HARD IS TOO HARD:
If you’re getting to a point where TypeScript becomes too complicated to type, then odds are you’re going to run into problems with design errors in your API. Flipping over a desk in frustration and yelling that something is impossible to type is a good indication that the syntax is too complicated, and that you should go back to the drawing board and take a look at the design of the function.
- USE TYPE GUARDS:
It might sound a bit counterintuitive, but running an extra type guard function is a pretty good idea. While you might be typing everything correctly, TypeScript can only check what you’re physically writing and not any external data coming in. A guard will capture the error quite gracefully. Also, it allows you to narrow types inside of a function.
- GENERICS ARE AWESOME:
Generics are your friend. They’re a mashup of variables and function arguments, that have been transmogrified into a type system. They can be reused after they’re defined to refer their value, and can be set to help compute something for the user down the line.
To put it simply, TypeScript is a great weapon for any programmer or developer to have in their arsenal. It’s easy to start small, learn as you go, and build up the knowledge necessary to master the more complex features.
So, don’t be afraid, embrace the moniker of novice, and give TypeScript a go. It’s pretty clear that it’s the programming language of the future, and will be adopted by more and more software and tech companies. It makes sense to move with the times, and besides – time and effort spent on expanding your skillset is never wasted.
TYPESCRIPT ENGINEER SALARIES
We’ve crunched the numbers on employee salaries in three major tech cities; San Francisco, New York City and Austin, Texas.
All our salary averages are base salary only, and don’t include startup equity or FAANG RSUs.
When it comes to software engineers specializing in TypeScript, programmers in San Francisco can expect to earn $123,000 per year with a range that extends past $150,000 per year. Their counterparts in Austin can demand an average of $114,000 with senior TypeScript coders earning up to $138,000. In the Big Apple, average base salary for Typescript programmers is an impressive $127,000 with larger salaries topping $166,000.
Kofi Group is proud to be a source of knowledge and insight into the startup software engineering world and offers a multitude of resources to help you learn more, improve your career, and help startups hire the best talent. If you are interested in learning more about what we do and how we can help you then get in touch or watch our Youtube videos for additional information.
Try our other blogs on coding, like “The 10 Top Programming Languages of All Time” or “5 Reasons Why Go Is The Best Programming Language to Learn in 2021.”