Types
摘要
In a programming language context, types are used to distinguish values that have different properties. The main reason for using types is to avoid errors: If a value is used in a context where it is expected to have a certain property, and it does not have that property, this is an error. Conceptually, it is an error even if it does not lead to an error message: It is an error in the logic of the program, just like adding apples and oranges and expecting bananas is a logical error.