Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 18, 2020 03:10 am GMT

Moment.js & The Selflessness of Developers

A couple of days ago, I saw a post on Hacker News about some announcements from Moment.js. If youve done web development with JavaScript, theres a good chance youve used Moment.js. If youre not familiar with it, its a library that makes it much easier to work with times and dates.

I clicked through to the announcement to see if there were any new or deprecated features that I should be aware of. Instead there was something very different. At the top of their main documentation page, the Moment.js team had added a long preamble.

First they discussed how popular the package is (12 million downloads a week!) and then some common complaints (Moment objects are mutable!). Then they dropped a bomb: We recognize that many existing projects may continue to use Moment, but we would like to discourage Moment from being used in new projects going forward. Woah!

The surprises kept coming. The authors explained some of the main drawbacks of Moment.js and they provided extensive links to deeper explanations and alternatives. But they also make it clear that they are not killing Moment.js. It is too important to too many projects. They will continue to make critical fixes and updates. They just wont be adding new features. As they put it, [Moment.js] is not dead, but it is indeed done.


...
Do you want feedback on your JavaScript code?
Come join our code review Slack group!
Just click the link at the top of our landing page: https://antcode.dev.
...

Stop and think about this situation for a moment (pun intended). To appreciate how peculiar it is, lets consider a similar situation in a different context. What if Apple operated like Moment.js? You walk into the Apple store to buy a new phone. An employee tells you, Actually, you shouldnt buy an iPhone. You should go buy a Samsung. The camera is way better, and the battery lasts way longer. But you can keep using your current iPhone. Well make sure any software updates work seamlessly with your old model. If this happened to me, I would think the salesperson was either crazy, pissed at Apple and trying to get revenge, or playing some reverse psychology trick to actually get me to buy an iPhone.

But in open source, this sort of thing is normal. People build something and put it out into the world. People start using it, and they notice flaws. Some of them choose to contribute code to fix those flaws. Most just complain and hope that someone else will fix them. The maintainers work hard to make everyone happy which is a nearly impossible task. In fact, users of open source projects can sometimes get downright nasty and mean with the maintainers.

What do the maintainers get for all of the work, stress, and abuse? Money? Maybe theyre lucky to get some sponsorship money but its not going to make them rich. (The Moment.js team explicitly turned down sponsorship because the core team members all have good jobs and dont need the money). What about recognition? Maybe but how much does the world care about GitHub stars? Their resume? Perhaps but there are more efficient ways to get lucrative software engineering jobs.

I would argue that the main motivation is selflessness. Developers want to help other developers. They want to contribute to the common good. What a beautiful thing. With one piece of code, a developer can help people around the world now and for years to come. But then when something new comes along that better serves the common good, it is time to graciously and selflessly step aside.

This is what the maintainers of Moment.js did this week. We should congratulate them not just on their great work but also admire them for their ability to put the community before themselves.


Original Link: https://dev.to/o_nagen11/moment-js-the-selflessness-of-developers-3o5k

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To