Hacker Newsnew | past | comments | ask | show | jobs | submit | junon's commentslogin

Care to expand?

Ever put your password into a website that used cloudflare? Ever registered an account with Gmail? Ever had an Android or iOS phone?

I.. kind of like it? Aware that it isn't great and that I'm in the minority.

Just like all the other attempts at this, it's immediately filled with 1) AI content, and 2) anti-semitism.

I didn't see either in the few questions I cycled through, but in general the content was complete garbage, like Yahoo Answers quality of response.

It reminded me that the average quality of writing on a completely open Internet forum is depressingly low.


I didn't know about this but of NLnet history. I assumed you had been mistaken so I looked it up. That's really cool!

Yes, it's absolutely true. We used to provide internet connectivity and fund open source projects with the profits. Now we fund open source projects as a service and from donations.

https://nlnet.nl/foundation/history/


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 `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'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.


Additional Context: for about two years functional programming was REALLY popular in the Node community. It was a fad to chain tons of tiny functions together, and thus lots of people wrote tons of tiny functions. This is why lodash/fp exists.

Yes and the critical issue was tree shaking. Nowadays we have tree shaking so it doesn't matter as much but in the past people preferred small single function packages because they had less impact on the download size.

IsOdd and IsEven never made sense. They were a badge of shame that said "I have no idea how to program".

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) returns true now...


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


Sorry, it's supposed to be power. So 2**55 in JavaScript

2 to the 55th power is obviously even, so that +1 is obviously odd, but ((2*55) +1) % 2 == 0 in JavaScript.


But there's no bug in isOdd. You're sending the number 36028797018963970 into it, which is clearly even.

Putting extra code between the parentheses of the function call doesn't make it the function's responsibility. As nice as it would be for debugging if you could stuff your entire program inside of isNaN((function(){ /* your code here */ })()) and force your browser vendor to fix all problems.


You should check the math on a real calculator.

Despite what most JavaScript implementations will tell you, 2 to the 55th power is 36028797018963968, and adding one to that value is 36028797018963969. That's clearly odd.

There is no extra code between the parens. I just put them there so there wouldn't be any question as to operator precedence. I do see now that hn ate my double star, but I think you know what I mean since you told me the value that is spits out when you do the exponentiation


> There is no extra code between the parens.

You have a plus and an exponentiation in there. That's code.

  var n = 2**55 + 1
  console.log(n)
  isOdd(n)
n is 36028797018963970. isOdd(n) is giving you the right answer. Putting the +1 inside the parentheses and talking about calculators is a sleight of hand that lets you pretend isOdd gets an odd number, but it doesn't. No odd numbers are around by the time isOdd actually does anything.

The problems are in + and/or our expectations of +. It does not output 36028797018963969, and we must acknowledge that.


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


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.


This is all very easy to say in hindsight. It's missing the context of having been there, I think. Things were just different.

Also, way more fun.


I was definitely saying it at the time. But I wasn't embedded in the ecosystem, it was very much "those JavaScript guys are nuts, why would they do this?"

[flagged]


"The road to Hell is paved with good intentions". Still true, probably thousands of years after the sentence was coined.

I think a lot of things end up that way, just at different timescales. Best we can do is learn from them and start again, IMO - however that looks.

Noob comes from newb, which comes from newbie. Some argue it comes from "nubile" but I don't personally buy that etymology. I distinctly remember "newb" followed by "noob" but that was eons ago.

Always thought it was "new" but made to sound like "boob" because it's funny.

And not related to Safire's "nattering nabobs of negativism," the originals of whom SF's Nob Hill eponymizes.

TIL they have their own ASN. This is helpful, thanks.

Do you live in Germany?

do u live in russia?

No, Germany.

> Golden Dome

Trump seemingly cannot resist the classic opportunity for a "1up", can he?


Finally.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: