Python strings and coding conventions

John Machin sjmachin at lexicon.net
Sun Jan 11 16:42:41 EST 2009


On Jan 12, 8:23 am, Mensanator <mensana... at aol.com> wrote:
> On Jan 11, 2:37 pm, John Machin <sjmac... at lexicon.net> wrote:
>
>
>
>
>
> > On Jan 12, 5:34 am, Mensanator <mensana... at aol.com> wrote:
>
> > > On Jan 11, 12:12 pm, Roy Smith <r... at panix.com> wrote:
>
> > > > In article
> > > > <5db6181f-d6f6-4bdc-88c8-e12ad228c... at r41g2000prr.googlegroups.com>,
>
> > > > Mensanator <mensana... at aol.com> wrote:
> > > > > > What are all those line continuation characters ('\') for? ?You are aware
> > > > > > that they are unnecessary here?
>
> > > > > Actually, I wasn't aware of that. A quick review shows
> > > > > why. In the old manuals, implicit line continuation
> > > > > was in a seperate chapter (2.1.6) from implicit (2.1.5)
> > > > > so if you didn't read past 2.1.5 you would have missed it.
>
> > > > My philosophy about line continuation is to assume lines can be continued
> > > > after just about any piece of punctuation. If I'm wrong, the computer will
> > > > tell me, and then I make the computer happy by adding a \. It's easier
> > > > than looking it up, and way easier than memorizing the details.
>
> > > I proably got mine from Visual Basic where there are no
> > > exceptions to explicit line continuation marks. A least
> > > adding them when not necessary doesn't cause a problem.
>
> > Fugly code is not a problem?
>
> Is that how you justify breaing "explicit is
> better than implicit"?

I don't '''justify breaing "explicit is better than implicit"''' and
wasn't attempting to do so.

The Zen is more than one saying. No one saying trumps all others. Some
may appear to be in conflict with others. One must consider the
combined effect. Other sayings relevant to your problem are:

Beautiful is better than ugly.
Simple is better than complex.
Readability counts.

HTH,
John



More information about the Python-list mailing list