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

Enrica Fedeli-Jaques
Enrica Fedeli-Jaques
6,773 Points

variable answer, is that the right name for it?

answer = ask("what is your name?"), is answer the best name for that variable? I find it a bit confusing with the other answer inside the method + anyway still quite a vague name?

1 Answer

Steven Parker
Steven Parker
231,271 Points

If you provide a reference to a video (with time index) or challenge, there might be something there to indicate the basis for this name choice.

But simply based on the code snippet shown here, perhaps "name" might be a better choice for the variable holding the answer to this particular question.

Enrica Fedeli-Jaques
Enrica Fedeli-Jaques
6,773 Points

thank you Steven for your reply, I thought I'd posted this question under the video I was referring to but I can't see it anymore, so I might be wrong! It was a video but now I've done quite a bit today, I can't remmebr which video t was :) thank you for your answer anyway!