3 ms·
A subroutine isn't the same as a function. Functions return a value, and can be used by name in an assignment operation. Subroutines are not interchangeable w
by lproven 3y ago
A subroutine isn't the same as a function.
Functions return a value, and can be used by name in an assignment operation.
Subroutines are not interchangeable with them and are traditionally called by line number, and lack local variables.
It sounds to me like what you are referring to are procedures: named blocks of code that can accept parameters, manipulate them in local variables, and thus can call themselves, enabling recursion.
If that's what you meant, I agree. I owned a few (ZX Spectrum Beta BASIC, Sam Coupe SAM BASIC, and BBC BASIC V) and it makes much clearer code very easy.
- teddyh 3y agoIt doesn’t matter what you call them, since the BASIC people seem to have such fond memories of does not have any of them as a construct in the language. What I would like, no matter what they’re called, is anything which would allow easier methods of creating abstractions.
- lproven 3y agoIt does matter, very much. Firstly, because you are so lazy and inconsistent with your terminology, it's not possible to determine what your real meaning is. Secondly, because you are muddling up separate and different terms "function", "subroutine" and not using the correct term "procedure", you are missing the core point that even simple BASICs had subroutines. 0/10, try again. Learn the right words and use them correctly.