Additionally to while-loop, there is also a for loop in Processing and many other languages. For-loop doesn’t introduce any new functionality. Everything you do with a for-loop, you could also do with the while-loop. For-loop is just a more convinient way to express things. Here’s a good video about for-loops by Daniel Shiffman.