Difference between revisions of "Cpp Coding Standards/FDESIGN"
From Apache OpenOffice Wiki
m |
|||
Line 2: | Line 2: | ||
Design of functions and function prototypes. Items referring to code in function bodies, reside in [[../FIMPL | FIMPL]] (Function Implementation). | Design of functions and function prototypes. Items referring to code in function bodies, reside in [[../FIMPL | FIMPL]] (Function Implementation). | ||
---- | ---- | ||
− | === | + | === Summary === |
− | + | ||
==== OneTask ==== | ==== OneTask ==== | ||
Give one function only one cohesive task. | Give one function only one cohesive task. | ||
Line 19: | Line 18: | ||
* [[../IFC#Consistency | IFC:Consistency]] | * [[../IFC#Consistency | IFC:Consistency]] | ||
* [[../IFC#UnambiguousOverloads | IFC:UnambiguousOverloads]] | * [[../IFC#UnambiguousOverloads | IFC:UnambiguousOverloads]] | ||
+ | ---- | ||
+ | === Explanations === | ||
+ | |||
---- | ---- | ||
[[Category:Coding Standards]] | [[Category:Coding Standards]] |
Revision as of 18:13, 27 November 2006
Contents
Function Design
Design of functions and function prototypes. Items referring to code in function bodies, reside in FIMPL (Function Implementation).
Summary
OneTask
Give one function only one cohesive task.
CanonicalOperators
Use canonical signatures for all operator overloads. Provide canonical behavior for arithmetic operators.
UnambiguousParameters
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.