Bartosz Milewski seems to like D more than C++ now :)
Peter Alexander
peter.alexander.au at gmail.com
Fri Sep 20 01:59:43 PDT 2013
On Friday, 20 September 2013 at 02:24:31 UTC, bearophile wrote:
> At Going Native 2013 there was a very good talk that among
> other things suggests to avoid raw loops in C++ code. But while
> this is good advice (so much that raw loops are becoming a bit
> of code smell for me), there are several situations where
> imperative loops keep being better for me. Explicit recursion
> is not always more readable and more easy to understand than
> imperative foreach loops.
I don't think his advice is to use recursion instead of loops. I
believe the point was that raw loops can usually be replaced by
something more generic (e.g. std::find, std::rotate,
std::transform, etc.). The loop is just an implementation detail
of a more high-level algorithm. Within those algorithms, it's ok
to use loops.
More information about the Digitalmars-d
mailing list