Albert Wagner wrote:

> I think you're right.  But you also bring up a point not often discussed
> re:
> style.  Assuming it worked:  which is most efficient?  The second has
> overhead the first doesn't need.

Looking back in the mailing list, it appears this entry in the style guide 
came from discussions of the article for DevWorks that's being discussed.

In that context, it actually makes sense, since nothing else is being done 
with the data other than reading it and then writing it, tab-delimited, to 
a file.  Of course, that wouldn't be true in a complete implementation, one 
would guess.

However, as a code snippet, outside such a context, I assumed there was a 
reason for the three variables in the first example (ie, that they would be 
used for other purposes further down in the code).

Hence, replacing that code with a loop where the three data items end up 
being just values that occur during the iterations changes the meaning (to 
me, at least).

If the code is shown as a snippet then I think the semantics of the 
original should be maintained in the replacement, but other people may 
disagree with me .. it's been known to happen :-).

As for efficiency, I have no problem with writing less efficient code if 
it's clearer, but there are certainly situations where efficiency is ultra 
important.

Perhaps the style guide should have a separate section on efficiency 
clean-ups?