On 11/13/07, Brion Vibber <brion(a)wikimedia.org> wrote:
Simetrical wrote:
One thing I would love to see from this is
development rules about
what can go in each directory. If we get, say, a UI directory, I
would like to see something like: no database queries are allowed in
UI-directory files; no use of $wgOut (outside of API or
development/debugging stuff) is allowed in non-UI-directory files. We
could have little RULES files in each directory, and mercilessly
revert changes that break them. Likewise, parser/ should have no
interaction with $wgUser, for instance.
Eeeeek.
We already have this on a mild scale, like the rule about Parser not
touching $wgUser directly. One valid complaint that's sometimes
raised about MW code is that it doesn't sufficiently separate
interface from backend code. It's something to consider, I think: if
EditPage.php contains a database query (which it does, last I checked,
although only one), that's probably not ideal.