The most important guideline when writing code is to separate method implementations with several blank lines and a comment line. Despite modern IDEs’ capabilities for searching and structuring source code, visual orientation still plays an important role.

Consider the example below. There is an implementation of a class in Objective-C. The methods are separated by just one line. Also, separation by one line occurs not only between methods, but also between logical blocks of code inside methods. The length of a method name cannot serve as a good marker for the start of a new method. For example, the method name stopProgressAnimating is shorter than any line of the previous method, loadCommentsFailure. There is nothing for the eye to latch onto.

image

The very same code, but the methods are separated by blank lines and a comment. Now the space between the end of one method and the beginning of the next forms a uniform pattern that repeats constantly. Such a pattern is easy to spot even when scrolling quickly.

image