in reply to Re: I hate nested loops
in thread I hate nested loops

I was kind of hesitant to post this as it might motivate people jump to computational efficiency as a means of driving coding decisions,

Once you put the code into a subroutine, all you need to do is give it a good name, say init2Dhash() or whatever makes sense in the context of the code, and what idiom is used inside the sub becomes irrelevant.

At that point, you might as well go for the most efficient solution.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.