Write your code like you write prose.
Break it up into chapters, paragraphs, and sentences. Bind the like things together; separate the different things. Functions are akin to chapters. Within each chapter may be a few distinct but related parts of code. Break them up into paragraphs by inserting blank lines between them. Do not insert blank lines unless there is a natural “paragraph” break. This technique helps to emphasise flow and structure.
Share this highlighthttp://www.safaribooksonline.com/a/becoming-a-better/68130/