The set-operatic approach of jquery is one I absolutely love about it, though it does lead to unforeseen behaviours in edge cases (sometimes performance concerns running code on nothing or on way more than expected) it's leads to extremely convenient and fluent code, much more so than the explicit iterations of the normal DOM.
> More often we expect something to happen, and the cases where the results might be empty are obvious enough that adding a “fail silently” flag in those cases wouldn’t be a hardship.
Extending jquery to assert a lower bound (and even an upper bound as well) wouldn't be a hardship either.
So when I saw jQuery for the first time, I’d already been primed for this concept. I’m a little surprised it’s been used so infrequently.
More often we expect something to happen, and the cases where the results might be empty are obvious enough that adding a “fail silently” flag in those cases wouldn’t be a hardship.
Biggest category of bugs I had to help people with, aside from performance regressions from abusing reflow.
As hardships go, I’ve had worse with other frameworks. But if I could g9 back in time or if I were trying to make a workalike...