3 ms·
Java didn't have a decent date implementation until Java 8. > If somebody could just come up with a standard library for JavaScript that is really widely adopt
by hn_throwaway_99 7y ago
Java didn't have a decent date implementation until Java 8.
> If somebody could just come up with a standard library for JavaScript that is really widely adopted I think the amount of packages can be cut back dramatically.
As this article points out, I think that lodash is that for many people.
- dep_b 7y agoFrom what I read about it it’s more like syntactic sugar, not something alike the .Net core libraries. Get your JS Core libraries once from a repo, reuse them in every application that uses the same ones
- toyg 7y agoJava has had exact datetime implementations since what, 1.3? 1.2? Sometime in the ‘90s anyway. They weren’t fun to use but they worked fine, had the concept of multiple calendars etc... JS’s version of Date in comparison has always been a toy.
- hn_throwaway_99 7y agoJS's version of Date is pretty much exactly the same as java.util.Date: just a thin veneer around a long representing ms since the epoch. Yes, Java has had Calendar and DateFormat for years, but the API is generally recognized as being pretty horrible (how many bugs were caused by Date and SimpleDateFormat not being thread-safe?) So the Java community coalesced around Joda time, not unlike how the JS community coalesced around moment.js. The big difference is that yes, Java eventually rolled these lessons learned into the java.time API, but now you're effectively stuck with 2 standards, Joda and java.time. Not sure if that's much of an improvement.