Live data from Hacker News

Left-Pad (2024)

azerkoculu.com

61–70 of 224 posts

Re: Left-Pad (2024)

#61
post #19

> I have to admit that I don't understand half of this blog post It's because you haven't read al-Ghazali yet. (definitely the most pompous and self-important part of this post)

Who is al-Ghazali? I searched and found the Iraqi phisolopher, but couldn't understand how he is related

Re: Left-Pad (2024)

#62

Earlier quoted context omitted.

In each loop prepending a single character could take O(m) (moving all m characters one to the right) so combined O(nm) where n is the number of padding characters and m is the total number of characters in the string.

Only when the underlying JS implementation does this naively. In reality JS implementations do a lot of optimizations which often can reduce the time complexity.

"The compiler will take care of it", funny, heard that one before, I'd profile it just to be on the safe side...

Re: Left-Pad (2024)

#63
post #19

> I have to admit that I don't understand half of this blog post It's because you haven't read al-Ghazali yet. (definitely the most pompous and self-important part of this post)

> Not driven by logic, anger... I don't know that I fully buy this either, at least not the anger part. I can look back on all this with wry amusement nowadays but I remember it being pretty frustrating at the time. It sort of felt like, well, either you knew what the impact of unpublishing all your packages would be and you did it anyway, which makes you kind of antisocial, or you didn't know what the impact would b…

The 3rd option is the one Azer describes in the post:

He wants to remove his stuff, but isn't sure what the right way to do it is, so he asks npm. npm provides him with a set of scripts to run to remove his stuff, and he, presuming that it's "ok" if npm told him to go ahead and run them, runs them. The impact isn't especially important to him, But since npm just gave him a set of scripts with an implicit "oh okay you want to remove your stuff, here I wrote you a script you can run to get it done," makes it more of an npm choice to handle it in this manner. npm asked him to handle it this way, so he did.

Re: Left-Pad (2024)

#64

Earlier quoted context omitted.

Only when the underlying JS implementation does this naively. In reality JS implementations do a lot of optimizations which often can reduce the time complexity.

"The compiler will take care of it", funny, heard that one before, I'd profile it just to be on the safe side...

I didn't mean that. JS doesn't have any lower-level interface for handling memory, so such optimization has to be in the implementation. It should be quite obvious that relying on such optimization can be problematic.

Re: Left-Pad (2024)

#66
Unix philosophy is "do one thing, do it well". Left-Pad forgot about the second part.

For me it was surprising that so many projects used this naive implementation. Nonnaive implementation is faster and much smaller.

Re: Left-Pad (2024)

#67
post #19

> I have to admit that I don't understand half of this blog post It's because you haven't read al-Ghazali yet. (definitely the most pompous and self-important part of this post)

Who is al-Ghazali? I searched and found the Iraqi phisolopher, but couldn't understand how he is related

We westerns do the know much about the Socrates from the eastern side of the world. I can only imagine people from there know who al-Ghazali was just like we know who Sartre was.

So, im gonna try and read something by al-Ghazali.

Re: Left-Pad (2024)

#68
post #19

> I have to admit that I don't understand half of this blog post It's because you haven't read al-Ghazali yet. (definitely the most pompous and self-important part of this post)

> Not driven by logic, anger... I don't know that I fully buy this either, at least not the anger part. I can look back on all this with wry amusement nowadays but I remember it being pretty frustrating at the time. It sort of felt like, well, either you knew what the impact of unpublishing all your packages would be and you did it anyway, which makes you kind of antisocial, or you didn't know what the impact would b…

Not to dump on the author, but following the Serenity Prayer would have led to a happier outcome...

grant me the serenity to accept the things I cannot change; courage to change the things I can; and wisdom to know the difference

Re: Left-Pad (2024)

#69

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

haha, so, all of this for… nothing in the end?

The kik user page almost says it all. https://www.npmjs.com/~kikinteractive One person in the company thought this would be cool to be on NPM, then ... the lpad story.

Re: Left-Pad (2024)

#70

Earlier quoted context omitted.

> Not driven by logic, anger... I don't know that I fully buy this either, at least not the anger part. I can look back on all this with wry amusement nowadays but I remember it being pretty frustrating at the time. It sort of felt like, well, either you knew what the impact of unpublishing all your packages would be and you did it anyway, which makes you kind of antisocial, or you didn't know what the impact would b…

The 3rd option is the one Azer describes in the post: He wants to remove his stuff, but isn't sure what the right way to do it is, so he asks npm. npm provides him with a set of scripts to run to remove his stuff, and he, presuming that it's "ok" if npm told him to go ahead and run them, runs them. The impact isn't especially important to him, But since npm just gave him a set of scripts with an implicit "oh okay you…

What would the alternative have looked like?

If NPM would have prevented the depublishing, he would have made a scene and in the worst case, they would have looked bad.

How they actually handled it, the library author got full freedom but also full responsibility

Post reply on HN