Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Joe Ainsworth
Joe Ainsworth
13,588 Points

Good pactice - include return at the end of a method?

Is it best practice to include 'return' at the end of your methods? As I've noticed it doesn't seem to matter. Whatever is at the end of the method Ruby will return regardless.

1 Answer

Joe Ainsworth
Joe Ainsworth
13,588 Points

Answer to my own question.

Checked out stackoverflow (http://stackoverflow.com/questions/1023146/is-it-good-style-to-explicitly-return-in-ruby)

It's worth explicitly including return as it makes it clear and less confusing for others who are working with unfamiliar code.