<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>People complain about single letter variable names, but if the function is only 10 lines long, does it really matter? You can see s := thing.State() ... so you know it's a state. Does it make it clearer to call it state when you see it used 2 lines below? I don't think so. That being said, it's fine to call it state, too. It's just when you call it thingStateForReviewLater that it actually makes the code harder to read when it's used in more than trivial expressions.</div>
</div></blockquote><div><br></div><div>You said an important fact here: if the function is only 10 lines. Beside speaking type and function names, and variables that may have very short names based on their visibility, it is helpful to keep the functions short. They should be readable on a screen without problems (and no, Roger, I don't mean your 20"+ screen in portrait mode *smile*). Otherwise nested blocks should be moved into own functions (with speaking names) even if they are only used once. In that case the top level function using those sub-functions reads better and the maintainer gets a fester overview about the intention of the function.<br>
<br></div><div>mue<br></div><div><br></div></div>-- <br><div>** Frank Mueller <<a href="mailto:frank.mueller@canonical.com" target="_blank">frank.mueller@canonical.com</a>></div><div>** Software Engineer - Juju Development</div>
<div>** Canonical</div>
</div></div>