The classic C-style for loop is a blight on modern programming. Here are a few alternative ways to loop with an index.