[TYPO3-dev] Code humor
Bernhard Kraft
kraftb at kraftb.at
Tue Jan 27 11:54:40 CET 2009
Widmann, Manfred wrote:
> Some kind of black humor, right? Wonder what happens, if someone decides to
> remove an if or add another one! :-o
I did. Adding another if/else level. For my kb_filequota extension. So now
Mount Quota (mount['quota']) is higher than Mount Else.
(Just another joke) ...
> Error messages should be "thrown" immediatly together with an return, then
> this "funny" intendation isn't necessary ... this code maybe works fine but
> "stinks" - at least in my nose!
I also follow Martins preference: Early returns are ok ... at least if they
make sense like in above situation.
It would probably even make sense in above situation to collect multiple error
messages if more of them apply at the same time ...
This would avoid getting one error after another - which can make one really
crazy (like first upload: not allowed because of user right, second upload:
size limit exceeded because of Install-Tool settings, third upload: file
extension not accepted ...) - you'll probably have experienced such an
"error-chain"
greets,
Bernhard
More information about the TYPO3-dev
mailing list