My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
81–90 of 93 posts
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#82PHP makes me so sad.
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#83Earlier 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.
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#84Earlier 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…
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#85Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#86Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#87Earlier 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" :-))
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#88Earlier 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…
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#89PHP makes me so sad.
Re: My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
#90Earlier quoted context omitted.
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? I've never seen that, is it variant on uh oh or something else?
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.