News for hackers. Stuff that matters.
Re:Code Smells: Iteration by jstimpfle on Wednesday August 23, 2017 @11:50AM (#15082481)
What is the "most restrictive" form? The answer to this question is highly context dependent (for example, programming language / architectural framework) and expensive to give. Remember that everything has a cost. And especially overzealous formalism.

Personally I find simple C index-based for loops consistent and refreshing. And it's typically not a huge deal. If it is, the procedure might be doing too many things at once. (But yes, I use simple "for x in y" style loops in Python or C++ when they make the lion's share of the loops).

Many different types of loops in a single file, over a single datastructure, always remind me of odd syntax highlighting (for example in vim) in so many different colors that it's only a distraction. I don't care to make so many distinctions. I try to focus on the distinctions that we have to make to get a program done.

Re:Code Smells: Iteration by nemetroid on Wednesday August 23, 2017 @12:13PM (#15082710)
Map-style iteration carries more semantic information than a C-style index based loop. An index based loop might be doing anything with the data being iterated over. When you do collection.map, already at first glance you get an idea about what the code is doing.
Re:Code Smells: Iteration by jstimpfle on Wednesday August 23, 2017 @06:03PM (#15085619)
Yep - and nobody cares. Write clean code instead. Much harder than simply changing the looping style.