My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
Thread
Unofficial Hacker News client; not affiliated with Y Combinator.
My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it
Unofficial Hacker News client; not affiliated with Y Combinator.
jakeasmith · · focus · HN ↗
HackerThemAll · · focus · HN ↗
<a href="https://www.npmjs.com/package/is-odd" rel="nofollow">https://www.npmjs.com/package/is-odd
<a href="https://www.npmjs.com/package/is-even" rel="nofollow">https://www.npmjs.com/package/is-even
<a href="https://www.npmjs.com/package/left-pad" rel="nofollow">https://www.npmjs.com/package/left-pad
<a href="https://www.npmjs.com/package/is-whitespace-character" rel="nofollow">https://www.npmjs.com/package/is-whitespace-character
<a href="https://www.npmjs.com/package/isarray" rel="nofollow">https://www.npmjs.com/package/isarray
JaggerJo · · focus · HN ↗
junon · · focus · HN ↗
So of course they don'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's what you're seeing.
IncreasePosts · · focus · HN ↗
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) returns true now...
rtkwe · · focus · HN ↗
IncreasePosts · · focus · HN ↗
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.
luplex · · focus · HN ↗
"Uh'oh" is more readable in my opinion and won't be mispronou in ced