body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; } body { margin: 0 0 10px 0; } a { color: #0066CC; text-decoration: none; } a:hover { text-decoration: underline; } p, h1, h2, h3, h4, h5, h6, pre { margin-top: 0; } h1, h2, h3, h4, h5, h6 { color: #333333; line-height: normal; letter-spacing: 1px; } h1 { font-size: 32px; } h2 { font-size: 24px; } h3 { font-size: 18px; } h4 { font-size: 16px; } h5 { font-size: 13px; } h6 { font-size: 10px; } hr { height: 1px; color: #999999; } ul { list-style-type: square; } img { border: 0; } acronym,abbr { border-bottom: 1px dashed; cursor: help; } input.text { margin: 1px; border: #CCCCCC solid 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #666666; font-size: 10px; font-weight: bold; background-color: #FFFFFF; } .underline { border-bottom: solid 1px; } .code { margin-left: 50px; margin-right: 50px; padding: 5px 10px; background: #F9F9F9 url(quote.png) no-repeat; border: #999999 dashed 1px; font-size: 11px; font-style: italic; display: block; } .qoute { margin-left: 50px; margin-right: 50px; padding: 5px 10px; background: #F9F9F9 url(quote.png) no-repeat; border: #999999 dashed 1px; font-size: 11px; display: block; } .left_line { margin-left: 50px; margin-right: 50px; padding: 5px 10px; border-left: #CCCCCC solid 2px; font-size: 11px; display: block; } #name { padding: 5px 0 5px 20px; font-size: 36px; font-weight: bold; float: left; } #name .p1 { color: #999999; } #name .p2 { color: #666666; } #tiny_nav { padding: 11px 10px 0 0; font-size: 11px; text-align: right; float: right; } #tiny_nav a { color: #333333; font-size: 10px; font-weight: bold; text-decoration: none; } #tiny_nav a:hover { color: #0066CC; } #tiny_nav input { margin: 5px 0 0 0; background-color: #EDEDED; border: none; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: normal; } p.heading { margin-top: 0; color: #333333; line-height: normal; letter-spacing: 1px; font-size: 24px; } #slogan { margin: 0 10px; padding: 1px 0px 4px 11px; background-color: #F3F3F3; border-top: #999999 solid 1px; color: #333333; font-size: 11px; clear: both; } #body_table { width: 100%; padding: 0; text-align: justify; line-height: 18px; } #body_table td { vertical-align: top; } #body_left { margin: -1px; width: 200px; padding: 10px 15px; background-color: #F3F3F3; border-bottom: #FFFFFF solid 1px; } #body_right { padding-left: 5px; } #menu { margin: -10px -15px 10px -15px; } #menu ul { list-style-type: none; margin: 0; padding: 0; } #menu ul li { border-bottom: #FFFFFF solid 1px; background-color: #EDEDED; color: #333333; font-weight: bold; letter-spacing: 1px; } #menu ul li a { width: 195px; padding: 7px 15px; border-right: #CCCCCC solid 5px; color: #333333; text-decoration: none; display: block; } #menu ul li a:hover { border-right-color: #0066CC; background-color: #F3F3F3; } #menu .pressed { padding: 7px 15px; border-right: #0066CC solid 5px; background-color: #E7E7E7; display: block; } #footer { margin: 0 10px; padding: 5px; background-color: #F3F3F3; border-bottom: #999999 solid 1px; font-size: 10px; text-align: center; } #contactForm { margin-top: 30px; width: 500px; } #contactForm input, #contactForm textarea { border: 1px solid #ccc; font-family: Helvetica, arial, sans-serif; font-size: 14px; margin: 0px 0px 10px 0px; padding: 2px; width: 379px; } #contactForm textarea { height: 100px; } #contactForm textarea:focus, #contactForm input:focus { border: 1px solid #888; } #contactForm label { float: left; font-size: 14px; margin-right: 15px; text-align: right; width: 100px; } #contactForm input.submit { cursor: pointer; float: right; width: 130px; } #contactForm h2, #contactForm h3 { margin-left: 115px; } #contactForm .error { color: #ff0000; margin-left: 115px; }
To identify named constants, the standard convention is to use all caps, with underscores to separate words in the name. Example: GL_DEBUG_TEST, SDL_MOUSE_DOWN.
To format names to make them more readable, there are a number of different ways to do it. To keep prefixes separate from the variable names, the recommended method is to have the first letter from each word in the name to be caps, with the prefix separated from the variable name with an underscore. For variables, the first letter of the actual name should be lowercase. Examples: ms_objectCount, g_errorLogFile, localTally. Methods use the same convention, but without the prefixes.
For classes, types and interfaces, the names follow the same convention as methods, except that the first letter of the name should also be capitalized. Examples: Application, PongUnitTest, MemoryManagerObject, NutritionalInformation.
Abbreviations and acronyms should not be in uppercase except for the first letter where appropriate. Examples of classes: HtmlSourceContainer, DvdRead. Examples of variables and methods: htmlSource, getDvdWriteHandle(), m_processedHtmlSource.
Comments
Choosing how much to comment the code is often difficult to decide. The following guidelines are drawn from several sources:
For bold comments which require a little emphasis, the recommended format is:
// ************************************************************** // This is a bold comment, which might be used to indicate an important section // of code, or just to catch the programmers eye. The bold comment should be // rather rare, otherwise it looses its effectiveness. // **************************************************************
Misc. Guidelines
Below is a list of guidelines which don't really fit into any other sections cleanly, but are worth mentioning.
Useful Links and References