Andrew Maxwell

Code Comment Examples

October 27, 2010

Over the years that I have been programming I have come across and even used many variations of comments. Below you will find examples of different code comments.


/* i am the walrus */


/* === GLOBAL SETTINGS === */

/* GLOBAL SETTINGS
----------------------------- */


/* GLOBAL SETTINGS
============================= */


/* ==[ Global Settings ]== */

/* [[[ Global Settings ]]] */

/*** GLOBAL SETTINGS ***/

/* ===============
GLOBAL SETTINGS
=============== */


/* Masthead
==================
*/



/* ===GLOBAL=== */
/* ===PRIMARY=== */
/* ===HEADER=== */
/* ===SIDEBAR=== */
/* ===FOOTER=== */



/* All CSS comments begin with forward slash and asterisk and end with
an asterisk and forward slash. */



/* ==============footer ===================*/



#footer {

clear: both;

padding: 5px;

background-color: #F8FEF8  /*rgb (248,254,248); palest green*/

text-align: center; }


Create a table of contents

/*
TABLE OF CONTENTS

HEADER - Site name, logo, main menu
SIDEBAR - Submenu, searchbar, shortlists
MAINCONTENT - Articles, search results
FOOTER - Copyright
*/

/* CSS DIRECTORY
1. =GLOBAL
2. =PRIMARY
3. =HEADER
4. =SIDEBAR
5. =FOOTER
*/

/* HACK DIRECTORY
% box model hack
$ targets safari
& clearfix hack
? targets IE 7
*/

/* DOCUMENT INFORMATION
- Document: Jukebox Theme
- Version: 1.2.3
- Client: Fonzi Winkler
- Author: M. Gibbonz
*/

/* COLORS
- default body text #ffffcc
- subtitle h2 text #ff9900
- form input borders #cc9933
- default p text #f0f0f0
- pre borders #ffff99
*/

/* FONTS
- default body text Arial, Helvetica Neue, Helvetica, sans-serif
- subtitle h2 text Garamond, Hoefler Text, Times New Roman, Times, serif
- form input text Cambria, Georgia, Times, Times New Roman, Times, serif
- default p text Copperplate Light, Copperplate Gothic Light, serif
- pre and code Consolas, Lucida Console, Monaco, monospace
*/



Label your hacks
div.peekaboo {
height: 1%; /* holly hack */
}

Leave a Reply

You must be logged in to post a comment.