Live data from Hacker News

Left-pad as a service

left-pad.io

261–269 of 269 posts

Re: Left-pad as a service

#261
post #8

Hahaha - isn't it hysterical how everyone using npm for small reusable code pieces! Aren't they morons! How stupid of people to trust their package manager to be consistent and correct and return packages they were expecting. How stupid of people to reuse small often used functions that only do one thing well. How does everyone taking the piss intend to protect themselves from this in their OS package manager, or PPM…

> isn't it hysterical how everyone using npm for small reusable code pieces! Aren't they morons!

Exactly. And no amount of evidence or disasters will ever convince them otherwise, so we all laugh at them.

Re: Left-pad as a service

#262
post #112

Earlier quoted context omitted.

That's not a standard library.

Sure, but one reasonably cohesive library is better than a whole mess of tiny ones.

That's exactly what is up for discussion here. One library with 1000 methods, where you only use 2, is probably not better then a library doing what you need.

Re: Left-pad as a service

#263
post #47
post #8

Hahaha - isn't it hysterical how everyone using npm for small reusable code pieces! Aren't they morons! How stupid of people to trust their package manager to be consistent and correct and return packages they were expecting. How stupid of people to reuse small often used functions that only do one thing well. How does everyone taking the piss intend to protect themselves from this in their OS package manager, or PPM…

> How stupid of people to reuse small often used functions that only do one thing well. This is a straw man argument. The reason so many people are criticizing left-pad et al is about the cost of adding a dependency. > trust their package manager That's exactly the problem: you're assuming that a package manager can be trusted. The network isn't reliable, packages can changed innocently or maliciously, and mistakes h…

Sounds like there's a market opportunity here for a company that does dependency verification. Send them a copy of your npm-shrinkwrap.json file and they ensure every dependency + sub dependency change is legitimate and has no obvious security holes.

There are probably enterprises that would pay good money for this, especially 5+ years from now when these apps are much larger and harder to maintain.

Re: Left-pad as a service

#265
post #76

Tomorrow: left-pad.io announces $120 million investment at $1.2 billion valuation Month from now: left-pad announces purchase of $170 million office building in SV to house their 1200 employees

Two years from now, left-pad.io declares bankruptcy and shut down service. Lather, rinse, repeat.

Re: Left-pad as a service

#266
post #14

This is really exciting!!! I was a bit disappointed that the right-pad will be out only in 2017. I am looking forward to that release because there is a high demand for it now. What kind of load balancing is being used on the back-end? I called leftpad(str, ch, len) with the length I needed and noticed that is not very scalable because it is blocking. A better approach I would recommend to those using it is to call t…

I really hope I can get this as a NuGet package. This new LPaaS is the wave of the future!!!1

Re: Left-pad as a service

#269

Earlier quoted context omitted.

Best practice for performance for large left-pad jobs is to call the service recursively using mapreduce. Remember that left-pad(str,pad,n) is equal to left-pad(left-pad(str,pad,n/2),left-pad("",pad,n/2),n). This should run in logarithmic time and is highly parallelizable. If you don't like the "" magic string in there you could replace it with a call to left-pad(null, null,0).

oh god it's too real

if you put https://api.left-pad.io/?len=1017 or anything higher than 1016 it says:

{"errorMessage":"len exceeds 1007 characters. Contact a left-pad.io sales engineer for an enterprise license","errorType":"Error","stackTrace":["exports.handler (/var/task/index.js:33:22)"]}

wow. they even have an enterprise sales engineer! :)

Post reply on HN