Difference between revisions of "Cpp Coding Standards/FDESIGN"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Cpp Coding Standards/Topics/FDESIGN moved to Cpp Coding Standards/Function Design: Improve Cpp_Coding_Standards structure.)
Line 1: Line 1:
== Function Design ==
+
Topic-Id: '''FDESIGN'''
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 ===
 
=== Summary ===
==== OneTask ====
+
==== One Task <span id="OneTask">(OneTask)</span> ====
 
Give one function only one cohesive task.
 
Give one function only one cohesive task.
  
==== CanonicalOperators ====
+
[[/OneTask|Details]]
 +
 
 +
==== Canonical Operators <span id="CanOp">(CanOp)</span> ====
 
Use canonical signatures for all operator overloads. Provide canonical behavior for arithmetic operators.
 
Use canonical signatures for all operator overloads. Provide canonical behavior for arithmetic operators.
  
==== UnambiguousParameters ====
+
[[/CanOp|Details]]
 +
 
 +
==== Unambiguous Parameter <span id="Params">(Params)</span> ====
 
Mark parameter intention unambiguously. Out- and inout- parameters need to be distinguished unmistakably.  
 
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.
 
Use smart pointers as parameter type for objects on the heap, when the responsibility for deleting is unclear or transfered between caller and callee.
 +
 +
[[/Params|Details]]
 +
 
----
 
----
 
=== Related Rules ===
 
=== Related Rules ===
* [[../FIMPL#Short | FIMPL:Short]]
+
* [[../Function Implementation#Short | FIMPL:Short]] - Short Functions
* [[../IFC#Consistency | IFC:Consistency]]
+
* [[../Interfaces#Consi |IFC:Consi]] - Consistency
* [[../IFC#UnambiguousOverloads | IFC:UnambiguousOverloads]]
+
* [[../Interfaces#Over |IFC:Over]] - Unambiguous Overloads
----
+
=== Explanations ===
+
  
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Revision as of 22:10, 29 November 2006

Topic-Id: FDESIGN Design of functions and function prototypes. Items referring to code in function bodies, reside in FIMPL - Function Implementation.


Summary

One Task (OneTask)

Give one function only one cohesive task.

Details

Canonical Operators (CanOp)

Use canonical signatures for all operator overloads. Provide canonical behavior for arithmetic operators.

Details

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.

Details


Related Rules


Personal tools