best practices for loops: write efficient, maintainable, and portable code confirm