March 2018
Beginner
616 pages
16h 53m
English
Nearly every programming language supports some idea of types. Types are important because they define the kinds of computation allowed on certain data. Take, for example, the text "hello" and the number 6. Say you want to do something like add them together:
"hello" + 6
Even someone with no prior programming experience would find this question interesting, because it’s not clear what to do. The two most obvious answers are to
To arrive at either option, you need a way to keep track of the type of your data, as well as the type of data your computation is expecting. Typically, we call the value of "hello" a String, and the value of 6 an