2 ms·
No duplicated logic at all? Does that mean a high-quality program should never contain more than one "for" loop?
by tashi 6y ago
No duplicated logic at all? Does that mean a high-quality program should never contain more than one "for" loop?
- amw-zero 6y agoA for loop is a language level construct, not logic right? Actually for is a great example of why DRY is necessary. Do you implement your own iteration mechanism every time, or do you use the provided tool (for) that your language has generalized for you?