Michael WilliamsPro Student 8,057 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 Gates12,982 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.
- It's organization can improve debugging.
Hope this was helpful. :)