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
Michael WilliamsCourses Plus Student 8,059 Points
This video went waaaaaaaay over my head. Can someone explain it to me like I'm 5? Or 3, even?
I get that you're drawing in the info from one file to another, but I don't get Andrew's explanation. Here's the video: https://teamtreehouse.com/library/organizing-your-code-with-require
Kevin Gates15,052 Points
Separate from that concern is his app.js file which is where he wants to manage his inputs / outputs.
By separating concerns, he has modularized his code. This means if he creates another file, let's say an API for another application he has, he could make that API code to also utilize that same profile.js file.
Additionally, if he knows his profile.js file works, that means if an error occurs, he has smaller groupings of code to debug.
- It's cleaner to see (organization).
- Separating concerns and modularizing allows you to easily reuse portions of your code.
- Its organization can improve debugging.
Hope this was helpful. :)
Rick Gleitz47,077 Points
Managing the inputs/outputs in the app.js makes sense. I had the same issue and also needed simplified explanation. 😁