On Fri, Mar 11, 2016 at 8:17 PM, Isiah Meadows <isiahmead...@gmail.com> wrote:
> In my honest opinion, there's not much reason to just require the sort to be
> stable. Some engines have done this in the past, and the spec technically
> allows it. At this point, stable sorts are about as fast as unstable ones,
> both in theory and practice (wasn't the case 10 years ago IIRC).

I think you meant "to not just require", yes?  As in, you think the
spec *should* require .sort() to be stable?

On Sun, Mar 13, 2016 at 12:23 PM, Vic99999 <vic99...@yandex.ru> wrote:
> Stable sort is useful sometimes, but it is possible to implement it in js.

Most things in the JS standard library are possible in userland code,
so that's not a useful rebuttal to anything by itself.  The question
is whether it's worth requiring that the standard sort be stable.
Stable sort is never *bad* - there are no use-cases where a stable
sort gives the wrong answer while an unstable sort is correct, but the
opposite is definitely true.  The only question is how much
slower/more expensiver stable sorting is than unstable sorting, and
whether that cost is sufficient to outweigh the usefulness of a stable
sort.

~TJ
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to