Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) function design

 

Function design is the correct design of a function. Exercise #2: correct function declarations is an exercise in correct function design.

 

The most important to get correct is the function declaration.

 

Here are some rules:

 

 

 

 

 

The name of the function should say what it does

 

 

 

 

 

 

Make a function responsible for one thing

 

 

 

 

 

 

The return type is expected from the name of the function

 

 

 

 

 

 

The function arguments are expected from the name of the function

 

 

 

 

 

 

The function must specify the called what input it can't handle

 

 

 

 

 

 

References

 

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict