Principles of programming languages Maarit Harsu / Matti Rintala / Henri Hansen
TUT Pervasive Computing
1
Subprograms
- Subprogram (subroutine)
– statement abstraction, control abstraction
- Subprogram design
– if a subprogram does not fit on the screen, it is too long
- divide the solution of the problem into smaller parts
– if an action is needed twice (or more times), implement the action as a subprogram
- when are two seemingly different things the same?
- when are seemingly similar things different?
Subprogram
- procedure (command)
- function (expression)