One Pager Cheat Sheet
- Understanding
type
systems in programming is fundamental to solving many programming exercises and challenges, and this article by Simon Drake serves as an amazing primer for language-specific interview questions. High-level languages are easier for humans to read and write, but need to be translated into machine code, which can be done through either compilation or interpretation.
- The compiler takes in the
source code
and translates it into the target language (usually machine code), potentially through an intermediary language calledassembly
. - The
source code
is translated on the fly tomachine code
when needed, to be executed, with interpreters having optimisations to reduce resource waste. - Opting for a language with an
interpreter
orcompiler
will impact the time and performance of your source code execution, with various additional complexities to consider depending on your language of choice. - Statically-typed languages will check code for errors before run-time, while dynamically-typed languages will only check when code is executed.
- Because of compile-time and run-time performance considerations,
statically typed
languages provide better run-time performance and have different executables for different architectures, whiledynamically typed
languages provide quicker set-up times and run the same code on all architectures. - A strongly-typed language is one where the programmer declares the
data-type
in advance, whereas a weakly-typed language is one where thedata-type
is determined by the input given to it.