Reply to post: Re: Functions returning multiple values.

Mads Torgersen and Dustin Campbell on the future of C#

JLV
Meh

Re: Functions returning multiple values.

It's a feature in Python. You don't have to use it and in fact few seem to.

Personally, while I find it convenient sometimes to return multiple values into a tuple, I agree that it is a code smell. So I usually create an object instance on the fly, assign my values onto it as attributes and then return a single value.

There is a fine line between a language/framework pragmatically promoting clean and robust code on one hand. And uselessly nannying assumed-to-be-competent programmers on the other. A crappy coder will find a way to be crappy in almost any language.

I would argue that work on making pointers/references more robust falls squarely on the side of generally useful language engineering.

While a certain language which requires declaring exception throws on each and every function's signature comes to mind for an example of the second outcome.

Multiple return values? Meh, probably not a very necessary complication in most cases, but easy enough to avoid.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon