Alf said:
* Kai-Uwe Bux:
That's a fact.
So far, I only see a claim
For the record: I strongly agree with the sentiment that generic algorithms
that require functors leave much room for improvement on readability. We
had a recent thread here:
http://groups.google.com/group/comp.lang.c++/browse_frm/thread/47f5e807f65896e2/
where the alleged single-line solution in STLeese was very much buggy and
the corrected version was very much non-readable.
However, as a purely empirical matter, I am neither convinced that the use
of STL algorithms "tends to introduce" the kind of bug pointed to above
nor, say, that STL loops tend to be more buggy than their hand-coded
counter parts.
On a more general note: The anti-correlation of buggyness and readability is
a complex matter. I know pieces of code that are bug-free _because_ they
are highly non-readable. This may happen in math-programming for instance
when you follow a published algorithm like LLL-reduction and implement it
so that code resembles the version form the original paper as closely as
possible; very often you will end up using strange variable names
and "goto" all over the place. The advantage is that you have an algorithm
that is proven correct.
I fail to see how a fact can be an attitude.
Sometimes, pointing out certain facts can be indicative of an attitude.
_However_, neither do I claim nor do I want to imply that (a) your statement
is indicative of an attitude of yours, or (b) that you have pointed out a
fact.
If you
want examples just check recent threads in this NG: in many cases,
nobody know quite why something works or why something doesn't work. It
reduces programming to try-and-fail experimention. And as those experts
and authorities who have addressed this issue recommend, the only sane
way to proceed is to either don't use it or else to employ at least two
different compilers and keeping always updated with latest versions.
Could you please be more specific and provide some pointers. There are
many "recent threads" in this NG and I would appreciate if you could point
toward those that you think provide data points your claim.
[snip]
I think Verity says it better than any statistics: <url:
http://www.regdeveloper.co.uk/2006/08/08/cplusplus_loops/>.
Thanks a lot! I enjoyed reading that (especially since I sympathize with the
sentiment).
However, it does not actually present any data in support of the claim that
generic algorithms tend to introduce the kind of bug you pointed out.
Best
Kai-Uwe Bux