Home Parameters and Returns

Minimize your parameters

Your method should accept only exactly as many parameters as needed to function, no more, and no less.

Early returns

Stylistically, we're indifferent as to whether or not you have only a single return in your method or if you have multiple. The only time we require you to return early from a method is if doing so would benefit efficiency (for example, returning a value from the middle of a loop).

Method chaining

Do not chain your methods together. If you have a sequence of tasks that are meant to be linear, you should keep them linear. If you need data to flow from one method to another to yet another, you should return that data instead of directly passing it some method.

Note that what method chaining is and isn't can be subtle. You'll probably need to read the expanded explanation for this one.