Introduction to Functional Programming in Scheme
- slide 9 : 49
Types
Types are used to make programs
more readable
, make them run
more efficient
, and to
detect certain errors
before they cause errors in the calculation.
Readability
Explicitly typed variables, parameters and function serve as important
documentation
, which enhances the program understanding.
Efficiency
Knowledge of the properties of data makes it possible to generate more efficient code
Correctness
Explicit information about types in a program is a kind of
redundancy
against which it is possible to check expressions
Programmers usually wish to identify type errors as early as possible in the development process
Foldoc: type