Live data from Hacker News

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

jakeasmith.com

91–100 of 100 posts

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

#92
post #84

Earlier quoted context omitted.

Ut oh? I've never seen that, is it variant on uh oh or something else?

It's something I'm fighting for in my own little way. Everyone does a glottal stop between the "uh" and "oh", so I'm trying to align the spelling Unlike the guy on him who writes all years with 5 digits like 02026, I have good reasons for my idiosyncracies.

Hm, I would not spell it with a "t" then, but maybe with an apostrophe instead.

"Uh'oh" is more readable in my opinion and won't be mispronou in ced

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

#94

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

is-even implementation:

> 'use strict';

> var isOdd = require('is-odd');

> module.exports = function isEven(i) {

> return !isOdd(i);

> };

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

#95
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…

You want to implement your own is-odd in your code - simple, right? isOdd = (x) => x % 2 == 1 Ut oh, your code is broken for negative numbers now since % isn't a true modulo operator... Fine then, isOdd = (x) => x % 2 != 0 Ut oh, your code is broken because isOdd("hi") returns true now... Fine then, isOdd = (x) => if(!isNumber(x)) throw... else return x%2 != 0 Ut oh, your code is now broken because isOdd(2^55+1) retu…

> Ut oh, your code is now broken because isOdd(2^55+1) returns true now...

I think you messed up this example. Whether I literally use "2^55" with XOR or replace it with "2*55", that version of isOdd returns false.

False for isOdd(58) is obviously correct. (Also thanks C for permanently screwing up the precedence of bitwise operations because you didn't want to break some existing programs in 1972.)

False for isOdd(36028797018963970) is also correct, and if you expected to send in a different number the bug is in the "+1" not the isOdd.

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

#96

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

is-even implementation: > 'use strict'; > var isOdd = require('is-odd'); > module.exports = function isEven(i) { > return !isOdd(i); > };

I thought you were joking, but then I checked the code... holy shit, it is real.

Surely the author's gotta be trolling, right?

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

#97
post #43

Omg, PHP... I ditched this language 7 years ago, because I was fed up with the context switching (fullstack webdev). In the beginning I really was enjoying the gentle slope of learning. I could do a lot without knowing what classes, objects and types are. And I am grateful for this, because thanks to it, now I am here where I can do much more powerful things knowing classes, objects, types and paradigms

PHP kept on getting professional attention and development, and so now it also has all those things you mentioned.

Yes, but also Wordpress still exists and keeps the old ways of doing things.

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

#98
post #71

Earlier quoted context omitted.

Nothing is more permanent than a temporary solution.

"it was written by that guy 5 years ago,but he left; so nobody is in charge and nobody understands it anymore, but it still works perfectly and we do not need any upgrades" :-))

"he also left this little BTC mining server in the back room, but it's so nice and warm in there now we just left it running"

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

#99

Earlier quoted context omitted.

"it was written by that guy 5 years ago,but he left; so nobody is in charge and nobody understands it anymore, but it still works perfectly and we do not need any upgrades" :-))

"Okay, that's just about the end of your training, any quest-OH, Don't forget, you can never ever turn off the light in the storage closet! It is cursed and the company cannot function while the switch is off. Yes I know there's no lightbulb. No we do not know why. If we knew why it wouldn't be that way."

"No, we don't know why the two positions of the switch are labeled "magic" and "more magic".

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

#100

> 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…

Heh, right? 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?

hahaha yes, this exactly
Post reply on HN