Earlier quoted context omitted.
You can't escape problems by bundling specific library versions. You just get a different set of problems. When you require a specific version of a library, you're making your code incompatible with anything that requires a higher or lower version of that library. You're also assuming there will never be a security fix that requires you to update your dependency.
...you're making your code incompatible with anything that requires a higher or lower version of that library. Actually that's not correct when using node/npm (or anything else in the ecosystem like browserify). That is one of the impressive things about this platform: any number of different versions of the same module can be required by the same app. It would be nuts to do that in your own code, but as long as the…
NPM and Left-Pad: Have We Forgotten How to Program?
171–180 of 887 posts
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#172Earlier quoted context omitted.
Do you support IE 8? If not, why not use the one provided by the language, Array.isArray() ?
The latest version of lodash (4.0.0) doesn't support IE 8, so you would need to polyfill isArray() yourself or use a pre-modern lodash version.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#173We have. I spent some time optimizing [0] a String.repeat function over at Stackoverflow and I was surprised that many developers today don't know what they are doing, including core team members [1]. Specifically, function repeatString(str, len) { return Array.apply(null, { length: len + 1 }).join(str).slice(0, len) } [0]: http://stackoverflow.com/questions/202605/repeat-string-java... [1]: http://stackoverflow.com/…
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#174Re: NPM and Left-Pad: Have We Forgotten How to Program?
#175Re: NPM and Left-Pad: Have We Forgotten How to Program?
#176Earlier quoted context omitted.
Similarly, the `average` package on NPM is one that I came across: https://www.npmjs.com/package/average var average = require('average'); var result = average([2, 5, 0, 1, 25, 7, 3, 0, 0, 10]); console.log('The average for all the values is:', result); It's hard to not stare at that in complete disbelief; someone thought that it was worthwhile to create a package for determining the mean of an array of numbers.
You know what's worse? Javascript numbers are all floating point numbers, which means integers are 53 bits long. So, you might think this library would try to address issues this can cause, but nope, this is the average statement you'd write if you didn't know was a mantissa was and had never heard of big.js, bignumber.js, decimal.js, crunch.js or even strint (which represents integers as strings because wtf not).
[1] - https://en.wikipedia.org/wiki/Kahan_summation_algorithm
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#177Everything in this article is categorically wrong and antithetical to every principle of good programming ever articulated. The only problem here, as others have already noted, is that NPM allows people to delete published packages. Small modules are not evidence of a problem, and they certainly aren't evidence of an inability to implement these things on the part of the people depending on them. Why would I implemen…
> Why would I implement left-pad myself when there is already a well-tested implementation that I can install? You call 4 basic assertions "well-tested"? https://github.com/azer/left-pad/blob/master/test.js
b) The details of this particular project are orthogonal to the philosophy of small modules generally. Whether or not this module is well implemented or well tested has no real relation to whether or not it is a good idea to compose tiny modules.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#178Earlier quoted context omitted.
...and then the publisher pulls their library off npm, and another shows up and drops one of the same name in its place, with compatible version numbers (by happenstance or otherwise).
A version can't be republished.