[Tutor] Python Best Practice/Style Guide question

Scott Sandeman-Allen scott at rscorp.ab.ca
Tue Apr 29 20:28:26 CEST 2008


On 4/29/08, Marc Tompkins (marc.tompkins at gmail.com) wrote:

>On Tue, Apr 29, 2008 at 9:22 AM, Scott SA <pydev at rscorp.ab.ca> wrote:
>
>>    - More than one space around an assignment (or other) operator to
>>      align it with another.
>>
> When the guy who invented the language
>tells me I'm doing it wrong, who am I to argue? 
> And after a while, I started to internalize the rule, so now every time I see
> code that's lined up with extra spaces it bugs me.

With the mantra of making things obvious and clear, this extra visual density is contrary. In 

>He doesn't really give a rationale, and I haven't seen one elsewhere.  I
>think the real answer to your question is "Guido doesn't like it, that's
>why."

I have tremendous respect for Guido and many others. However, Guido may not like Sushi or John Prine (folk musician). That's okay, I didn't like them at first either.

>Actually, looking at your original message, there's one very good
>rationale:  in my email client, the text of your message is in a
>proportional font, so your assignments don't line up anyway.  All those
>extra spaces, and it still just looks ragged.  Padding only works in
>monospace - of course, we all use monospace fonts in our respective editors,
>but the rest of the world uses proportional.

Agreed, but as you point out the working tools are monospaced. 

I have to say that I find no other point in the document previouslly linked that I (a literal gnat's turd in the python realm of influence) find difficult to accept.

I guess I'll just have to discuss this with my pharmacist and see if I can find a something more appropriate. It's really the only solution to an inexplicable tradition: "I'll have some of what he/she's having". ;-)

Thanks for the quick reply and personal insight.

Scott


More information about the Tutor mailing list