‹ BackHN Continuity

Thread

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

341 points · 107 comments · jakeasmith

  1. jakeasmith · · focus · HN ↗
    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.
    1. HackerThemAll · · focus · HN ↗
      The JavaScript world is littered with stuff comparing to which your patch seems like a complex project. See those examples:

      <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;is-odd" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;is-odd

      <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;is-even" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;is-even

      <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;left-pad" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;left-pad

      <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;is-whitespace-character" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;is-whitespace-character

      <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;isarray" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;isarray

      1. JaggerJo · · focus · HN ↗
        what a broken ecosystem.. The crazy thing is not that the package exists, but that it is used by JS devs.
        1. junon · · focus · HN ↗
          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&#x27;t a thing, and while `isodd`&#x2F;`iseven` are of course silly, things like `isarray` were not functions that existed back then (we didn&#x27;t have Array.isArray). `typeof [] === &#x27;object&#x27;` 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&#x27;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&#x27;s what you&#x27;re seeing.

          1. wat10000 · · focus · HN ↗
            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 done. Packages are good, code sharing is good, so use it for everything. But it misses why they’re good.

            1. junon · · focus · HN ↗
              This is all very easy to say in hindsight. It&#x27;s missing the context of having been there, I think. Things were just different.

              Also, way more fun.

              1. wat10000 · · focus · HN ↗
                I was definitely saying it at the time. But I wasn&#x27;t embedded in the ecosystem, it was very much &quot;those JavaScript guys are nuts, why would they do this?&quot;
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.