Skip to content

Value of "return" keyword #9

@billdueber

Description

@billdueber

Excellent work! I ask that you reconsider "Avoid return where not required."

The return keyword is excellent syntactic sugar for two reasons:

  1. It gives a very easy way to differentiate between methods whose return values are meaningful and methods whose return values are incidental.
  2. It's invaluable for reading code where the value returned doesn't come from the last line of the method (because the last line executed is within a conditional of some sort).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions