3 ms·
> Furthermore a function call has a vastly restricted set of valid behaviours: at some point it must terminate, and prior to termination, update the system stat
by beambot 13y ago
> Furthermore a function call has a vastly restricted set of valid behaviours: at some point it must terminate, and prior to termination, update the system state (stack) to include its return value.
Hooray! We've solved the halting problem. Without formal analysis, it's not possible to show (in general) that a function will terminate.
More seriously, I've seen function behavior that's just as bad as other types of flow control (including gotos).
- KirinDave 13y agoMost structured programming ignores this problem as unless you assume some best effort from the programmer, all programming is futile. You don't exercise your Big-O thinking here, you exercise your Big-Theta.