Ruby

Enrica Fedeli-Jaques
Enrica Fedeli-Jaques
6,758 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
182,438 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,758 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!

Steven Parker
Steven Parker
182,438 Points

Hope I helped — You can mark a question solved by choosing a "best answer".
And happy coding!