30.06.2013 Views

SQL Server Team-based Development - Red Gate Software

SQL Server Team-based Development - Red Gate Software

SQL Server Team-based Development - Red Gate Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

29<br />

Chapter 1: Writing Readable <strong>SQL</strong><br />

Melun, Calenzana, Crayeux de Roncq, Esbareich, Frinault, Mixte, Pavé du Berry, Port-<br />

Salut, Quercy Petit, Regal de la Dombes, Sainte Maure, Sourire Lozerien, Truffe, and<br />

Vignotte. Now, no typesetter would agree to arrange this in a vertical list, because the<br />

page would contain too much white space…<br />

I like many French cheeses, including:<br />

• Abbaye de Belloc<br />

• Baguette Laonnaise<br />

• Brie de Melun<br />

• Calenzana<br />

• Crayeux de Roncq<br />

• Esbareich<br />

• etc.<br />

…and they'd be most unlikely to want to put commas at the beginning of list elements.<br />

However, if the list elements consisted of longer strings, then it would be perfectly<br />

acceptable. In the same way, the rules for formatting <strong>SQL</strong> have to take into account the<br />

type of <strong>SQL</strong> statement being formatted, and the average length of each list element.<br />

Punctuation<br />

Commas, used as list separators, are often put at the beginning of lines. I realize that it<br />

makes the "commenting out" of list members easier during development, but it makes<br />

it difficult for those of us who are used to reading English text in books. Commas come<br />

at the end of phrases, with no space before them, but if they are followed by a word or<br />

phrase on the same line, then there is a space after the comma.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!