On 2013-07-31, Neil Cerutti <ne...@norwich.edu> wrote:
> On 2013-07-31, Tim Chase <python.l...@tim.thechases.com> wrote:
>> On 2013-07-31 07:16, Joshua Landau wrote:
>>> On 30 July 2013 18:52, Grant Edwards wrote:
>>>> I also find intializers for tables of data to be much more easily
>>>> read and maintained if the columns can be aligned.
>>> 
>>> Why do you have tables in your Python code?
>>
>> I've had occasion to write things like:
>>
>>   for name, value, description in (
>>       ("cost", 42, "How much it cost"),
>>       ("status", 3141, "Status code from ISO-3.14159"),
>>       ...
>>       ):
>>     do_something(name, value)
>>     print(description)
>>
>> I interpret Grant's statement as wanting the "table" to look like
>>
>>   for name, value, description in (
>>       ("cost",   42,   "How much it cost"),
>>       ("status", 3141, "Status code from ISO-3.14159"),
>>       ...
>>       ):
>>     do_something(name, value)
>>     print(description)
>>
>> which does give some modest readability benefits, but at a
>> creation cost I personally am unwilling to pay.
>
> I'm actually OK with the creation cost, but not the maintenance cost.

In my experience, aligning columns in large tables reduces maintence
cost by making it much easier/faster to see what you've got and by
providing a way to visually "prompt" you for the correct value in the
correct place when you add new lines.

-- 
Grant Edwards               grant.b.edwards        Yow! hubub, hubub, HUBUB,
                                  at               hubub, hubub, hubub, HUBUB,
                              gmail.com            hubub, hubub, hubub.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to