‹ 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. zarzavat · · focus · HN ↗
            Yes and the critical issue was tree shaking. Nowadays we have tree shaking so it doesn&#x27;t matter as much but in the past people preferred small single function packages because they had less impact on the download size.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.