Wednesday, January 14, 2015

A discouraging documentation

When you have made a serious commitment to a software platform, and you try to learn a new trick, and you ask yourself, "in which file should I be putting the code for this new trick", and you find in the documentation a precise answer, you are very happy:
Where should this code live?
You can put signal handling and registration code anywhere you like. However, [reason].  This makes your app’s models.py a good place to put registration of signal handlers.
If, however, you look at the same documentation for one version later and find precisely opposite advice:
Strictly speaking, signal handling and registration code can live anywhere you like, although it’s recommended to avoid the application’s ... models module ...
 a certain crisis of confidence may seem appropriate.

Update: If, however, you have some code that should be run whenever something is saved, and so you put it in a place that will run whenever something is saved, but in that code you save that something, you have nobody but yourself to blame for the consequences.

No comments :

Post a Comment