Earlier quoted context omitted.
> A 1-line of code module matches your needs exactly just for today. Nothing about function length determines utility. There are many one lines that match many people's needs repeatedly. > When you have 100 such modules which don't quite work This is worrying. How are you picking the modules you use? 100x popular modules from npm - with git repos, unit tests, READMEs, and hundreds of other users - beat 100x functions…
Worry not my friend. I'll take the risk of being wrong. Up to now, it seems that there's consensus on the fact that the JS/frontend world is the worst offender when it comes to engineering robust software. At least there are JS programmers that seem aware of it and agree that this has to change. So there's still hope I guess.
NPM and Left-Pad: Have We Forgotten How to Program?
801–810 of 887 posts
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#802Earlier quoted context omitted.
> A 1-line of code module matches your needs exactly just for today. Nothing about function length determines utility. There are many one lines that match many people's needs repeatedly. > When you have 100 such modules which don't quite work This is worrying. How are you picking the modules you use? 100x popular modules from npm - with git repos, unit tests, READMEs, and hundreds of other users - beat 100x functions…
Worry not my friend. I'll take the risk of being wrong. Up to now, it seems that there's consensus on the fact that the JS/frontend world is the worst offender when it comes to engineering robust software. At least there are JS programmers that seem aware of it and agree that this has to change. So there's still hope I guess.
I completely agree. I still can't understand why the language that we depend on for increasingly large-scale front-end work still works like this:
[1, 10, 2, 21].sort() // returns: [1, 10, 2, 21]
It's 2016, software engineering is purported to be a profession, and we still have the worst tools imaginable.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#803Earlier quoted context omitted.
People need modules like leftpad to tick the "maintains moderately popular open source project" checkbox. Instant hirability. I don't want to claim that it would be a directly calculated career move, more like starting a blog: you admire a good blog, you want to be more like the blogger, you start your own one. On the dim chance that it will become both good and not abandoned after the third post. Nanomodules can be…
Yep, I think this is a huge, HUGE part of it. Step 1: Create a culture in which "having open source contributions" is a requirement to entering said culture. Step 2: Remove all friction from introducing open source contributions into the culture. Step 3: Watch the Cambrian explosion. Step 4: (Two years later) Point to the Cambrian collapse and how the new hot thing will solve everything. I don't know what sort of shi…
Step 5: a mechanism for curated metamodules
This would not have changed much for the current situation, but it might help cultivating a "too important to play it fast and loose" mindset that would.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#804No it's because they don't do the same thing at all. This comparison shows you clearly don't understand the first thing about promises.
If you're new to technical discussions, people normally provide supporting arguments. Both of those handle sequences of tasks that need to complete in order. "No you don't understand" without any further info is not a response.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#805Another explanation for the flourishing of these one function modules may be the fact that some people feel a kind of high/achievement from being able to say they have a published module out there. A sort of bragging rights if you will.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#806Earlier quoted context omitted.
Odd, the ones I use all have tests, thousands of downloads, and active bug trackers. If I reinvented the wheel, or copy pasted, I wouldn't get those things.
The OP's example ( is-positive-integer) has tests, and is only three lines long, and is on major release version 3.X, because despite all that , it had serious problems in versions 1 and 2.
But to be explicit about the history: version one[0] had dependencies. Version two[1] had no dependencies, and a comment on github suggests that it might be wrong but I can't immediately see how. Version three[2] is a different implementation, and adds another export.
[0] https://github.com/tjmehta/is-positive-integer/commit/3003f9...
[1] https://github.com/tjmehta/is-positive-integer/commit/b47e90... - it should return false for 0, so I'm not sure what the commenter is getting at
[2] https://github.com/tjmehta/is-positive-integer/commit/3cdfe1...
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#807Earlier quoted context omitted.
Worse yet, a backdoor or legitimate bug in any of these module could leave huge exploits in the entire Node.js ecosystem.
A backdoor or legitimate bug in any line of custom code could leave huge exploits in your system. A widely-used published module is likely to be much more reliable, at least on average.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#808Earlier quoted context omitted.
I think it would be annoying but recoverable. It's used so widely that somebody would republish it, at worst under a different name. Edit: But there would sure be a period of chaos.
So it's the same with pad-left. But some how people are wrong for depending on pad-left.
If you depend on 2,000 tiny individual modules, each from different authors, you depend on 2,000 tiny individual modules. You have 2,000 different points of failure. Any one of those authors going rogue will break your build or compromise your system, and every one of those tiny modules has a lot less attention and care paid to it than a larger library like Lodash.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#809Holy moly-- is-positive-integer/index.js: var passAll = require('101/pass-all') var isPositive = require('is-positive') var isInteger = require('is-integer') module.exports = passAll(isPositive, isInteger) I retract my previous statements that Javascript programmers are going down the same enterprise-y mess that Java programmers went down a decade ago. They've already taken it to an entirely different level of insani…
A fun r/programming subthread about this package: https://www.reddit.com/r/programming/comments/4bjss2/an_11_l... Those are just the three top-level dependencies. The package has 9 recursive dependencies. There's also a nice table explaining how a package called "is-positive" managed to reach version 3.1.0.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#810Earlier quoted context omitted.
typeof string == "string" && string.length && string[0] == string[0].toUpperCase() && string[0].toUpperCase() != string[0].toLowerCase();
Man, Javascript is AWESOME .