<br><br><div class="gmail_quote">On Fri, Aug 10, 2012 at 2:52 PM, David Berthelot <span dir="ltr"><<a href="mailto:david.berthelot@gmail.com" target="_blank">david.berthelot@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So far I only read 1 pro, 1 con:<br>
pro: readability (aligned variables make it clear)<br>
con: vcs history can get confusing when looking for who changed a line<br>
<br>
So may be it's time for vcs tools to evolve and become language aware.<br>
Readability was historically pythonic otherwise why rely on<br>
indentation instead of curly braces ?<br></blockquote><div><br></div><div><br></div><div>But readability means different things to different people. Python is highly readable for me due to the initial white space for indented code blocks.</div>
<div><br></div><div>Reading something like this is not highly readable for me.</div><div><br>
</div><div>Though I could certainly imagine that it would be for some folks... different tastes and all that.</div><div><br></div><div>Code blocks help define scope visually. Column-aligned code does not serve the same purpose. When I read a list of variables, I get no additional information from the spacing of them. I also don't read variables vertically. I read them like I do English, from left to right. Large gaps of white space between the "words" is much less readable *for me* ;-)</div>
<div><br></div><div>d</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
On Fri, Aug 10, 2012 at 2:34 PM, Duncan McGreggor<br>
<<a href="mailto:oubiwann@twistedmatrix.com">oubiwann@twistedmatrix.com</a>> wrote:<br>
><br>
> On Fri, Aug 10, 2012 at 12:01 PM, Wai Yip Tung <<a href="mailto:tungwaiyip@yahoo.com">tungwaiyip@yahoo.com</a>> wrote:<br>
>><br>
>> Imagine your have some code like this<br>
>><br>
>> <a href="http://row.name" target="_blank">row.name</a> = encode(src.get('name'), 'xmlref')<br>
>> row.description = encode(src.get('description'), 'xmlref')<br>
>> row.enabled = encode(src.get('enabled'), 'xmlref')<br>
>> row.last_access = encode(src.get('last_access'), 'xmlref')<br>
>><br>
>> This looks a mumbo jumbo lines of code.<br>
>><br>
>> However by aligning them into columns, the pattern become immediately<br>
>> obvious.<br>
>><br>
>> <a href="http://row.name" target="_blank">row.name</a> = encode(src.get('name'), 'xmlref')<br>
>> row.description = encode(src.get('description'), 'xmlref')<br>
>> row.enabled = encode(src.get('enabled'), 'xmlref')<br>
>> row.last_access = encode(src.get('last_access'), 'xmlref')<br>
>><br>
>> It is clear that the code is applying similar operation on 4 items. It is<br>
>> a lot easier to tell which of the 4 elements and if you should include more<br>
>> or less into the list. It is a huge visualization improvement. PEP-8's<br>
>> suggestion on this is not a good one in my opinion.<br>
>><br>
>> The down side is it takes some effort to keep it neat and tidy. Of course<br>
>> I have editor macro that does that. I think every decent text editor should<br>
>> have some function to help people to align things.<br>
>><br>
>> Wai Yip<br>
>><br>
><br>
> In addition to the other problems with this, you have another problem:<br>
> you've now got a separate coding standard for variables than you do for<br>
> other code blocks. White space in Python is syntactically meaningful<br>
> *initially* not in the middle or the end. You've just made it meaningful<br>
> (and dependent upon the length of the longest variable name) *medially* and<br>
> that's not Python.<br>
><br>
> I actually find code that is column-aligned like that to be highly<br>
> distracting. I find regular, PEP-8 code to be much more highly readable. And<br>
> there was a time in the 90s when I was writing column aligned variables (for<br>
> a short while!). Readability at the level of white space is simply a matter<br>
> of getting used to (people that hate it enough usually don't end up using<br>
> Python, when given the choice).<br>
><br>
> d<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Baypiggies mailing list<br>
> <a href="mailto:Baypiggies@python.org">Baypiggies@python.org</a><br>
> To change your subscription options or unsubscribe:<br>
> <a href="http://mail.python.org/mailman/listinfo/baypiggies" target="_blank">http://mail.python.org/mailman/listinfo/baypiggies</a><br>
</div></div></blockquote></div><br>