Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Confused - when do we change value in the code instead of replacing it in the object value?
As I'm new to programming that might be a silly question. I keep hearing that we should avoid repeating ourselves and try to be super clear when naming variables, etc. In this video when we change the name it got me thinking, how this might be applied. How do we keep track of these changes, would not that be confusing?
Raffael Dettling32,997 Points
The best thing would be to declare them right at the start. But if you wanna change them afterwards some development programms like Visual Studio highlight specific variables through the entire code. So it´s easier to change them. :)
Thanks! Yeah, it was more a question for what's the best practice! I think it's clearer for me now.