[Novalug] Learning Python ???

greg pryzby greg@pryzby.org
Sat Mar 23 07:15:26 EDT 2013


Let's refute each point below, shall we?

On Mar 22, 2013 10:40 PM, "James Ewing" <jecottrell3@comcast.net> wrote:
>
> This is EXACTLY what I am talking about NOT doing! This Feature is EVIL.

No it is not.

> While your Editor might respect that...will your Printer? What if you
share it with other people? Will their editors respect it? What about other
formatters and displays?

Who prints code? Once you print it is no longer searchable.

Also the tab character is still there so it will appear as what each person
has their tabstop set to. You use 8, I use 3, Rob uses 4 and Jay uses 1. We
all see it as we like.

Repeat the space is a <tab> and each app translates as told by the user.
Default is 8.

> More to the point, Python itself counts a tab as eight spaces. Game Over.

Not that I don't believe you but please point to doc that says that and
what happens to Python if it isn't 8. If it was a hard fast rule Python
would require tabs only for whitespace and a tab would have to be 8.

But as I said Python will only know there is a tab in the code and no idea
what my application viewer does to display a tab. A tab is ASCII 9 and that
is how it is encoded.

> Let me state this once again: Tabs were Ordained (by DEC I am guessing)
sometime in the 1960s as EIGHT SPACES.

Do you know why? If not, look it up and cite it. Yes I do know and no I
won't tell you.

:p

> Consider this Chiseled In Stone, a Fundamental Constant of the Universe,
like Pi, E, the Golden Ratio, or Planck's Constant.

No it is not. Tab is ASCII 9 and your application decides how to display
it. In vi it is 3 for me, more and cat display it as 8. Each app interprets
the ASCII value 9 as they are told.

> Now if you want your editor to insert a user-defined number of spaces
when you hit the Tab Key, Cool.

A tab is NOT 8 spaces. It is ASCII 9 and not not 8 ASCII 32 (space)

http://www.ascii.cl

> JIM
>
> P.S. Using a Indent Width of anything other than a power of two is also a
Bad Idea. Why? Because it doesn't line up with Tabs!
>
> ----- Original Message -----
> From: "greg pryzby" <greg@pryzby.org>
> To: "James Ewing" <jecottrell3@comcast.net>
> Cc: "Rob Sanders" <rarob@travelinglightfarm.net>, "Novalug" <
novalug@calypso.tux.org>
> Sent: Friday, March 22, 2013 9:13:43 PM
> Subject: Re: [Novalug] Learning Python ???
>
>
> :set ts=3
>
>
>
>
> On Fri, Mar 22, 2013 at 8:59 PM, James Ewing < jecottrell3@comcast.net >
wrote:
>
>
> Whitespace is definitely important, but Python seems to work Just Fine
with Tabs.
>
> Tab Stops are set every Eight Spaces by Divine Fiat. If you are having a
problem with running out of space, your Functions are Too Long.
>
> However, once in awhile I will break my own rule, nesting several loops,
adding 4 extra spaces to alternate loops, and things still work.
>
> Whatever you do, DO NOT try and display and/or print Real Tabs with
anything BUT 8 Spaces...
> either use them As They Were Intended, or Not At All.
>
>
> JIM
>
> ----- Original Message -----
>
> From: "Rob Sanders" < rarob@travelinglightfarm.net >
> To: "Novalug" < novalug@calypso.tux.org >
> Sent: Friday, March 22, 2013 7:26:38 PM
> Subject: Re: [Novalug] Learning Python ???
>
> Greg,
> ....and also mention the *single* biggest hurdle that I've had with
python. Scoping is indicated by indentation, so whitespace is *important*.
Pick an editor of choice, disable the use of tab characters (or have them
explicitly replaced by spaces - this is what I did with nedit), and decide
upon a CONSISTENT indentation style (I tend to use 4 spaces).
>
> -Rob
>
>
>
> _______________________________________________
> Novalug mailing list
> Novalug@calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
>
>
>
> --
>
> greg pryzby greg at pryzby dot org
> http://www.linkedin.com/in/gpryzby
>
> TWTR: gpryzby
> WEB: http://www.MakeRoomForArt.com/
> BLOG: http://www.ryqyrmedia.com/ (son's)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20130323/7399bf8e/attachment.htm>


More information about the Novalug mailing list