Modular Design in JavaScript (Functional Programming Edition)

preview_player
Показать описание
Jason Gorman demonstrates how to apply the principles of Modular Design in functional JavaScript.

Modules should:

1. Do one job
2. Hide their inner workings (e.g., data)
3. Have swappable dependencies
4. Only expose what clients need to use

Рекомендации по теме
Комментарии
Автор

It's critical to point out that separation of the area calculation is only justified because your knowledge of the business domain makes it certain that a rigid length x width calculation is insufficient. In the absence of that business domain expertise or of that certainty, I would consider it perfectly reasonable to leave it in place (YAGNI).

jason_v