Difference between revisions of "Cpp Coding Standards"
From Apache OpenOffice Wiki
m (→Identifying Rules) |
m (→Identifying Rules) |
||
Line 5: | Line 5: | ||
To make it easier to talk about the rules, each one gets an identifier. Because items can be added or sorted out, such ids should not be just cardinal numbers. | To make it easier to talk about the rules, each one gets an identifier. Because items can be added or sorted out, such ids should not be just cardinal numbers. | ||
− | + | Each rule belongs to a topic, which has an id, and has an id itself. | |
Example: [[/Topics/FDESIGN#OneTask | FDESIGN:OneTask]] is the rule with the id "OneTask" which belongs to the topic [[/Topics/FDESIGN | function design]] with the id [[/Topics/FDESIGN | FDESIGN]]. | Example: [[/Topics/FDESIGN#OneTask | FDESIGN:OneTask]] is the rule with the id "OneTask" which belongs to the topic [[/Topics/FDESIGN | function design]] with the id [[/Topics/FDESIGN | FDESIGN]]. | ||
Revision as of 16:47, 27 November 2006
Contents
Purpose
Coding standards are a part of defect prevention. They gather rules, advice and best practices for developing software, especially the code writing part. Here are listed some ideas what such standards could be for developing with C++ and within the OpenOffice.org project.
Identifying Rules
To make it easier to talk about the rules, each one gets an identifier. Because items can be added or sorted out, such ids should not be just cardinal numbers.
Each rule belongs to a topic, which has an id, and has an id itself. Example: FDESIGN:OneTask is the rule with the id "OneTask" which belongs to the topic function design with the id FDESIGN.
Topics by Problem Domain
Topics may appear at multiple domains.
Middle- and Lowlevel Design
- DESIGN - Design
- HIERARCHY - Hierarchies of Virtual Classes
- CLSDESIGN- Class Design
- IFC - Interfaces
- FDESIGN - Function Design
Classes
- CLSDESIGN- Class Design
- HIERARCHY - Hierarchies of Virtual Classes
- IFC - Interfaces
- ENC - Encapsulation
- CLSINIT - Class Construction, Destruction and Copying
- FDESIGN - Function Design
Functions and Implementation Generally
- GEN - General Coding
- FDESIGN - Function Design
- FIMPL - Function Implementation
- ERR - Error Handling
- SECURITY - Security
Preferred vs. Discarded Types and Habits
Files, Formatting, Documentation
Topics in Alphabetical Order
- CLSDESIGN- Class Design
- CLSINIT - Class Construction, Destruction and Copying
- CODEDOCU - Code Documentation
- DESIGN - Design
- ENC - Encapsulation
- ERR - Error Handling
- FORMAT - Code Format
- FDESIGN - Function Design
- FIMPL - Function Implementation
- GEN - General Coding
- HEADERS - Header Files
- HIERARCHY - Hierarchies of Virtual Classes
- IFC - Interfaces
- OBSOLETE - Obsolete Habits
- SECURITY - Security
- STL - The C++ Standard Template Library
- TYPE - Type Safety