Mercurial was accidentally quadratic:https://accidentallyquadratic.tumblr.com/post/161243900944/mercurial-changegroup-application …
you can't swap list for set in 5 chars if their "contains" methods have different signatures.
-
-
Yeah, that's why I hedged with “My first point notwithstanding”; I think there's fundamental tension here and I don't have a general answer
-
Fwiw I'm in favor of sacrificing consistency. Lots of methods that are O(n) across data structures that can still form an API.
-
but eg for Array I'd almost prefer an explicit "any?{|x| x == y}" to "include?"
-
Yeah, in this case I agree. O(n) vs O(1) in a general-purpose data structure shouldn't be glossed over.
-
But in specialized data structures where n is known to be small, maybe it's fine. And (e.g.) O(lg n) and O(1) are often interchangeable.
-
"What do you specify, and what do let the backend vary?" is a fundamental tension of interface design in general (1/2)
-
I think this question is thus just a special case ofhttps://twitter.com/nelhage/status/851814390210846721 …
-
and then you have DBMS query planners...
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.