Understanding type
systems in programming is fundamental to solving many programming exercises and challenges. This was originally published at Translation and Types on CodeTips by Simon Drake. We include this to catch folks up on this topic, as it serves as an amazing primer language-specific interview questions.
Here's Simon.
First, let's just define some concepts you'll need to be aware of before reading this article:
- Source Code: The original code the programmer writes, before any translation.
- Run-time: The time period in which your application is running.
You should also have a good understanding of what a type is.
The following three concepts are all very similar, and people get them mixed up all the time, which leads to many developers getting confused. By the end of this article, we're hoping that you'll understand all of these concepts and the differences between them.
Translation: Compiled vs Interpreted. When the source code is translated from what the programmer writes, into another language.
Type Checking: Static vs Dynamic. When the types of the application are checked.
Type Safety: Strongly-Typed vs Weakly-Typed.