[TYPO3-dev] RFC: CGL change regarding return statements

Andreas Wolf typo3ml at andreaswolf.info
Fri Mar 11 13:02:00 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Dmitry,

Am 11.03.2011 12:10, schrieb Dmitry Dulepov:
> Andreas Wolf wrote:
>> is this -1 still valid if I narrow "validation" to "guard clauses" as
>> described by Oli? Or do you propose to limit it to only throwing
>> exceptions and keeping the single-return-statement-rule?
> 
> Oli's statement is fully in accordance with current CGL as I understand
> it :)

I didn't read the guard clause thingy in the CGL. If we now conclude
that it is included there, I'm fine with that. It should just be added
to the official docs.

I would propose to take Oli's explanation with an example to the CGL
doc. Maybe we can also add some background information. I would
volunteer to write that part and submit it to the Doc team.

It also seems that Guard Clauses are seen as a reasonable exception for
the single exit point rule:
 * http://www.c2.com/cgi/wiki?SingleFunctionExitPoint
 * http://discuss.joelonsoftware.com/default.asp?joel.3.325456.34
 *
<http://www.tomdalling.com/blog/coding-tips/coding-tip-have-a-single-exit-point>

Regards
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREIAAYFAk16DzgACgkQHWtXp155bP/kZACfR3IdvQiUOyVKR3+dOaQPL1hn
/6cAn16I5zXSCv5FG7FqfdqeKKBfgAGl
=iltJ
-----END PGP SIGNATURE-----




More information about the TYPO3-dev mailing list