Simberon Design Minute
 

White Space

There's one aspect of programming which makes a big difference to the readability of the code but is often overlooked. It's white space. There are two kinds of white space horizontal space like tabs and spaces and vertical space like blank lines. Developers are usually quite good at putting in horizontal space to line up statements within the same control structure. They often aren't quite as good at leaving vertical space by inserting blank lines. Both kinds of white space are important. Horizontal white space shows you the structure of the code and vertical white space separates statements that belong together from statements which don't. You should use blank lines between sections of your code that do different things. Often, this encourages you to move lines around to make groups that belong together. You can then consider the next step of extracting them into a separate method. Even if you don't, the blank lines help convey your intentions and make the code more readable.

Download