If you’re writing an application with Node.js, chances are you are using work completed by the many open source contributors who came before you. Node’s package manager (npm) helps you easily incorporate these libraries into your own project.
In my work as a software developer at Pop Art, I’ve grown to appreciate npm for its ability to provide quick solutions to problems that are outside the scope of my project. Members of the Open Source Community imagine, improve, and use the code contained in these packages.
There’s an idea in the tech industry as a whole, and the open source community in particular, that you shouldn’t spend time solving a problem that’s already been solved. Why spend hours writing your own code to manipulate and display dates, when moment.js does it so well?
Collaboration is at the core of open source software. Developers provide code at no cost to the user, and users are invited to borrow, copy, change, and share the code in whatever way works for them.
Packages compliment and depend on each other. Developers continuously improve the code that they encounter through tools like Github. Open source code comes with no warranty, and the community is expected to make improvements as technologies change. For these reasons and more, Node calls npm an ecosystem.
Open source code is public. When your unit test checks equality with assert.deepEqual(), you don’t have to wonder exactly how “deepEqual” is defined. You can look it up! Again and again, I check the source code to see the method behind the method. From time to time, checking the source code has saved me from larger bugs down the road— more on that later.
Every person is empowered to be a contributor and to help open source projects develop. My teammates and I have contributed to several open source technologies since we joined PopArt. It feels good to give back to a project that we like. And our contributions help advance the project, so that others can benefit from code that is more robust.
Interpreting and improving other people’s code makes you a better programmer.
Always read source code!
Most npm packages do exactly what I want them to do, and save me lots of time and energy. But code might not (probably doesn’t) work the way we think it does. An npm package I recently added to a project contained deeply flawed logic. If I hadn’t checked the source code and run adequate tests, this little package might have cost my team and company many hours and dollars in the future. As good Open Source citizens, my teammates and I improved the code and submitted pull requests to have our improvements merged into the project. An Open Source ecosystem at work!
A Call to Action
As a member of the Open Source community, here are some actions you can take to improve the quality of open source projects:
Ultimately, the community is the gatekeeper and the vetter of open source code. That means you!
Open Source Bridge – an all volunteer-run, non-profit conference to build open source community and citizenship
OSCON – a conference put on by O’Reilly to celebrate open source achievements and ideas