Characteristics of a Good Function

◀ How to Write a Function Efficiently▶ Code Size of a Function
Amazon Let’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:
  • short code size
  • high efficiency
  • low memory footprint
  • high reliability
  • and high generality
Below we’ll look at each property and explain why they are true!

◀ How to Write a Function Efficiently▶ Code Size of a Function

fShare
Questions? Let me know!