Why do most programming languages only support returning a single value from a function?
Posted
by
M4N
on Programmers
See other posts from Programmers
or by M4N
Published on 2013-07-02T20:54:08Z
Indexed on
2013/07/02
23:17 UTC
Read the original article
Hit count: 213
programming-languages
|language-design
Is there a reason or an explanation why functions in most(?) programming languages are designed to support any number of input parameters but only one return value?
In most languages, it is possible to "work around" that limitation, e.g. by using out-parameters, returning pointers or by defining/returning structs/classes.
But it seems strange, that programming languages were not designed to support multiple return values in a more "natural" way.
© Programmers or respective owner