The question isn't really what's better practice, the question is whether the code follows the prompt. The first example does not.

[dead]