Small, Reusable Components

javascript

I'm a big fan of node.js. Of the many things I like about it, my favorite is the community's focus on small, reusable components.

I can't begin to count the number of times I've been happily developing within monolithic frameworks, and needed to do something that the framework doesn't expose or doesn't make easy. While frameworks try to make things easier for the programmer, they always seem to end up making things harder. Frameworks help you as long as everything you do falls within the framework's assumptions of what you are going to do. But so often for a project, there are requirements that do not map exactly to something the framework does, and you're left hacking around the framework.

On the other hand, a pervasive philosophy in node.js is that modules should be small, do one thing, and be easy for anybody to upload. This is great; the more focused a module is, the fewer assumptions it makes of me and my use case. This means that I can find a handful of modules and glue them together to get exactly what I want done, rather than compromising the product so that it fits into the will of a monolithic framework.

The more focused a module is, the easier it is to get it to fit my exact use case. No cruft. No struggle. Just good, readable code.