Difference between revisions of "Cpp Coding Standards/FDESIGN"
From Apache OpenOffice Wiki
m |
m |
||
Line 1: | Line 1: | ||
Topic-Id: '''FDESIGN''' | Topic-Id: '''FDESIGN''' | ||
+ | |||
Design of functions and function prototypes. Items referring to code in function bodies, reside in topic [[../Function Implementation|FIMPL]] - Function Implementation. | Design of functions and function prototypes. Items referring to code in function bodies, reside in topic [[../Function Implementation|FIMPL]] - Function Implementation. | ||
Revision as of 22:11, 29 November 2006
Topic-Id: FDESIGN
Design of functions and function prototypes. Items referring to code in function bodies, reside in topic FIMPL - Function Implementation.
Contents
Summary
One Task (OneTask)
Give one function only one cohesive task.
Canonical Operators (CanOp)
Use canonical signatures for all operator overloads. Provide canonical behavior for arithmetic operators.
Unambiguous Parameter (Params)
Mark parameter intention unambiguously. Out- and inout- parameters need to be distinguished unmistakably.
Use smart pointers as parameter type for objects on the heap, when the responsibility for deleting is unclear or transfered between caller and callee.
Related Rules
- FIMPL:Short - Short Functions
- IFC:Consi - Consistency
- IFC:Over - Unambiguous Overloads