| 1 |
Principles of Pygame Zero |
| 2 |
========================= |
| 3 |
|
| 4 |
|
| 5 |
Please read the following carefully before contributing. |
| 6 |
|
| 7 |
Because Pygame Zero is aimed at beginners we must take extra care to avoid |
| 8 |
introducting hurdles for programmers who have not yet learned to deal with |
| 9 |
them. |
| 10 |
|
| 11 |
|
| 12 |
.. _accessibility: |
| 13 |
|
| 14 |
Make it accessible |
| 15 |
------------------ |
| 16 |
|
| 17 |
The main aim of Pygame Zero is to be accessible to beginner programmers. |
| 18 |
The design of the API is, of course, influenced by this. |
| 19 |
|
| 20 |
This also applies to things like hardware requirements: Pygame Zero chose |
| 21 |
originally to support only keyboard and mouse input, in order to be accessible |
| 22 |
to any user. |
| 23 |
|
| 24 |
|
| 25 |
Be conservative |
| 26 |
--------------- |
| 27 |
|
| 28 |
Early in the development of Pygame Zero, Richard and I (Daniel) went backwards |
| 29 |
and forwards over various features. We put them in, tried them and took them |
| 30 |
out again. |
| 31 |
|
| 32 |
Features should be rejected if they are too experimental, or if they might |
| 33 |
cause confusion. |
| 34 |
|
| 35 |
This also applies to things like OS support: we disallow filenames that are |
| 36 |
not likely to be compatible across operating systems. |
| 37 |
|
| 38 |
|
| 39 |
Just Work |
| 40 |
--------- |
| 41 |
|
| 42 |
Pygame Zero wraps Pygame almost completely - but we don't expose all the |
| 43 |
features. We expose only the features that work really well without extra fuss, |
| 44 |
and hide some of the other features that work less well or need extra steps. |
| 45 |
|
| 46 |
|
| 47 |
Minimise runtime cost |
| 48 |
--------------------- |
| 49 |
|
| 50 |
At the end of the day, Pygame Zero is a games framework and performance is an |
| 51 |
issue. |
| 52 |
|
| 53 |
Doing expensive checking every frame to catch a potential pitfall is not really |
| 54 |
acceptable. Instead, we might check at start up time, or check only when an |
| 55 |
exception is raised to diagnose it and report more information. |
| 56 |
|
| 57 |
|
| 58 |
Error clearly |
| 59 |
------------- |
| 60 |
|
| 61 |
When exceptions are thrown by Pygame Zero, they should have clear error |
| 62 |
messages that explain the problem. |
| 63 |
|
| 64 |
|
| 65 |
Document well |
| 66 |
------------- |
| 67 |
|
| 68 |
Like all projects, Pygame Zero needs good documentation. Pull requests are more |
| 69 |
likely to be accepted if they include the necessary documentation. |
| 70 |
|
| 71 |
Try to avoid complicated sentences and technical terms in the documentation, so |
| 72 |
that it is more easily readable by inexperienced programmers. |
| 73 |
|
| 74 |
|
| 75 |
Minimise breaking changes |
| 76 |
------------------------- |
| 77 |
|
| 78 |
In educational environments, users don't always have control of the version of |
| 79 |
a library they use. They don't know how to install or upgrade to the latest |
| 80 |
version. |
| 81 |
|
| 82 |
It is more important to get the features right first time than in many other |
| 83 |
projects. |