15.1 Rusty Scale for API Design
- It is impossible to get wrong. dwim()
- The compiler or linker won't let you get it wrong.
- The compiler or linker will warn you if you get it wrong.
- The simplest use is the correct one.
- The name tells you how to use it.
- Do it right or it will always break at runtime.
- Follow common convention and you will get it right. malloc()
- Read the documentation and you will get it right.
- Read the implementation and you will get it right.
- Read the right mailing-list archive and you will get it right.
- Read the right mailing-list archive and you will get it wrong.
- Read the implementation and you will get it wrong.
The non-CONFIG_PREEMPT implementation of rcu_read_lock().
- Read the documentation and you will get it wrong. DEC Alpha wmb
instruction.
- Follow common convention and you will get it wrong.
printf() (failing to check for error return).
- Do it right and it will break at runtime.
- The name tells you how not to use it.
- The obvious use is wrong. smp_mb().
- The compiler or linker will warn you if you get it right.
- The compiler or linker won't let you get it right.
- It is impossible to get right. gets().
Paul E. McKenney
2011-12-16