Re:Ask HN: Why do many CS graduates lack foundational knowle...
by Koshkin on Monday March 20, 2023 @08:00AM
(#35230297)
Isn’t that why some other languages explicitly draw a distinction between a function and a procedure? I think ‘void’ was introduced in C to do the same thing, implicitly (because omitting the return type does not achieve that).
[ Parent
| on HN ]
Re:Ask HN: Why do many CS graduates lack foundational knowle...
by WalterBright on Monday March 20, 2023 @03:26PM
(#35237233)
Yes, but Wirth (Pascal's inventor) was an academic, which is why Pascal has a separate notion of functions and procedures. `void` is a hackish special case in the type system, and not just for function returns. It's unsound.