Skip to Main Content
Code Craft
book

Code Craft

by Pete Goodliffe
December 2006
Intermediate to advanced content levelIntermediate to advanced
610 pages
22h 58m
English
No Starch Press
Content preview from Code Craft

A Comment on Aesthetics

You’ve no doubt heard people religiously touting about how you should format your comments. I’m not going to prescribe the One True Way to format (there is no such thing), but there are a few important aspects to consider. Interpret these as guidelines, according to your personal taste, rather than as rigid dictates.

Consistency

All commenting should be clear and consistent. Choose a specific way to lay out your comments, and use it throughout. Every programmer has a different sense of aesthetics, so choose what works for you. Do use a house style if one exists, or examine (good) existing code and follow the styles you see there.

Small formatting issues in comment writing may seem trivial—for example, should each comment start ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Write Great Code, Volume 2, 2nd Edition

Write Great Code, Volume 2, 2nd Edition

Randall Hyde
The Art of Clean Code

The Art of Clean Code

Christian Mayer

Publisher Resources

ISBN: 9781593271190Errata