in reply to Difference between subroutine and functions
Traditionally, outside of Perl,
returned values that were used as a part of the calling expression.
Preferably they do not have side-effects.
Returned only status. True/false, an error code or an exception.
Usually side-effectful.
A generic term covering both and more.
I'm not sure if there is any language that actually enforced these rules. Didn't Pascal complain if you tried to return a value from a procedure?
|
|---|