//STYLE: Avoid long blocks of code

Breaking large functions into sub-functions makes code much easier to understand

Having long blocks of code are a pain to read, and an even bigger pain to debug.

Here is a simple rule: if you have a function that is getting longer than 20 lines of code, you should seriously consider spinning off blocks of code into their own functions. This is especially important if you have nested loops or long if ... else if chains. Debugging long blocks of code is a particularly painful experience that is best avoided.