On 7 May 2013 18:17, Igor M Podlesny <[email protected]> wrote:
> On 7 May 2013 16:36, Andrew Vagin <[email protected]> wrote:
[...]
>> Why do we need one more indent here instead of returning 1 in the
>> previous block? I am not sure that this version is more readable...

   1) Single return point is easier to debug than if a function has a
lots of exit ways:
you can set a break-point on it, or debug statement, or whatever.

   2) It's structural programming. Long ago people got used to GOTO
and then some of
them realized it's more readable to have code text indented according
to execution flow.
In this very case, there's obviously no problem with indentation level
-- it's quite decent.
Yep, 2 is more than 1, but there's no drama in that — it's better to
have extra return
abandoned.

--

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to