Your question title is a little bit provoking, since from the text its clear, what you mean is "Are for loops allowed in the “Clean Code” set of rules, except for low-level components". So this is how I interpret your question.
I think this is IMHO a very interesting question, not so trivial as it might look at a first glance. I would not interpret this just in the light of "Clean code" by Bob Martin, but also when looking at "Clean Code" as it is advertised by people like Ralf Westphal (german reference: http://clean-code-developer.de/, try Google translate). His suggestion for what he calls IODA architecture brings the principle "don't mix low and high level" to the extreme. And indeed, in this architecture, you won't find any "for" loops (and no other control structures like conditionals) at the "higher level components" - only at the lower level. The purposes of higher level components in this architecture is exclusively for "plugging" lower level components together.
If you take this really to the extreme, you need to change the structure of every function like
function HighLevelfunction()
sum=0
for i = 1 to upperLimit logic
sum+=LowLevelFunction1(i)
return sum
into
function LowLevelfunction2( func funcAsParameter)
sum=0
' just for demonstration purposes, think not of reusage here
for i = 1 to upperLimit
sum+=funcAsParameter(i)
return sum
Note in the first version HighLevelfunction
depends on LowLevelFunction
, in the second LowLevelfunction2
does not depend on any other function anymore. In the second one, you will need a "higher level" function where the call LowLevelfunction2(LowLevelFunction1)
takes place - but this is simply an integration step, there will be no "for" loop at the higher level needed.
However, doing this for each and every function in a real world program this will probably become soon very impractical. I (and I guess most other programmers, too) draw the line between high level and low level functions, classes or components on a much coarser granularity. One has to find the right balance, and make sure not to write clean code just for the sake of cleanlyness. Or, to say it with the words of Ralf Westphal, "Don’t Let Cleaning-Up Go Overboard".