[Engineering] A Guide to Naming Variables

Joaquin Oltra Hernandez jhernandez at wikimedia.org
Tue May 17 10:01:34 UTC 2016


Great article, thanks for sharing.

On Tue, May 17, 2016 at 12:14 AM, Nick Wilson (Quiddity) <
nwilson at wikimedia.org> wrote:

> I added it to the Further Reading section in
> https://www.mediawiki.org/wiki/Naming_things ;-)
>
> On Mon, May 16, 2016 at 1:42 PM, Kevin Smith <ksmith at wikimedia.org> wrote:
>
>> I agree with most of that article.
>>
>> In the section "Move Simple Comments Into Variable Names", I was
>> surprised the author didn't mention the #1 reason to do so: It's too easy
>> to forget to update a comment when the meaning of the variable changes. The
>> later section "Use Longer OTVs to Explain Confusing Code" is another great
>> example of clearer code reducing/eliminating the need a comment.
>>
>> I'm not sold on avoiding cliches like "count" and "result", if you're
>> keeping idioms like "i" and "n".
>>
>> Sidebar anecdote: In my second-ever paid programming job, we were forced
>> to use only letter+digit variable names, like A2 and G6, because our
>> (interpreted) program had to fit in 32K of RAM, and longer variable names
>> would have consumed precious space. It was an awesome early lesson on the
>> power of meaningful variable names.
>>
>>
>>
>> Kevin Smith
>> Agile Coach, Wikimedia Foundation
>>
>>
>> On Tue, May 3, 2016 at 4:24 AM, Filippo Giunchedi <
>> fgiunchedi at wikimedia.org> wrote:
>>
>>>
>>> http://a-nickels-worth.blogspot.ie/2016/04/a-guide-to-naming-variables.html
>>>
>>> (full disclosure: from a former colleague)
>>>
>>> _______________________________________________
>>> Engineering mailing list
>>> Engineering at lists.wikimedia.org
>>> https://lists.wikimedia.org/mailman/listinfo/engineering
>>>
>>>
>>
>> _______________________________________________
>> Engineering mailing list
>> Engineering at lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/engineering
>>
>>
>
>
> --
> Nick Wilson (Quiddity)
> Community Liaison
> Wikimedia Foundation
>
> _______________________________________________
> Engineering mailing list
> Engineering at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/engineering
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/engineering/attachments/20160517/3438338e/attachment.html>


More information about the Engineering mailing list