Doesn't the chained version still iterate over all the elements and squares them before taking the first 3 bigger than 5? the second version only goes over the minimum necessary elements and then breaks. How can the first be higher performance?
No, the iterators are "lazy" (pull-based). Both implementations will perform the same amount of work.
Oftentimes the iterator will be faster, though, because the compiler can reason about what you're doing easier with an iterator vs. iterating via manual sequential indexing.
It would be nice to have a sectioin with things that work differently in both languages. For example in python `if []:` evaluates to False while in javascript `if ([]) {` evaluates to True.
No, the original version is actually the 4chan version. "Ironic shitposting is still shitposting" is the distilled
version we started using later.
Edit: Ok, I stand corrected. After checking it turns out the HN post is probably the source. It's just I saw it posted in its original form on 4chan most often.
Interesting! For many years on 4chan, that quote can be seen in a daily basis and produced hundreds of memes, which trolls and trolls trolling each other for being trolls. But it in fact was actually originated from Hacker News?! Even more interesting, it was originally intended as an exact critique to the 4chan community, but then completely picked up by 4chan and became part of the collective consensus of 4chan, and now ended up as a self-fulfilling prophecy...
I don't like the shitposts or trolling, but always fascinated by them as a social and psychological phenomenon, and the way how idea travels and spreads.