4 ms·
Subroutines themselves weren't the innovation. Everyone was already calling out to subroutines in their assembly code. The innovation was structured programming
by foldr 7y ago
Subroutines themselves weren't the innovation. Everyone was already calling out to subroutines in their assembly code. The innovation was structured programming.
- fpoling 7y agoStack-based subroutine calls associated with structured programming came quite after people started to use subroutines in the assembly or higher level programming. Fortran, for example, gained those in eighties. Prior that everything was statically allocated and recursive calls were not supported.
- zozbot234 7y agoI'm not sure that "stack-based subroutine calls" are associated with structured programming. An activation stack is required to ensure reentrancy e.g. if a subroutine might be called from an ISR or a cooperatively-executing task, in addition to suppprting recursion.
- srean 7y agoCould you give us an example of a pre-structured programming, high level language that supported the things that you talk about. PDPs had instruction support for cooperatively executing tasks but the return address was stored in a register, and was therefore limited to a depth of one. From what I know stack based subroutines really became common around Dijsktra's famous paper which really ought to have been called 'Use the Stack, Stupid" rather than GOTO considered harmful. I am more than willing to be corrected with citations to the contrary.
- wwright 7y agoAnd at the time, a lot of programmers did whine and moan about structured programming. The famous joke should be “there are two hard problems with computer programmers: whining, moaning, and off by one errors.”