<br><br><div class="gmail_quote">On Fri, Aug 10, 2012 at 2:52 PM, David Berthelot <span dir="ltr">&lt;<a href="mailto:david.berthelot@gmail.com" target="_blank">david.berthelot@gmail.com</a>&gt;</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&#39;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&#39;t read variables vertically. I read them like I do English, from left to right. Large gaps of white space between the &quot;words&quot; 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>
&lt;<a href="mailto:oubiwann@twistedmatrix.com">oubiwann@twistedmatrix.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On Fri, Aug 10, 2012 at 12:01 PM, Wai Yip Tung &lt;<a href="mailto:tungwaiyip@yahoo.com">tungwaiyip@yahoo.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Imagine your have some code like this<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://row.name" target="_blank">row.name</a> = encode(src.get(&#39;name&#39;), &#39;xmlref&#39;)<br>
&gt;&gt; row.description = encode(src.get(&#39;description&#39;), &#39;xmlref&#39;)<br>
&gt;&gt; row.enabled = encode(src.get(&#39;enabled&#39;), &#39;xmlref&#39;)<br>
&gt;&gt; row.last_access = encode(src.get(&#39;last_access&#39;), &#39;xmlref&#39;)<br>
&gt;&gt;<br>
&gt;&gt; This looks a mumbo jumbo lines of code.<br>
&gt;&gt;<br>
&gt;&gt; However by aligning them into columns, the pattern become immediately<br>
&gt;&gt; obvious.<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://row.name" target="_blank">row.name</a>        = encode(src.get(&#39;name&#39;),        &#39;xmlref&#39;)<br>
&gt;&gt; row.description = encode(src.get(&#39;description&#39;), &#39;xmlref&#39;)<br>
&gt;&gt; row.enabled     = encode(src.get(&#39;enabled&#39;),     &#39;xmlref&#39;)<br>
&gt;&gt; row.last_access = encode(src.get(&#39;last_access&#39;), &#39;xmlref&#39;)<br>
&gt;&gt;<br>
&gt;&gt; It is clear that the code is applying similar operation on 4 items. It is<br>
&gt;&gt; a lot easier to tell which of the 4 elements and if you should include more<br>
&gt;&gt; or less into the list. It is a huge visualization improvement. PEP-8&#39;s<br>
&gt;&gt; suggestion on this is not a good one in my opinion.<br>
&gt;&gt;<br>
&gt;&gt; The down side is it takes some effort to keep it neat and tidy. Of course<br>
&gt;&gt; I have editor macro that does that. I think every decent text editor should<br>
&gt;&gt; have some function to help people to align things.<br>
&gt;&gt;<br>
&gt;&gt; Wai Yip<br>
&gt;&gt;<br>
&gt;<br>
&gt; In addition to the other problems with this, you have another problem:<br>
&gt; you&#39;ve now got a separate coding standard for variables than you do for<br>
&gt; other code blocks. White space in Python is syntactically meaningful<br>
&gt; *initially* not in the middle or the end. You&#39;ve just made it meaningful<br>
&gt; (and dependent upon the length of the longest variable name) *medially* and<br>
&gt; that&#39;s not Python.<br>
&gt;<br>
&gt; I actually find code that is column-aligned like that to be highly<br>
&gt; distracting. I find regular, PEP-8 code to be much more highly readable. And<br>
&gt; there was a time in the 90s when I was writing column aligned variables (for<br>
&gt; a short while!). Readability at the level of white space is simply a matter<br>
&gt; of getting used to (people that hate it enough usually don&#39;t end up using<br>
&gt; Python, when given the choice).<br>
&gt;<br>
&gt; d<br>
&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; _______________________________________________<br>
&gt; Baypiggies mailing list<br>
&gt; <a href="mailto:Baypiggies@python.org">Baypiggies@python.org</a><br>
&gt; To change your subscription options or unsubscribe:<br>
&gt; <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>