6 ms·
It's always been weird to me how Microsoft invests so much in making JavaScript easy to develop and maintain with TypeScript but does so little to make it safe,
by mattigames 7y ago
It's always been weird to me how Microsoft invests so much in making JavaScript easy to develop and maintain with TypeScript but does so little to make it safe, the one thing JS needs is a standard library by Microsoft (or similar, e.g, Google) that we can trust, aiming to significantly reduce the number of dubious-origin dependencies of every JS project (on node and the browser)
- kijin 7y agoYeah, remember the left-pad incident? It took until ECMAScript 2017 to make such a simple function part of the standard library. Things are slowly getting better, but JS is still rather lacking compared to "batteries included" languages like PHP and Python.
- tastroder 7y agoThis comes up pretty often, what would you like to see in such a standard library? I consider the libraries included in Node pretty extensive these days.
- mattigames 7y agoNode is a tiny part, the big fish is JavaScript in the browser
- tastroder 7y agoThe person I replied to compared the stdlib to that of PHP and Python, both of which are backend components. Frontend land is getting frequent updates already, with a relatively good process, vendor backing and incubation in browsers, not sure what the complaint is supposed to be there? That it's too slow? Imho that's a good thing when it comes to most language changes.
- mattigames 7y agoYeah is too slow, but is not only that, is that it makes senses for it to exist years on user-land as a library (or multiple ones) before being implemented on any standard.
- tastroder 7y agoFor what it's worth, I don't think that's a bad thing. Assuming you're talking about jQuery and the like, what was adopted to the specifications is the consensus of many years and wouldn't have been predictable in the first few of that library's history. I mean, frontend land is incredibly fragmented and browsers are no operating systems. Clean APIs and stability, to me, are worth far more than being quick to adopt the latest trend. Otherwise we get competing pet standards again, "made for firefox / chrome" buttons, without significant developer adoption. Libraries and shimming aren't inherently bad, single line libraries on NPM are.
- evmar 7y agoHere's another opportunity to point out this unfortunate licensing bug in TypeScript's standard library: https://github.com/microsoft/tslib/issues/47 https://github.com/microsoft/tslib/issues/47 (Disclaimer: I like TS, but I filed the above bug.)
- pbhjpbhj 7y agoAside, can anyone explain this to me? >Please do not use "public domain", it's not a license and it makes it impossible to use such code in corporate context. // Seems pretty ridiculous, "can't use code unless it's encumbered by licensing restrictions"??
- pabs3 7y agoCheck out the CC0 license and its justifications: https://creativecommons.org/share-your-work/public-domain/cc0/ https://creativecommons.org/share-your-work/public-domain/cc... https://creativecommons.org/publicdomain/zero/1.0/ https://creativecommons.org/publicdomain/zero/1.0/
- Doctor_Fegg 7y agoCC0 is a licence. "Public domain" is a state. Some works have no copyright, typically because they're the product of a US Federal institution, or the copyright has expired. In American English this copyright-free state is also known as "public domain". (In British English it can mean something quite different.) To put something in the "public domain", you need to make a statement of such. In other words, a licence. You could just say "I put this in the public domain" but it may not provide the certainty that bigcorps like. CC0 is a way of saying this in bigcorp-friendly language. (The CC0 page at https://creativecommons.org/share-your-work/public-domain/cc0/ https://creativecommons.org/share-your-work/public-domain/cc... explains this well.) Alternatively, you can use WTFPL, which is a really great way of putting your works in the public domain while guaranteeing that bigcorps won't use them (see: statements on HN by Google people, passim).
- pedrocx486 7y ago
- kccqzy 7y agoGoogle has already developed a good featureful JS library. It's called the Closure library. It can be used independently or together with the Closure compiler. It's also more than a decade old, ensuring widespread compatibility, though not necessarily using modern idioms. Some communities like the ClojureScript uses it extensively and a front end project in ClojureScript require very few dependencies.
- mattigames 7y agoI have around a decade doing JavaScript and never heard of it before, any guesses why it might not be widely known/used? Edit Answering to Jyaif: Anecdote is not data, here is it comparing the popularity of Closure library against Angular -another Google technology-: https://trends.google.com/trends/explore?date=today%205-y&geo=US&q=Closure%20library,jquery,%2Fg%2F11c6w0ddw9 https://trends.google.com/trends/explore?date=today%205-y&ge...
- Jyaif 7y agoFWIW I never wrote JS and yet I've heard of it.
- oblio 7y ago> the one thing JS needs is a standard library by Microsoft You must be new to this whole Microsoft vs Netscape thing :-) What Microsoft should do is get Google & co. onboard with creating a full-featured standard library. Microsoft going at it alone would create a huuuuuge backlash because of ye olden days.
- mattigames 7y agoFair enough, yeah it might be better as a collaboration, and if they could include Mozilla and Twitter in the mix that would be even better.