Procedure names

Procedure names should reflect what they do; function names should reflect what they return. Functions are used in expressions, often in things like if's, so they need to read appropriately.

if(checksize(x))

is unhelpful because we can't deduce whether checksize returns true on error or non-error; instead

if(validsize(x))

makes the point clear and makes a future mistake in using the routine less likely.


Contents The use of pointers. Comments