|Ada 95 Quality and Style Guide||Chapter 2|
2.1.6 Blank Lines
Use blank lines to group logically related lines of text (NASA 1987).
exampleif ... then for ... loop end loop; end if;
This example separates different kinds of declarations with blank lines:type Employee_Record is record Legal_Name : Name; Date_Of_Birth : Date; Date_Of_Hire : Date; Salary : Money; end record; type Day is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); subtype Weekday is Day range Monday .. Friday; subtype Weekend is Day range Saturday .. Sunday;
When blank lines are used in a thoughtful and consistent manner, sections of related code are more visible to readers.
Automatic formatters do not enforce this guideline well because the decision on where to insert blank lines is a semantic one. However, many formatters have the ability to leave existing blank lines intact. Thus, you can manually insert the lines and not lose the effect when you run such a formatter.
|< Previous Page||Search||Contents||Index||Next Page >|