Introduction
Dive into the basics of cohesive code and the importance of modules in JavaScript.
We'll cover the following...
Cohesion
Well-designed software is cohesive.
“Cohesion is when a piece of code is narrow, focused, and does one thing well.”
A good designer strives to achieve cohesion at all levels:
- Functions
- Classes
- And, especially, files
Characteristics of a well-designed code file
A well-designed file should contain only things closely related to each other. Related items should be together in one file, and unrelated items should be apart from each other in ...