News for hackers. Stuff that matters.
Re:NPM and Left-Pad: Have We Forgotten How to Program? by raverbashing on Wednesday March 23, 2016 @06:58PM (#11348989)
Yeah, I thought the dependency thing was a joke (I mean, to have a package for is positive integer is already a joke, but come on)

Really

Re:NPM and Left-Pad: Have We Forgotten How to Program? by onli on Wednesday March 23, 2016 @07:34PM (#11349257)
I think it actually is not. That's from some years ago and my memory of it is fuzzy, but at that time it was surprisingly hard to check whether a variable is a positive integer – maybe it was a negative one though and that was harder? You'd think it is just checking whether it is an integer and bigger than 0, or just checking whether it is bigger than 0. And it is. But to get that code to work reliably, regardless of whether it gets a string or float or an undefined, with the JS type system of that time and in multiple browsers, even the crappy ones, that took some time. There was one specific edge case involved.

Not that it was impossible, but I still remember having to search for it and being astonished that that was necessary.

Sure, should not apply anymore like that.

Re:NPM and Left-Pad: Have We Forgotten How to Program? by msbarnett on Wednesday March 23, 2016 @10:06PM (#11350065)
Be that as it may, is-positive doesn't handle any edge cases https://github.com/kevva/is-positive/blob/master/index.js

That's half the problem with these stupid micromodules; they're not abstracting complexity, they're obfuscating simplicity.

Re:NPM and Left-Pad: Have We Forgotten How to Program? by onli on Thursday March 24, 2016 @08:10AM (#11352140)
Don't know. If that approach works reliably, I'd see some value in it. Maybe this does not need any more code if you do it that way. If it does not work reliably, than you are absolutely right and that were useless.
Re:NPM and Left-Pad: Have We Forgotten How to Program? by IncRnd on Wednesday March 23, 2016 @11:23PM (#11350357)
Yea. I don't think many argue against abstracting complexity into more easily understood orthogonal modules. But some of these modules aren't abstracting complexity. They are ludicrous. They are nonsense. They are a symptom of a very real problem with how JS is programmed, how people expect to program in JS, and the difficulty people have with decomposing problems.

So many people on this page have written about how these are well tested, performant, and correct modules. But, the modules aren't even correct in many cases, let alone providing incomplete coverage over edge cases or the slow performance and horrendous dependencies of many of the modules.