in reply to Is it ok to assign a popped value to a variable as shown.
Don't worry so much about "correct habits" and "good practices" -- doing so usually just leads to paralysis over meaningless questions like "what should I name this variable?" or "should I put a space here?". Remember that you're writing code to solve a problem, not to win a fashion contest, and you'll do fine.