Live data from Hacker News

Left-Pad (2024)

azerkoculu.com

31–40 of 224 posts

Re: Left-Pad (2024)

#31
post #25

Earlier quoted context omitted.

The package's original implementation[1] also seems like it would have resulted in O(n^2) operation rather than desired O(n). [1] https://en.wikipedia.org/wiki/Npm_left-pad_incident

I don't see where the quadratic time complexity comes from. There's a single loop performing n operations in total, ie. O(n).

The line `str = ch + str` is itself a linear-time operation, with time proportional to the length of the new string.

That linear-time operation is then additionally repeated `len` times

Re: Left-Pad (2024)

#32

left-pad even being a package is pretty funny, no? How many bytes got pumped across CDNs, proxies, build pipelines, etc. just to write a tiny utility function? I'm all for taking advantage of existing solutions, but I can't wrap my head around needing to pad a string and thinking "oh, I bet there's a package for that"

Isn't it similar with AI now?

How many prompts can already be solved with a simple web query?

C&P but with extra steps

Re: Left-Pad (2024)

#33

The version history of the kik package[0] is odd. It has been replaced with a security holding package nine years ago[1]. [0] https://www.npmjs.com/package/kik?activeTab=versions

I think this is the biggest irony of it: the kik package, which kik where so desperate to have, is basically sweet Fanny Adams. Also, Kik turn out to be negligent and pretty scummy. There was some controversy with them involving crypto, but the main thing I remember about them is that Kik is rife in terms of trading pornography, including child pornography, as discussed on this Darknet Diaries episode: https://darkne…

>Also, Kik turn out to be negligent and pretty scummy.

turns out?

they threatened a pre-existing naming collision with legal action and bullied the platform first into forcing the name to be theirs, and then afterwards by crying to npm until their software tests passed again.

they began scummy.

Re: Left-Pad (2024)

#34
post #16

It's a minor thing, but: > Most of my open source work followed Unix philosophy, so the packages did one thing at a time. Nobody has suggested that libc -- to take the most obvious example -- is against the Unix philosophy. Debates occur around whether whether commands / daemons do too much (recent poster child being systemd) or aren't composable.

The "unix philosophy" is a useless philosophy - perhaps worse than useless even - because "one thing" is not well defined, so in practice it adds nothing and just leads to arguments.

You could say that Eclipse does "one thing" - being an IDE platform - but I don't think anyone thinks that's what the Unix devs meant. Similarly I don't think they meant for people to write libraries that contain one 11-line function.

The actual advice should be something like "programs/libraries shouldn't try to do too much or too little". How do you know how much is too much or too little? Like so many programming guidelines the answer is you need taste and experience.

Re: Left-Pad (2024)

#35
post #20

Maintainer of a few top-10 npm packages here. This makes complete sense. Somewhere along the way NPM stopped being cooperative with the community. It cemented itself with the Microsoft acquisition, but was obvious quite a bit before that. There were so many cracks with how npm functioned, they weren't cooperating well with the community / mainline Node team, their push to commercial viability was really off-putting a…

It wasn’t the first package manager for a programming language and plenty of us pointed out the folly of packages that small.

Npm (and JS in general) is a victim of fashion, primarily.

Re: Left-Pad (2024)

#38

Why Java can have reliable utility libraries such as Apache Commons and Google Guava, but JS somehow cannot?

In decreasing order of importance: culture, a good standard library, and tooling that pushes you to be deliberate about your dependencies rather than dumping 300 stupid packages inside every project.

Re: Left-Pad (2024)

#39
post #16

It's a minor thing, but: > Most of my open source work followed Unix philosophy, so the packages did one thing at a time. Nobody has suggested that libc -- to take the most obvious example -- is against the Unix philosophy. Debates occur around whether whether commands / daemons do too much (recent poster child being systemd) or aren't composable.

The obverse to 'do one thing' is that you have to do the whole thing.

Re: Left-Pad (2024)

#40

NPM (well Microsoft) forcibly took guy's package to give the name to this company: https://www.bbc.com/news/uk-45568276 Since then the name is basically squatted? Whether you use left-pad or not is up to you... but this Kik story is just a bad look for Microsoft all around.

You're aware this happened way before the Microsoft acquisition right?

> You're aware this happened way before the Microsoft acquisition right?

you phrasing implies that you would say what I said if you knew that acquisition happened later. Weird but OK.

Anyway then let's just say it is a bad look for NPM and any future buyers who decided this is a worthy company

Post reply on HN