NPM and Left-Pad: Have We Forgotten How to Program?
haneycodes.net
NPM and Left-Pad: Have We Forgotten How to Program?
1–10 of 887 posts
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#2In reality it could take an hour to get this working properly, but it does take only a couple minutes to verify that the solution here is correct. There are certainly good reasons for not adding extra dependencies to your project, but trading a known amount of time to check that an existing project does what you want for an unknown amount of time to redo it yourself is probably not a great bet.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#3I recently had to rebuild a large RoR app from circa 2011 and it took me longer to solve dependencies issues than to familiarise myself with the code base.
Excessive dependencies are a huge anti-pattern and, in our respective developers communities, we should try to circulate the idea that, while it's silly to reinvent the wheel, it's even worse to add unnecessary dependencies.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#4As a python developer I would never publish a small package, simply due to the overhead of setting up a PIP package.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#5That said, I work with Java, Clojure and Python mostly so I may be more used to having a huge standard library to lean on than is typical.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#6However, I agree it is ridiculous to have a dedicated module for that one function. For most nontrivial projects I just include lodash, which contains tons and tons of handy utility functions that save time and provide efficient, fast implementations of solutions for common tasks.
Lodash includes `padStart` by the way (https://lodash.com/docs#padStart).
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#7 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 insanity.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#8I've got two dependencies besides the basic framework my project is built on: A scheduling engine, and a database interface. I eventually hope to factor out both.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#9I use lodash in almost every javascript project I start, big or small because it makes my life easier.
I'd rather use the lodash isArray than roll my own.
Re: NPM and Left-Pad: Have We Forgotten How to Program?
#10It takes more than two minutes. That little module has a test suite, if you're including it then you have some assurance it does what it says it does. If you write it you've got to worry about whether it works or not.