Chapter 12.1

Characteristics of a Good Function

AmazonLet’s first discuss characteristics of a good function. The code that achieves some purpose can be written in so many different ways; so how do we judge whether a function is well written?

To answer this question let’s look at the core properties of a function: code size, efficiency, memory footprint, reliability, and generality. In general a good function should have the following properties: