Modules :: Eloquent JavaScript
The ideal program has a crystal-clear structure. The way it works is easy to explain, and each part plays a well-defined role. A typical real program grows organically. New pieces of functionality are added as new needs come up. Structuring—and preserving structure—is additional work. It’s work that will pay off only in the future, the next time someone works on the program. So it is tempting to neglect it and allow the parts of the program to become deeply entangled. This causes two practical issues. First, understanding such a system is hard. If everything can touch everything else, it is difficult to look at any given piece in isolation. You are forced to build up a holistic understanding of the entire thing. Second, if you want to use any of the functionality from such a program in another situation, rewriting it may be easier than trying to disentangle it from its context. The phrase “big ball of mud” is often used for such large, structureless programs. Everything sticks together
Modules Write code that is easy to delete, not easy to extend. Ideally, a program has a clear, straightforward structure. The way it works is easy to explain, and each part plays a well-defined role. In practice, programs grow organically. Pieces of functionality are added as the programmer identifies new needs. Keeping such a program well structured requires constant attention and work. This is work that will pay off only in the future, the next time someone works on the program, so it’s tempting to neglect it and allow the various parts of the program to become deeply entangled. This causes
Explore this link on the map →related reading
- ES modules: A cartoon deep-dive - Mozilla Hacks - the Web developer bloghacks.mozilla.org
- Demystifying Code Bundling with JavaScript Modules - Simple Threadsimplethread.com
- CommonJS规范 -- JavaScript 标准参考教程(alpha)javascript.ruanyifeng.com
- CommonJS effort sets JavaScript on path for world domination - Ars Technicaarstechnica.com
- Tao of Node - Design, Architecture & Best Practices | Alex Kondovalexkondov.com
- Cognitive load is what mattersminds.md
- TypeScript: Documentation - Modulestypescriptlang.org
- how I think when I think about programming - alice mazalicemaz.com
- Bulletproof node.js project architecture 🛡️softwareontheroad.com
- What is good code? (part 2)loup-vaillant.fr
- Program Structure :: Eloquent JavaScripteloquentjavascript.net
- JavaScript Articles - 30 seconds of code30secondsofcode.org