Static Typing is a concept in computer science used to describe programming languages. TypeScript is a variant of JavaScript with Static Typing instead of Dynamic Typing (JavaScript has Dynamic Typing).
In this post I'm going to explain both of these concepts - my argument is that as a recruiter you will benefit from understanding from fundamental concepts like typing in programming languages because it will help you converse with hiring managers and candidates on a deeper level.
To understand typing you need to first understand data types. To understand data types you first need to understand that computer programs are essentially instructions for telling a computer what to do with data.
A variable is a named storage location for data. Data has types, or put another way, you can describe what kind of data you are storing into a variable.
What are some common types of data?
There are more types of data but we don't need to go into that. You just need to understand the basics.
Typing describes how a programming language works with data types.
It's actually that simple, but it has huge implications for how compilers work and how memory can be managed inside of programming languages.
Static Typing means when you create a variable you need to tell the computer what kind of data will be stored in it (Text, Numeric, something else...) and you can't change it after the fact.
Dynamic Typing means you don't need to tell the computer what kind of data will be stored in a variable when you create it. The types are checked as the program runs (at "runtime").
TypeScript can be thought of as JavaScript with types. Or JavaScript with static typing. Normal JavaScript is dynamically typed.
Why would people do this? Why re-do the language with types?
Because types offer a lot of advantages. It can be easier to share code and work with a larger team because the types are clearly defined. This has a sort of built-in documentation effect.
Types also eliminate whole categories of errors that can occur. For example you can multiply a number by another number... But what happens if you try to multiple a string (some text) by another string? Seems like that is impossible right? It does not make any sense. Well, you could accidentally do that in normal JavaScript.
But TypeScript will prevent you from making this mistake because it knows all of the types before you run the program.
Okay, going back to that example of multiplying a text by some other text let's see what happens.
Here is Node.js. Notice you are just allowed to do this and you get a result NaN which stands for "Not A Number". The program runs, but the result makes no sense! The "a * b" means multiply variable a by variable b. If you didn't know, in most programming languages (and Excel) "*" means multiply.
Here is that same equivalent code in TypeScript. Notice that you get red squiggly lines: the program can tell you ahead of time that this an error! You don't even have to test it or run it, you can catch it right as you write the program.
I hope that was easy to follow. Just FYI, a university computer science course might take a whole lecture or whole week to cover that information. I tried to boil it down to the basics.
What I think you should take away from this is that some languages are Static and some languages are Dynamic. There is a big difference between these two in practice and it can be a huge preference between organizations, hiring managers and programmers.
The other thing to take away is that TypeScript is basically JavaScript with static typing. JavaScript developers should be able to pick up TypeScript easily, but they may not actually want to. Part of the appeal of JavaScript is dynamic typing so make sure to ask candidates about this.