language agnostic - Do all programs have to have a return value? -
i writing own programming language, educational purposes.
when writing simple hello world example, realised many programming languages take following form:
write "hello world" console return 0
- do programs have return integer somehow?
- do don't explicitly require state return value implicitly return 0 anyway?
- does change between popular operating systems based upon windows nt, linux kernel or mac os xs kernel?
- if so, why?
i unsure tag question as, appreciated of course.
it's os specific question, no-one can answer if it's true os. said, i believe that, in reasonable os, yes - program has have return value.
why? chain programs execution , therefore report problems, relaunch , on. there aren't programs don't return value, it's compiler hides programmer.
is case on major operating systems? probably. 0 means means success shouldn't make such assumptions when writing programs; use language constants.
if write own language may map error codes (exceptions, termination reasons) host language's error codes.
Comments
Post a Comment