DEV Community

Discussion on: How a developer broke the internet by un-publishing his package containing 11 lines of code

Collapse
 
nbageek profile image
Patrick Minton • Edited

I've always been a bit confused about this. I know it is only 11 lines, but... the idea that everyone should write those 11 lines instead of importing left-pad seems like the exact wrong lesson to learn here.

I am sure if we look hard enough we can find plenty of other 10-15 line functions that solve common problems. Do we believe that all "experienced" JS programmers should write their own versions of these? What about inexperienced programmers? Should we let them write 40-line versions?

It seemed to me that left-pad did precisely what we want open-source software packages to do: solve common problems so that the rest of us don't have to re-invent the wheel. The fact that it is "only 11 lines" is irrelevant. If it were 50 lines, and still broke the internet, would we all just have said "¯\_(ツ)_/¯ nothing we could have done differently here at all!"?

Collapse
 
hungluong profile image
Hung Luong

Exactly this. I remember when this happened a bunch of people went on to "lament" the downgrade of today's developers - because they didn't want to do this stupid function. Apparently being able to left-pad makes one a "true developer".

Obviously dependencies are bad, which means the real question here is why such a trivial function is not in the standard library in the first place.