3 ms·
This is by design. The node community actively encourages you to break every module into the smallest possible pieces, then make a parent module which reassembl
by josephg 12y ago
This is by design. The node community actively encourages you to break every module into the smallest possible pieces, then make a parent module which reassembles them. This is seen as good, modular design - you end up with small pieces which can be individually tested, patched, understood, documented and maintained. Some extra effort gets pushed to developers in that when you want to do something simple, you have to trawl through dozens of small libraries which will all accomplish the goal. But those small libraries should each be readable and understandable - unlike the mammoth size of most C/C++ libraries.
I asked isaacs about documentation on the way back from nodeconf this year (isaacs is the CEO of npm and former maintainer of nodejs). I asked him what he prefers when it comes to documentation of nodejs packages. He said that if your package needs anything larger than a readme, its probably too big and you should just break it up.
- angersock 12y agoI'm all for libraries that do one thing and do it well. But again, that's not what I was complaining about. Consider: https://www.npmjs.com/package/isarray https://www.npmjs.com/package/isarray Compare with: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... And again, for browser stuff, sure--but this is a controlled runtime on the server. This shouldn't even be a question. What I've also noticed is the tendency to use lodash and underscore in places where there are completely reasonable standard language features, like _.forEach(). Again, the Javascript language is a bit weird, and lacking perhaps in a lot of functionality that a default Ruby installation (say) might get you, but this is just silly.