X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/472f4b6c0c48d5767229b635bb2ead083d0bec88..4d7f4836f07bb037bc1c840983e5ef1c99606005:/doc/RULES diff --git a/doc/RULES b/doc/RULES index 33747663..55aa4bf4 100644 --- a/doc/RULES +++ b/doc/RULES @@ -93,3 +93,36 @@ after. Empty lines are definitely preferred to save bandwidth. An ascii file ends with \n, and preferrable not with other empty lines. That means: make sure the last line doesn't contain any characters, thanks. + +5.) usage of 'print' + +While it's great to dump out debug stuff, especially if your code can crash, +expect your code to be stable at some point. + +At that point, others might get annoyed by the debug output created by your +code. That's no problem, they can remove it, but they have to find them +first. + +Using "print obj" with obj being some object, preferably a complex one, is a +good way to ensure that nobody is able to remove your debug output - because +nobody finds it! + +Please, always prepend something before which can be grepped. Anything, just +not nothing. Going trough all prints to find the offending one is definitely +no fun. Something like "print 'obj', obj" is fine. Something like "print +'mySpecialPlugin actionmap is', actionMap" is even better. + +6.) usage of 'import' + +Please avoid 'import *'. +Use "from foo import bar" only if bar is clearly identifiable to belong to +foo (e.g.: it's ok to "from Screens.MessageBox import MessageBox", but it's +not ok to do "from os import path". Use "import os.path", then os.path.fnc. +Of course "from os.path import *" is even worse.) + +7.-99.) Threads are bad. + +(Unless they are worker threads. And sleep()ing is definitely not working. +So if you every having a thread which sleeps, you did something wrong. There +are eTimers, and not knowing how to use them is no excuse to throw aways all +enigma code design concepts.)