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

Working with Comments

Comments are convenient tools to use while you are writing code. But be careful not to abuse them.

Helping You to Write Routines

A common routine-writing approach is to fashion its structure in comments first and then fill in the code underneath each comment line. If you work this way, you should ask yourself, once finished, whether the remaining comments are still useful. Evaluate them against the criteria just discussed, and revise or remove them if necessary. Don’t just leave them and move on.

The alternative is to write the new routine freehand, and then add any necessary comments afterward. The danger is that you’ll forget to finish the job, or that you might not write the best comments—now knowing almost too well how the ...

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