On 05/16/2012 09:29 AM, bearophile wrote:
Kirill:

How about users who don't know what binary search is. binary search is
an intuitive concept for people who have good programming experience
but assumeSorted(r).contains(x) is more intuitive to higher level users.

Even if you don't know the name "binary search" (something that all CS
students learn very early in their studies, a concept that is also
taught in "Unplugged CS" to little children) how can you be sure that
"assumeSorted(r).contains(x)" will perform a "fast search" like when you
search people names in a sorted sequence?


By assuming the library writer is sane, or by reading the documentation.


So in short, I support that Andrei aims for larger audience.

Then why is Andrei using the name std.algorithm.schwartzSort? For every
20 CS students and programmers that know what a "binary search" is, you
probably get only 1-4 that know what a "Schwartz Sorting" is. So I think
your explanation of Andrei aim doesn't hold water.


I agree, that the explanation does not hold water, not because of other parts of the API, but simply because binary search is such a basic concept that I wouldn't trust a programmer who does not understand it.

Reply via email to