Live data from Hacker News

My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

jakeasmith.com

11–20 of 78 posts

Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

#11

Author here, happy to answer any questions. I never imagined a polyfill for http_build_url would gain so much traction. After 12 years, deprecating it feels like the right move, especially given the new options from the community and PHP itself.

The JavaScript world is littered with stuff comparing to which your patch seems like a complex project. See those examples:

https://www.npmjs.com/package/is-odd

https://www.npmjs.com/package/is-even

https://www.npmjs.com/package/left-pad

https://www.npmjs.com/package/is-whitespace-character

https://www.npmjs.com/package/isarray

Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

#13

Author here, happy to answer any questions. I never imagined a polyfill for http_build_url would gain so much traction. After 12 years, deprecating it feels like the right move, especially given the new options from the community and PHP itself.

The JavaScript world is littered with stuff comparing to which your patch seems like a complex project. See those examples: https://www.npmjs.com/package/is-odd https://www.npmjs.com/package/is-even https://www.npmjs.com/package/left-pad https://www.npmjs.com/package/is-whitespace-character https://www.npmjs.com/package/isarray

what a broken ecosystem.. The crazy thing is not that the package exists, but that it is used by JS devs.

Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

#14

Earlier quoted context omitted.

The JavaScript world is littered with stuff comparing to which your patch seems like a complex project. See those examples: https://www.npmjs.com/package/is-odd https://www.npmjs.com/package/is-even https://www.npmjs.com/package/left-pad https://www.npmjs.com/package/is-whitespace-character https://www.npmjs.com/package/isarray

what a broken ecosystem.. The crazy thing is not that the package exists, but that it is used by JS devs.

There’s a bit more nuance as to why. It’s not fair to say that the average JS dev is reaching for a package like is-odd/is-even.

Years ago when npm was just getting started there was a lot of experimentation and land grabbing for packages. A few “prolific” developers were pushing these tiny utilities and then using them in their own projects which ended up being required as deps in other projects and then snowballed into is-odd being included in webpack at some point (I think I have that timeline roughly correct).

It’s still a crappy problem for sure but it’s not fair to paint most JS devs with a brush so broad.

Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

#17

Earlier quoted context omitted.

The JavaScript world is littered with stuff comparing to which your patch seems like a complex project. See those examples: https://www.npmjs.com/package/is-odd https://www.npmjs.com/package/is-even https://www.npmjs.com/package/left-pad https://www.npmjs.com/package/is-whitespace-character https://www.npmjs.com/package/isarray

what a broken ecosystem.. The crazy thing is not that the package exists, but that it is used by JS devs.

I feel like I have to remind people of this quite often, but the history is such that npm was lightweight at one point, bundling wasn't a thing, and while `isodd`/`iseven` are of course silly, things like `isarray` were not functions that existed back then (we didn't have Array.isArray). `typeof [] === 'object'` in JS, so e.g. my package `is-arrayish` checked for a similar structure to an array (whereas Id guess `isarray` checked for the prototype). `isarray` failed for the `arguments` keyword, which was needed for variadics before argument spreads were added to the language I believe in ES5.

So of course they don't make sense now. But they were created for a reason. Before even Markov chains were a fad - let alone LLMs - we were trying to be as efficient as possible and maximize code reuse I stead of writing the same helper functions over and over again. That's what you're seeing.

Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

#18
post #17

Earlier quoted context omitted.

what a broken ecosystem.. The crazy thing is not that the package exists, but that it is used by JS devs.

I feel like I have to remind people of this quite often, but the history is such that npm was lightweight at one point, bundling wasn't a thing, and while `isodd`/`iseven` are of course silly, things like `isarray` were not functions that existed back then (we didn't have Array.isArray). `typeof [] === 'object'` in JS, so e.g. my package `is-arrayish` checked for a similar structure to an array (whereas Id guess `isa…

I hate to bring politics into such discussions, but this thought struck me as funny.

The hubris of humanity... what you're describing is akin to the US Constitution and the Founding Father's goals, ending in Donald Trump.

Node is the same horror.

Nice ideas, great premise, and all turned to garbage in the end.

Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

#19
post #18
post #17

Earlier quoted context omitted.

I feel like I have to remind people of this quite often, but the history is such that npm was lightweight at one point, bundling wasn't a thing, and while `isodd`/`iseven` are of course silly, things like `isarray` were not functions that existed back then (we didn't have Array.isArray). `typeof [] === 'object'` in JS, so e.g. my package `is-arrayish` checked for a similar structure to an array (whereas Id guess `isa…

I hate to bring politics into such discussions, but this thought struck me as funny. The hubris of humanity... what you're describing is akin to the US Constitution and the Founding Father's goals, ending in Donald Trump. Node is the same horror. Nice ideas, great premise, and all turned to garbage in the end.

I think a lot of things end up that way, just at different timescales. Best we can do is learn from them and start again, IMO - however that looks.

Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

#20

Author here, happy to answer any questions. I never imagined a polyfill for http_build_url would gain so much traction. After 12 years, deprecating it feels like the right move, especially given the new options from the community and PHP itself.

I’d say the deciding factor is that it has bugs where both fixing and not fixing them can have a negative impact. If there were no known bugs and there was no harm in using it, I’d probably just leave it there and not disturb anything, given that its use is so widespread, and instead merely note in the documentation that its purpose has become obsolete.
Post reply on HN