The same as controllers should be "query-free", subs should not have any interruption of the "flow".
What do I mean? Things like isAllowedTo, fatal_lang_error, etc. that "hard-stop" the code and force php to present another page to the user.
At the moment the situation in ElkArte 1.0 is the following:
isAllowedTo 25
fatal_lang_error and fatal_error 92
redirectexit 5
obExit 13
die 2
exit 10
Good points :D ... the security checks etc should be back in the controllers. Looks like some more fun in 1.1 !
Not sure of when and where but there may be a time when you want to do some kind of security check outside of the controller. In which case, you need to inject the user and the security stuff. When you do that, you should be returning an exception so that it can be caught.
Some good news:
isAllowedTo 7
fatal_lang_error 75
fatal_error 3
redirectexit 2
obExit 11
die 2 (Graphics.subs.php for reference)
* exit 10
Going off of the current development branch
Where did all that stuff go? LOL
I don't remember so many changes! xD