Live data from Hacker News

We now consider Moment.js to be a legacy project in maintenance mode

momentjs.com

191–200 of 266 posts

Re: We now consider Moment.js to be a legacy project in maintenance mode

#191
post #52

Please pardon this drive-by assessment of JS calendar libraries by a casual user. moment.js: Mutable. Thank you, next. Luxon: Takes the effort to implement `Interval`, which would be `Range ` in any proper language, but somehow avoids providing separate `Date` and `Time` objects. Day.js: When you kinda like moment.js, but your bundler says it's too fat. date-fns: The finest of pure, curry-able functions over the mine…

> moment.js: Mutable. Thank you, next.

A petty, thoughtless dismissal that reflects more on the one saying it than the library.

Re: We now consider Moment.js to be a legacy project in maintenance mode

#192
post #168

I don't know if the Moment.js folks are reading this, but THANK YOU for your commitment to stability and security fixes. Not all of us are in a situation where we're iterating through the JavaScript new hotness every couple years and still have significant legacy systems to maintain and support.

Yes, and you're welcome.

Re: We now consider Moment.js to be a legacy project in maintenance mode

#193

Good for them. Open Source seems to have an irrational fear of done . Done is good. Done should be the goal. But it’s not. Because if you’re not adding new features and pushing code changes every day, your project is abandoned , dead . To quote another thread from two minutes ago: “I’m quite sad to see the end of Moment.js” I wish the was a way to fix this attitude. So that project maintainers didn’t need to write tw…

>I wish the was a way to fix this attitude.

I think the best way to fix this attitude is to have more examples of "done but not dead" projects in the wild. You can't blame people for assuming they're the same thing when in most cases they are.

Re: We now consider Moment.js to be a legacy project in maintenance mode

#194
post #27

Earlier quoted context omitted.

> Until very recently it was impossible to make objects immutable in JS. Even now its really only done using third party libraries. There's a big difference between "literally impossible to mutate" (only important in the most security-critical contexts) and "designed around immutability as the default" (which is what is desired in most of the real world.) The former not being possible is not a reason to exclude the l…

With JS, until recently, it was nearly impossible to design immutable API's. Everything takes JSON based objects which have no field accessors. All the objects underneath are just hashmaps with string keys. When all your objects are hashmaps you can't really make fields immutable. Even if you wrote getters, someone can just reassign the function reference. Even if you check your fields in incoming object parameters,…

You didn't have language enforced immutability. But you still could have convention enforced immutability. If you don't provide apis that mutate your objects and document that mutating is not supported, you get almost all of the benefits of immutability.

Re: We now consider Moment.js to be a legacy project in maintenance mode

#195

Good for them. Open Source seems to have an irrational fear of done . Done is good. Done should be the goal. But it’s not. Because if you’re not adding new features and pushing code changes every day, your project is abandoned , dead . To quote another thread from two minutes ago: “I’m quite sad to see the end of Moment.js” I wish the was a way to fix this attitude. So that project maintainers didn’t need to write tw…

As Ajahn Brahm says: "What's done is finished!"

Re: We now consider Moment.js to be a legacy project in maintenance mode

#196
post #82

A big "Thank you!" to the developers of Moment.js. For the last 8 years or so it has always been the first library I included in any new JS-project. I didn't even bother looking for alternatives, so I didn't know about Intl, Luxon & day.js until today. The size of the library has always been one of these things where I thought that the benefits outweigh the costs, and I knew that it wouldn't be like this forever. To…

     No other library has filled a huge gap in JavaScript like Moment.js did for so many years.
I might say jQuery... which is mighty fine company to be included with!

Re: We now consider Moment.js to be a legacy project in maintenance mode

#198
post #52

Please pardon this drive-by assessment of JS calendar libraries by a casual user. moment.js: Mutable. Thank you, next. Luxon: Takes the effort to implement `Interval`, which would be `Range ` in any proper language, but somehow avoids providing separate `Date` and `Time` objects. Day.js: When you kinda like moment.js, but your bundler says it's too fat. date-fns: The finest of pure, curry-able functions over the mine…

Can you explain why you find mutability to be a showstopper? Is this a front end developer thing? I like my consts and all where relevant, but I don't see why mutability is such a problem. Javascript is an imperative language where almost everything more complicated than a number is mutable. I see the lack of creating copies of objects with every operation as a benefit because of the RAM and CPU cycles it saves. Is i…

It's very unpractical and error prone.

You call a function that requires a date (moment) object, and after the call you want to do something else with that date. Was it modified? Who knows. You will have to clone it before calling the aforementioned function. Otherwise, bugs.

You write a function that expects a date (moment) object. You want a different date (say "the day after"). If you call a method on the object, will the parent be smart enough not to touch anymore the date? You can't know that, so you will have to (remember to) start by cloning the date. Otherwise, bugs

Re: We now consider Moment.js to be a legacy project in maintenance mode

#199
post #73
post #52

Please pardon this drive-by assessment of JS calendar libraries by a casual user. moment.js: Mutable. Thank you, next. Luxon: Takes the effort to implement `Interval`, which would be `Range ` in any proper language, but somehow avoids providing separate `Date` and `Time` objects. Day.js: When you kinda like moment.js, but your bundler says it's too fat. date-fns: The finest of pure, curry-able functions over the mine…

"moment.js: Mutable. Thank you, next." Mutable is not bad, buddy. You live in mutable world.

No I don't. I live in an immutable, four-dimensional world /s

These are all just models of the real world, not the reality. The real world can be modeled equally accurately as mutable or immutable, it just depends which properties of the real world you care about modeling.

Re: We now consider Moment.js to be a legacy project in maintenance mode

#200
Our favorite bug for newbies using moment.js:

  const somedate = moment(...somedate...);
  const oneMonthLater = somedate.add(1, 'M');
  const dateToCheck = ...; // between somedate and somedate + 1 month

  if (dateToCheck.isBetween(somedate, oneMonthLater)) {
    // do something
  }
The puzzled looks when the tests fail. I'll miss that. Seriously.
Post reply on HN