3 ms·
And those languages were badly designed. Which is why we don't have "procedures" or "subroutines" in modern programming languages" - just functions.
by zabzonk 5y ago
And those languages were badly designed. Which is why we don't have "procedures" or "subroutines" in modern programming languages" - just functions.
- Koshkin 5y agoWell that's unfortunate. I suspect the fault lies with C, the early versions of which did not have the 'void' keyword, and 'int' was assumed as the default return type - which also meant that when such "function" did not include a 'return' statement it "returned" whatever garbage was left in the register. Instead of adding the keyword 'void' (to be abused later as the empty arg list) they could have added 'proc' instead, but that would have complicated the parsing, and so they went with the 'void' pseudo-type as an indication of the fact that the function is not really a function but a procedure.