Clean Code and single character variable names

Nate Finch nate.finch at canonical.com
Tue Aug 27 01:30:48 UTC 2013


I don't have time to properly respond, but I'm pretty sure no one on this
team is using single letter variables to save keystrokes.

Is is a good point that abbreviations may be more common in one area than
another. I find both ctx and txn to be completely self explanatory even
with zero context (heh).
 On Aug 26, 2013 8:33 PM, "Julian Edwards" <julian.edwards at canonical.com>
wrote:

> On 27/08/13 09:26, Andrew Wilkins wrote:
> > Traditionally I've also avoided abbreviated names (preferring context
> > over ctx, transaction over tx/txn). I'm not 100% convinced that this is
> > necessary, though, in these cases where there's a *conventional* and
> > obvious abbreviation. I mean, ctx is pretty obvious. "c" not so much
> > (though I use "c" a *lot* in llgo to shorten "compiler"; not great, but
> > at least I'm pretty consistent about it, so it's a project-specific
> > convention).
>
> YMMV.  I find "txn" far more obvious than "ctx".
>
> Talking of "c", I was astounded the first time I found a struct called
> "C" being used in juju tests.
>
> > Minimising cognitive overhead is more important than saving a few
> keystrokes.
>
> I believe this is exactly what Tim is trying to say :)
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20130826/8d8af384/attachment.html>


More information about the Juju-dev mailing list