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!
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
Ian Hock7,604 Points
I was wondering why we create an empty variable called guess; ? I've erased it and the program still functions?!
Originally I thought guess; stored the value of whatever they enter in the prompt. But the way that block evaluates guess in the (while, do/while, ) loop structure it seems like it shouldn't need it.
Steven Parker225,712 Points
Assigning a variable that has not been declared causes it to be created as a global. While this is perfectly legal in terms of the language itself, it is considered a "best practice" to define all variables before they are used. This can be helpful in determining the intended scope of the variable.
terminator genesys1,134 Points
your program might work differently on larger projects as it declares a global variable and global variable may change if you use another variable with same name;