Topic: Computational Complexity (was: problems with locale and its facets)


Author: "Greg Colvin" <spam@me.not>
Date: 1998/06/28
Raw View
Jerry Coffin <jcoffin@taeus.com> wrote in article
<MPG.ffd92c73c7220a989b53@news.rmi.net>...
> In article <6mtjpa$k1$1@nnrp1.dejanews.com>, saroj@bear.com says...
>
> [ ... ]
>
> > I disagree! Whether to use linear search or not, should not be done
> > by the implementor of map, but should be decided by the programmer.
>
> Why?  The implementor has already done exhaustive testing and proven
> that for the largest possible collection on this machine, that a
> linear search will _always_ be faster than a tree based lookup.

Then what prevents that implementor from conciously deviating from
the standard?  Who would complain?  A customer?  Hardly.  A conformance
tester?  Perhaps, so you put in a PEDANTIC flag to satisfy the tester.

> ...
> The programmer rarely if ever has access to the information necessary
> to make an intelligent and informed decision about what's going to
> work best in a given situation.  The implementation does.  You rarely
> if ever have access to the information necessary to decide whether the
> sorting algorithms in the library will be optimal or not.  Again, the
> implementation does.

I have always had access to the information I needed to choose which
algorithms and data structures are best for my applications.  I study,
I calculate, I test, and I choose.  That's my job.  I am glad that the
standard provides me with choices, and I do not trust any implementor
to make those choices for me.

I can appreciate that there could be a use for some more abstract
collections and algorithms whose specification is "whatever the
implementer thinks best" but those happen not to be the ones the
standard provides.

Greg Colvin
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]