Take-home Chinese food for thought

  • The practical OCaml programmer first seeks to understand what is going on. They write unit tests to concretize their understanding.
  • The practical OCaml programmer then seeks to understand how things work. They study the nature of the data at hand and concur that the wheel needs not be re-invented, in part or in toto.
  • The practical OCaml programmer knows that incomplete testing only proves the presence of errors, not their absence, since it cannot enumerate all possible cases. They further know that complete testing proves the absence of errors since it enumerates all possible cases.
  • The practical OCaml programmer uses structural recursion for data that were constructed inductively.
  • The practical OCaml programmer is not afraid of anonymous functions.
  • The practical OCaml programmer follows procedure with a tail call.
  • The practical OCaml programmer heeds the reverse order of accumulation.
  • The practical OCaml programmer chooses meaningful names and uses auto-completion.
  • The practical OCaml programmer is mindful of not overdoing anything. They favor predicates, accessors, and data constructors that work in constant time rather than in linear time (e.g., List.cons (i.e., ::) rather than List.append (i.e., @)).
  • The practical OCaml programmer lives by Don Knuth’s tenet that early optimization is the source of a lot of evil. They are also aware that often, nothing needs to be made efficient if it is done right in the first place.
  • The practical OCaml programmer knows that the measure of their understanding is the clarity of their discourse.

Version

Created [03 Apr 2021]

Table Of Contents

Previous topic

The slash type error

Next topic

A musing about variables