5.2.3 Minimal examples

A minimal example is an example which is as small as possible. These examples are much easier to understand than long examples. Minimal examples are used for

To construct an example which is as small as possible, the rule is quite simple: remove anything which is not necessary. When trying to remove unnecessary parts of a file, it is a very good idea to comment out lines instead of deleting them. That way, if you discover that you actually do need some lines, you can uncomment them, instead of typing them in from scratch.

There are two exceptions to the “as small as possible” rule:

The whole point of a minimal example is to make it easy to read:


Other languages: français, español, deutsch.

Learning Manual