Using functional programming languages you can significantly shorten your code. The new topic I have recently completed to develop in my on going F# Fundamentals course explains how we can code efficient short loops in F#. This course is available for free personal usage at www.abelski.com.
The new clips I have recently completed to prepare present short code samples you can follow when doing your first steps. Hereto some of those clips.