|
|
|
|
|
by samatman
3464 days ago
|
|
Functions have properties which are completely defined by their inputs and outputs. Subroutines (I prefer the term procedure) are just a sequence of commands. They may use arguments and return a value but they can also do anything else. Functions, real functions, can be reasoned about, composed, mapped over collections, and otherwise trusted to behave themselves. Very few programming languages provide strict functions. One may write them, of course, if one is careful, but that is doing work a compiler could be doing for you. |
|