My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
61–70 of 88 posts
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#62Crazy that the bug went unnoticed. So many sites must have been broken by the "a" bug.
It only kicks in in the presence of a trailing / - perhaps this is rare where the function is commonly used.
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#63Earlier 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 wouldn’t say it’s broken, I’d say there are tradeoffs, and devs have known this and discussed it since the start of npm or any package manager. You automatically get some bloat when you use other people’s software. That’s the downside. The upside is you don’t have to write the code yourself and you can create things more quickly by not solving problems that others have already solved.
It’s worth noting that AI has some of the same tradeoffs. The quality of what you get is still proportional to your prompting & reviewing effort, and spending low amounts of effort often results in similar amount of bloat.
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#64Author 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.
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#65Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#66Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#67This is top-tier. left-pad levels of "we should just implement trivial functions in our own codebases"
(I do not mean that as a knock on the author - it solved his use case just fine. Everyone who took a dependency on it afterward though...)
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#68> Under a comment that reads // Workaround for trailing slashes, my code tacks an “a” onto the path so there’s always a last segment to cut off, then cuts it off with a find-and-replace. When the path ends in a slash, that last segment is just the “a”, and the find-and-replace takes every other “a” in the path with it. This is top-tier. left-pad levels of "we should just implement trivial functions in our own codebas…
Author: Ugh, this is ugly, but it fixes the specific problem I’m having so I can go on and work on other things.
Author, later: What do you mean, you’re all using this?
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#69Are you from Nebraska?
And then, a year later, I got invited to a PostgreSQL convention in Brazil where it was one of the tools being quasi-formally recommended to help migrate the country off of VFP.
The world can feel awfully freaking small sometimes.
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#70Earlier 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 don’t think it ever made sense. Code reuse improves efficiency when the code can be shared in memory, or when it needs to be updated and you only have to change it in one place. JS packages don’t give you sharing beyond what you’d get from copying the code. And these little things don’t need to be updated, and in fact you probably don’t want them to be. It’s a case of doing something without understanding why it’s…
Also, way more fun.