Skip to main content
edited tags
Link
yannis
  • 39.7k
  • 40
  • 185
  • 218
edited title
Source Link
AngryBird
  • 1.8k
  • 5
  • 17
  • 23

What is the benefit of multiple return statementsvalues

I feel as if a return statement should only return one value. When it returns multiple, things get confusing. I know since the return type in Java has to be declared, this is difficult to do, but in languages like Python it is a snap.

Are multiple return values a sign of bad design or coding style?

Python example



def get_name():
   # you code
   return first_name, last_name

What is the benefit of multiple return statements

I feel as if a return statement should only return one value. When it returns multiple, things get confusing. I know since the return type in Java has to be declared, this is difficult to do, but in languages like Python it is a snap.

Are multiple return values a sign of bad design or coding style?

What is the benefit of multiple return values

I feel as if a return statement should only return one value. When it returns multiple, things get confusing. I know since the return type in Java has to be declared, this is difficult to do, but in languages like Python it is a snap.

Are multiple return values a sign of bad design or coding style?

Python example



def get_name():
   # you code
   return first_name, last_name

Source Link
AngryBird
  • 1.8k
  • 5
  • 17
  • 23

What is the benefit of multiple return statements

I feel as if a return statement should only return one value. When it returns multiple, things get confusing. I know since the return type in Java has to be declared, this is difficult to do, but in languages like Python it is a snap.

Are multiple return values a sign of bad design or coding style?