3 ms·
A comment on the side, >JavaScript Date is broken in ways that cannot be fixed without breaking the web. I really dislike the arrogant tone that many "new" pe
by moralestapia 6y ago
A comment on the side,
>JavaScript Date is broken in ways that cannot be fixed without breaking the web.
I really dislike the arrogant tone that many "new" people employ when talking about some "old" thing they are trying to "improve". (Quotes are there to indicate sarcasm).
Date is not 'broken', it may just not do whatever the author wishes it did; it is not 'broken' in the sense of failing to perform its intended function adequately.
I hope people could change their ways and be a bit more decent in general.
Aside from that, I welcome the new API as I think it would be an improvement over what we have now.
- Spivak 6y agoI think https://maggiepint.com/2017/04/09/fixing-javascript-date-getting-started/ https://maggiepint.com/2017/04/09/fixing-javascript-date-get... and https://maggiepint.com/2017/04/11/fixing-javascript-date-web-compatibility-and-reality/ https://maggiepint.com/2017/04/11/fixing-javascript-date-web... are better links for the motivations of what parts of Date can't be fixed without needing a new API.
- ryzokuken 6y agoDate is "broken" in that it aged pretty poorly, has a very non-ideal API surface and exposes developers to a number of footguns, that could, ideally, be avoided. The fact that a vanishingly small percentage of JavaScript developers use Date for non-trivial applications is a great indicator of these failures.
- swrobel 6y agohttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getYear https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...