<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
</head><body 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 =
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>
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>
</body></html>