[16702] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: Coding practices proposals

daemon@ATHENA.MIT.EDU (Sam Hartman)
Fri Mar 18 12:23:17 2011

From: Sam Hartman <hartmans@mit.edu>
To: Tom Yu <tlyu@mit.edu>
Date: Fri, 18 Mar 2011 12:23:12 -0400
In-Reply-To: <ldvlj0c77j0.fsf@cathode-dark-space.mit.edu> (Tom Yu's message of
	"Fri, 18 Mar 2011 11:49:55 -0400")
Message-ID: <tslei64wg7j.fsf@mit.edu>
MIME-Version: 1.0
Cc: "krbdev@mit.edu" <krbdev@mit.edu>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krbdev-bounces@mit.edu

>>>>> "Tom" == Tom Yu <tlyu@MIT.EDU> writes:

    Tom> Sam Hartman <hartmans@MIT.EDU> writes:
    >> Hmm.  I'd like to propose dropping the recommendation against
    >> inner scope variables and the requirement to clean up owner
    >> pointers in the top-most scope in this case.

    Tom> I prefer to retain the recommendation of avoiding inner scope
    Tom> variables.  Functions complicated enough to need inner scope
    Tom> variables are often complicated enough that they should be
    Tom> split into smaller pieces.  There are some borderline examples
    Tom> that I might consider to be OK, such as local variables inside
    Tom> a small loop body, but they should still be dealt with
    Tom> carefully.

OK, I find that there are a number of situations where inner scopes make
code easier to understand.

If you want to push for smaller functions, that's fine, but it seems
like the best way to do that is to actually have recommendations about
smaller functions being good, and citing using inner scopes as one sign
that possibly you need a helper function.
_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

home help back first fref pref prev next nref lref last post