<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Imagine that I'm trying to do research in the source code repository on how, when, and who modified "last_access." I see that a change was made to the the last line in your example, but after wasting some of my time investigating it, I discover that the only reason the line was touched was because a new member with a long name was added and that caused this line to be touched to change its white space.</div><div><br></div><div>Treating lines of code independently has important advantages when "diff"ing and tracing changes throw source code repositories.</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Wai Yip Tung &lt;<a href="mailto:tungwaiyip@yahoo.com">tungwaiyip@yahoo.com</a>&gt;<br><span style="font-weight:bold">Date: </span> Friday, August 10, 2012 12:01 PM<br><span style="font-weight:bold">To: </span> "<a href="mailto:baypiggies@python.org">baypiggies@python.org</a>" &lt;<a href="mailto:baypiggies@python.org">baypiggies@python.org</a>&gt;<br><span style="font-weight:bold">Subject: </span> Re: [Baypiggies] padding variable assignments, why is it bad?<br></div><div><br></div><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div bgcolor="#FFFFFF" text="#000000">
Imagine your have some code like this<br><br><span style="font-family: monospace;">row.name = encode(src.get('name'), 'xmlref')</span><br style="font-family: monospace;"><span style="font-family: monospace;">row.description = encode(src.get('description'), 'xmlref')</span><br style="font-family: 
monospace;"><span style="font-family: monospace;">row.enabled = encode(src.get('enabled'), 'xmlref')</span><br style="font-family: 
monospace;"><span style="font-family: monospace;">row.last_access = encode(src.get('last_access'), 'xmlref')</span><br style="font-family: 
monospace;"><br>
This looks a mumbo jumbo lines of code.<br><br>
However by aligning them into columns, the pattern become immediately obvious.<br><br><span style="font-family: monospace;">row.name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = encode(src.get('name'),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'xmlref')</span><br style="font-family: 
monospace;"><span style="font-family: monospace;">row.description = encode(src.get('description'), 'xmlref')</span><br style="font-family: 
monospace;"><span style="font-family: monospace;">row.enabled&nbsp;&nbsp;&nbsp;&nbsp; = encode(src.get('enabled'),&nbsp;&nbsp;&nbsp;&nbsp; 'xmlref')</span><br style="font-family: 
monospace;"><span style="font-family: monospace;">row.last_access = encode(src.get('last_access'), 'xmlref')</span><br style="font-family: 
monospace;"><br>
It is clear that the code is applying similar operation on 4 items. It is a lot easier to tell which of the 4 elements and if you should include more or less into the list. It is a huge visualization improvement. PEP-8's 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 I have editor macro that does that. I think every decent text editor should have some function to help people to align things.<br><br>
Wai Yip<br><br><br><br><br><blockquote style="border: 0px none;" cite="mid:CACcSE1xR_bdgXL_+vxecazqMVeXuoi9QAQMmGk3HaT8inSDn8A@mail.gmail.com" type="cite"><div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div style="display:table;width:100%;border-top:1px solid 
#EDEEF0;padding-top:5px"><div style="display:table-cell;vertical-align:middle;padding-right:6px;"><img photoaddress="alexmiroslav@gmail.com" photoname="Aleksandr Miroslav" src="cid:part1.06070707.07080708@yahoo.com" name="compose-unknown-contact.jpg" height="25px" width="25px"></div><div style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%"><a moz-do-not-send="true" href="mailto:alexmiroslav@gmail.com" style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Aleksandr Miroslav</a></div><div style="display:table-cell;white-space:nowrap;vertical-align:middle;"><font color="#9FA2A5"><span style="padding-left:6px">Friday, August 10, 2012 10:19 AM</span></font></div></div></div><div style="color:#888888;margin-left:24px;margin-right:24px;" __pbrmquotes="true" class="__pbConvBody"><div>(Reading this email requires a monospaced font.)<br><br>
I do this a lot in my code:<br><br>
foo = 1<br>
foo_bar = 2<br>
foo_bar_quux = 3<br><br>
but pep8, which I started using recently, considers this wrong, so I<br>
have to rewrite to the more common form:<br><br>
foo = 1<br>
foo_bar = 2<br>
foo_bar_quux = 3<br><br>
which I think sacrifices readability. Perhaps this is the n00b in me<br>
talking, but why is this considered bad?<br>
_______________________________________________<br>
Baypiggies mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:Baypiggies@python.org">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br><a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/baypiggies">http://mail.python.org/mailman/listinfo/baypiggies</a><br></div></div></blockquote></div></div></span></body></html>