All Mod(ule) Cons
“There’s a broad trend where people are switching from building monolithic apps to small modules that can be pieced together,” Schlueter told me in an interview.
Such modules vastly simplify the process of both building and updating programs. Much the way it’s far simpler to replace a light fixture than to completely rewire your house, it’s much easier to pull out and replace an old code module with a new one than it would be to rewrite a much larger monolithic program.
See also: How Node.js Stays On Track
NPM’s move here basically reinforces the notion of modularity at the repository level. It’s an idea you might even sum up in a slogan: “One repo, one module.”
“We have a huge legacy code base, but we’re just starting to refactor it and break it down into small modules,” he said. “Modules are easy to understand, easy to write tests for, and make creating new functionality much easier.”
On Private Modules, you could host all the modules of an app without worrying about going over your pricing plan. Private Modules shows companies and individuals that its within their price range to build apps the right way.
More Modules … And Fewer Users?
When the announcement made Hacker News Tuesday, however, some individual developers were less enthusiastic about the new direction. One major concern: Private Modules might effectively limit the number of users who can work on non-open-source projects. GitHub’s premium pay-per-repository model, by contrast, encourages unlimited collaboration on a limited number of repositories.
“Everything looks pretty awesome, except the payment model… With NPM’s model all my collaborators will have to pay for NPM private modules as well,” one commenter noted. Another suggested that NPM’s per-user payment scheme might turn off small companies:
Sounds like a big pain to have to pay individually for each person on a team if your company wants to use private modules. We’re generally willing to throw money at problems like those private modules solve, but if we have to do it a dozen times it probably isn’t going to happen.
Schlueter remains confident that NPM is moving in the right direction by encouraging practices that have been spreading among developers for decades.
“If we want to look back to the historical roots of this decision, even the shift from Multix to UNIX was about splitting up code into independent parts,” he said. “From the GNU Revision Control System to Git, the trend has been for things being broken into smaller pieces. NPM is a really good example of that in practice.”
Lead image by David Hamilton for ReadWrite (via Build with Chrome); photo of Isaac Schlueter courtesy of NPM