Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73908 > unrolled thread

PEP8 and 4 spaces

Started byTobiah <tshepard@rcsreg.com>
First post2014-07-03 10:31 -0700
Last post2014-07-06 11:28 +1000
Articles 20 on this page of 47 — 22 participants

Back to article view | Back to comp.lang.python


Contents

  PEP8 and 4 spaces Tobiah <tshepard@rcsreg.com> - 2014-07-03 10:31 -0700
    Re: PEP8 and 4 spaces Roy Smith <roy@panix.com> - 2014-07-03 13:46 -0400
    Re: PEP8 and 4 spaces Grant Edwards <invalid@invalid.invalid> - 2014-07-03 19:02 +0000
      Re: PEP8 and 4 spaces Tim Chase <python.list@tim.thechases.com> - 2014-07-03 14:40 -0500
        Re: PEP8 and 4 spaces Tobiah <toby@tobiah.org> - 2014-07-03 14:23 -0700
          Re: PEP8 and 4 spaces Emile van Sebille <emile@fenx.com> - 2014-07-03 16:15 -0700
            Re: PEP8 and 4 spaces Grant Edwards <invalid@invalid.invalid> - 2014-07-04 14:28 +0000
              Re: PEP8 and 4 spaces Marko Rauhamaa <marko@pacujo.net> - 2014-07-04 17:54 +0300
                Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-05 00:58 +1000
                Re: PEP8 and 4 spaces Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-04 16:00 +0100
                  Re: PEP8 and 4 spaces Marko Rauhamaa <marko@pacujo.net> - 2014-07-04 18:12 +0300
                Re: PEP8 and 4 spaces Simon Ward <simon+python@bleah.co.uk> - 2014-07-04 19:52 +0100
                Re: PEP8 and 4 spaces Michael Torrie <torriem@gmail.com> - 2014-07-05 16:03 -0600
                Re: PEP8 and 4 spaces Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-05 23:50 +0100
              Re: PEP8 and 4 spaces Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-04 15:57 +0100
              Re: PEP8 and 4 spaces Emile van Sebille <emile@fenx.com> - 2014-07-04 08:57 -0700
              Re: PEP8 and 4 spaces Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-04 17:06 +0100
                Re: PEP8 and 4 spaces Maciej Dziardziel <fiedzia@gmail.com> - 2014-07-04 09:19 -0700
                  Re: PEP8 and 4 spaces Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-04 16:56 +0000
      Re: PEP8 and 4 spaces Tobiah <toby@tobiah.org> - 2014-07-03 14:28 -0700
    Re: PEP8 and 4 spaces Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-04 01:02 +0000
      Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-04 11:19 +1000
      Re: PEP8 and 4 spaces Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-07-04 18:35 +1200
        Re: PEP8 and 4 spaces wxjmfauth@gmail.com - 2014-07-04 01:47 -0700
          Re: PEP8 and 4 spaces Marko Rauhamaa <marko@pacujo.net> - 2014-07-04 12:21 +0300
            Re: PEP8 and 4 spaces wxjmfauth@gmail.com - 2014-07-04 03:10 -0700
        Re: PEP8 and 4 spaces Roy Smith <roy@panix.com> - 2014-07-04 09:47 -0400
          Re: PEP8 and 4 spaces Mihamina Rakotomandimby <mihamina.rakotomandimby@rktmb.org> - 2014-07-04 16:59 +0300
          Re: PEP8 and 4 spaces Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-04 16:12 +0100
          Re: PEP8 and 4 spaces George Silva <georger.silva@gmail.com> - 2014-07-04 12:14 -0300
            Re: PEP8 and 4 spaces Roy Smith <roy@panix.com> - 2014-07-04 12:31 -0400
              Re: PEP8 and 4 spaces George Silva <georger.silva@gmail.com> - 2014-07-04 13:37 -0300
          Re: PEP8 and 4 spaces Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-07-05 11:14 +1200
    Re: PEP8 and 4 spaces Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-04 19:00 -0700
      Re: PEP8 and 4 spaces Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-04 19:47 -0700
        Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-05 13:03 +1000
        Re: PEP8 and 4 spaces Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-07-05 20:57 +1200
          Re: PEP8 and 4 spaces alister <alister.nospam.ware@ntlworld.com> - 2014-07-05 09:48 +0000
        OT: Flashlights [was Re: PEP8 and 4 spaces] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-05 10:15 +0000
          Re: OT: Flashlights [was Re: PEP8 and 4 spaces] Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 08:41 -0700
            Re: OT: Flashlights [was Re: PEP8 and 4 spaces] Chris Angelico <rosuav@gmail.com> - 2014-07-07 08:25 +1000
      Re: PEP8 and 4 spaces Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-05 12:57 -0600
        Re: PEP8 and 4 spaces Roy Smith <roy@panix.com> - 2014-07-05 15:07 -0400
      Re: PEP8 and 4 spaces Robert Kern <robert.kern@gmail.com> - 2014-07-05 21:07 +0100
      Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-06 09:27 +1000
        Re: PEP8 and 4 spaces Dan Sommers <dan@tombstonezero.net> - 2014-07-06 01:18 +0000
          Re: PEP8 and 4 spaces Chris Angelico <rosuav@gmail.com> - 2014-07-06 11:28 +1000

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#73930

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-07-04 01:02 +0000
Message-ID<53b5fd2f$0$29985$c3e8da3$5496439d@news.astraweb.com>
In reply to#73908
On Thu, 03 Jul 2014 10:31:04 -0700, Tobiah wrote:

> Coworker takes PEP8 as gospel and uses 4 spaces to indent.  I prefer
> tabs.  Boss want's us to unify.  

Point out to your boss, and your co-worker, that PEP 8 *explicitly* 
states that it is not compulsory except for the standard library, and 
that for third-party and private code, local conventions over-rule PEP 8. 
In other words, if your co-worker is the only one who uses spaces when 
everyone else uses tabs, **he is violating PEP 8**.


> The sole thing you get with spaces as
> far as I can tell, is that someone loading the code into Notepad will
> still see a 4 character indent.  That may be true, but that same person
> is going to have a difficult time editing the code.

Advantages of spaces:
- It's a convention that many people follow.

Disadvantages of tabs:
- Many standard Unix/Linux/POSIX tools have a hard time dealing with tabs.

I call such tools *broken*, and there is a vicious circle going on: 
programmers use the fact that these tools don't support tabs to justify 
the use of spaces, and the majority consensus that you should use spaces 
as justification for not fixing the tools.

As I understand it, Unix coders tend to prefer spaces, and Windows users 
tend to be more comfortable with tabs. This isn't a hard-and-fast rule, 
you'll find plenty of exceptions, but it seems to me that Unix tools are 
unforgiving of tabs while Windows IDEs tend to default to tabs. I'm not a 
Windows person myself, any Windows guys like to comment?



> Anyway, I gave up the 80 char line length long ago, having little
> feeling for some dolt on a Weiss terminal that for some reason needs to
> edit my code.

How do you feel about some dolt who aligns two or three editor windows 
side-by-side so they can compare code? :-)

Being able to set code side-by-side, say in a horizontal diff, or two 
editors next to each other, is a much more important reason to support a 
79+1 maximum line width than Weiss terminals.




-- 
Steven

[toc] | [prev] | [next] | [standalone]


#73931

FromChris Angelico <rosuav@gmail.com>
Date2014-07-04 11:19 +1000
Message-ID<mailman.11477.1404436792.18130.python-list@python.org>
In reply to#73930
On Fri, Jul 4, 2014 at 11:02 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> As I understand it, Unix coders tend to prefer spaces, and Windows users
> tend to be more comfortable with tabs. This isn't a hard-and-fast rule,
> you'll find plenty of exceptions, but it seems to me that Unix tools are
> unforgiving of tabs while Windows IDEs tend to default to tabs. I'm not a
> Windows person myself, any Windows guys like to comment?

I've worked both platforms extensively, and it's not really as
clear-cut as that. Most Unix tools are perfectly happy with tabs, *as
long as you let them mean eight spaces*; a lot, but not all, have an
option to configure tab width, but you have to specify it to every
program separately.

On the flip side, tab configurability can be a huge feature. There've
been times when I've looked at something with the tab width set to
something insane like 7 or 9 (no, folks, I did not say "7 of 9") to
highlight a display bug or other oddity. Not often, but it has its
uses - and you can't do that if there are actual spaces involved.

Anyone who's using a broken editor should fix it or switch editors.
That's easy. And if you really love your editor, sometimes you can fix
the issue outside it - maybe in a source control hook.

ChrisA

[toc] | [prev] | [next] | [standalone]


#73938

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2014-07-04 18:35 +1200
Message-ID<c1n08qFhvjaU1@mid.individual.net>
In reply to#73930
Steven D'Aprano wrote:
> Disadvantages of tabs:
> - Many standard Unix/Linux/POSIX tools have a hard time dealing with tabs.
> 
> I call such tools *broken*,

They're not broken, they're just using a different set of
conventions. Unix traditionally uses tab characters as a
form of space compression. The meaning of a tab is fixed,
and configurable indentation is done by inserting a suitable
combination of tabs and spaces.

As long as *all* your tools follow that convention, everything
is fine. The problems arise when you mix in tools that use
different conventions.

The truly broken tools IMO are things like mail handlers that
shrink away in terror when they see a tab and remove it
altogether. There's no excuse for that, as far as I can see.

-- 
Greg

[toc] | [prev] | [next] | [standalone]


#73941

Fromwxjmfauth@gmail.com
Date2014-07-04 01:47 -0700
Message-ID<d8e1f8b5-6b70-4141-b90e-59c9f55c9fd7@googlegroups.com>
In reply to#73938
Le vendredi 4 juillet 2014 08:35:04 UTC+2, Gregory Ewing a écrit :
> 
> The truly broken tools IMO are things like mail handlers that
> 
> shrink away in terror when they see a tab and remove it
> 
> altogether. There's no excuse for that, as far as I can see.
> 
> 

Yes, and you can extend this to the editors, which
deliberately missusing the tabulation rules by inserting
something else, eg. spaces (U+0020, 'SPACE').



[toc] | [prev] | [next] | [standalone]


#73942

FromMarko Rauhamaa <marko@pacujo.net>
Date2014-07-04 12:21 +0300
Message-ID<877g3tiimr.fsf@elektro.pacujo.net>
In reply to#73941
wxjmfauth@gmail.com:

> Le vendredi 4 juillet 2014 08:35:04 UTC+2, Gregory Ewing a écrit :
>> The truly broken tools IMO are things like mail handlers that shrink
>> away in terror when they see a tab and remove it altogether. There's
>> no excuse for that, as far as I can see.
>
> Yes, and you can extend this to the editors, which deliberately
> missusing the tabulation rules by inserting something else, eg. spaces
> (U+0020, 'SPACE').

A worthy flame war with top-class trolling mixed in. How could I stay
out?

My esteemed editor never "misuses the tabulation rules" as I have
instructed it to never insert TAB characters in files:

   (custom-set-variables
    '(indent-tabs-mode nil))



Marko

[toc] | [prev] | [next] | [standalone]


#73944

Fromwxjmfauth@gmail.com
Date2014-07-04 03:10 -0700
Message-ID<0519d709-df75-4662-a653-a80a7643e3a0@googlegroups.com>
In reply to#73942
Le vendredi 4 juillet 2014 11:21:48 UTC+2, Marko Rauhamaa a écrit :
> wxjmfauth@gmail.com:
> 
> 
> 
> > Le vendredi 4 juillet 2014 08:35:04 UTC+2, Gregory Ewing a écrit :
> 
> >> The truly broken tools IMO are things like mail handlers that shrink
> 
> >> away in terror when they see a tab and remove it altogether. There's
> 
> >> no excuse for that, as far as I can see.
> 
> >
> 
> > Yes, and you can extend this to the editors, which deliberately
> 
> > missusing the tabulation rules by inserting something else, eg. spaces
> 
> > (U+0020, 'SPACE').
> 
> 
> 
> A worthy flame war with top-class trolling mixed in. How could I stay
> 
> out?
> 
> 
> 
> My esteemed editor never "misuses the tabulation rules" as I have
> 
> instructed it to never insert TAB characters in files:
> 
> 
> 
>    (custom-set-variables
> 
>     '(indent-tabs-mode nil))
> 
> 
> 
> 
> 
> 
> 
> Marko

--------

Yes. And what?

If I give you a correctly formated doc with
tabulations and you do not wish to use it,
that you your problem.

[toc] | [prev] | [next] | [standalone]


#73955

FromRoy Smith <roy@panix.com>
Date2014-07-04 09:47 -0400
Message-ID<roy-70793F.09473104072014@news.panix.com>
In reply to#73938
In article <c1n08qFhvjaU1@mid.individual.net>,
 Gregory Ewing <greg.ewing@canterbury.ac.nz> wrote:

> As long as *all* your tools follow that convention, everything
> is fine. The problems arise when you mix in tools that use
> different conventions.

The problem is, tools always get mixed.  I use emacs.  The next guy uses 
vi.  Somebody else uses Sublime.  The list goes on and on.  You will 
never control what tools other people use.

[toc] | [prev] | [next] | [standalone]


#73957

FromMihamina Rakotomandimby <mihamina.rakotomandimby@rktmb.org>
Date2014-07-04 16:59 +0300
Message-ID<mailman.11492.1404484181.18130.python-list@python.org>
In reply to#73955
On 07/04/2014 04:47 PM, Roy Smith wrote:
>> As long as*all*  your tools follow that convention, everything
>> >is fine. The problems arise when you mix in tools that use
>> >different conventions.
> The problem is, tools always get mixed.  I use emacs.  The next guy uses
> vi.  Somebody else uses Sublime.  The list goes on and on.  You will
> never control what tools other people use.

This may be the subject of a PEP: "What tool will you use" :-)

[toc] | [prev] | [next] | [standalone]


#73963

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-07-04 16:12 +0100
Message-ID<mailman.11496.1404486762.18130.python-list@python.org>
In reply to#73955
On 04/07/2014 14:59, Mihamina Rakotomandimby wrote:
> On 07/04/2014 04:47 PM, Roy Smith wrote:
>>> As long as*all*  your tools follow that convention, everything
>>> >is fine. The problems arise when you mix in tools that use
>>> >different conventions.
>> The problem is, tools always get mixed.  I use emacs.  The next guy uses
>> vi.  Somebody else uses Sublime.  The list goes on and on.  You will
>> never control what tools other people use.
>
> This may be the subject of a PEP: "What tool will you use" :-)

I'll nominate our resident unicode expert to write the PEP as he's also 
an expert on tools.  Consider his superb use of the greatly loved google 
groups for example.  Sadly I understand that he has yet to master the 
intricacies of pip, but I'm sure that'll come with practice, or has he 
given up?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

[toc] | [prev] | [next] | [standalone]


#73964

FromGeorge Silva <georger.silva@gmail.com>
Date2014-07-04 12:14 -0300
Message-ID<mailman.11497.1404486912.18130.python-list@python.org>
In reply to#73955

[Multipart message — attachments visible in raw view] — view raw

Isn't this an old discussion? Just configure your editor properly. In my
team we all use spaces, but I'll be damned if I need to type 12 spaces in a
row. I'll just configured Sublime to insert spaces instead of tabs. Problem
solved.


On Fri, Jul 4, 2014 at 12:12 PM, Mark Lawrence <breamoreboy@yahoo.co.uk>
wrote:

> On 04/07/2014 14:59, Mihamina Rakotomandimby wrote:
>
>> On 07/04/2014 04:47 PM, Roy Smith wrote:
>>
>>> As long as*all*  your tools follow that convention, everything
>>>> >is fine. The problems arise when you mix in tools that use
>>>> >different conventions.
>>>>
>>> The problem is, tools always get mixed.  I use emacs.  The next guy uses
>>> vi.  Somebody else uses Sublime.  The list goes on and on.  You will
>>> never control what tools other people use.
>>>
>>
>> This may be the subject of a PEP: "What tool will you use" :-)
>>
>
> I'll nominate our resident unicode expert to write the PEP as he's also an
> expert on tools.  Consider his superb use of the greatly loved google
> groups for example.  Sadly I understand that he has yet to master the
> intricacies of pip, but I'm sure that'll come with practice, or has he
> given up?
>
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask what
> you can do for our language.
>
> Mark Lawrence
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
George R. C. Silva
SIGMA Consultoria
----------------------------
http://www.consultoriasigma.com.br/

[toc] | [prev] | [next] | [standalone]


#73969

FromRoy Smith <roy@panix.com>
Date2014-07-04 12:31 -0400
Message-ID<roy-1781A1.12312304072014@news.panix.com>
In reply to#73964
In article <mailman.11497.1404486912.18130.python-list@python.org>,
 George Silva <georger.silva@gmail.com> wrote:

> Isn't this an old discussion? Just configure your editor properly. In my
> team we all use spaces, but I'll be damned if I need to type 12 spaces in a
> row. I'll just configured Sublime to insert spaces instead of tabs. Problem
> solved.

On emacs, I used auto-indent mode.  I hit tab, and it automatically 
inserts the correct number of spaces (where "correct" is 
language-specific; for Python, it uses the pep-8 rules).  It also does 
syntax highlighting, parenthesis and quote matching, keyword 
recognition, etc.

I assume any sane editor has similar functionality.  I see my coworkers 
using vim, sublime, eclipse, and X-code.  They all appear to do these 
things, and I would thus classify any of them as sane editors.  I'm sure 
there are others.  If the tool you're (in the generic sense of "you") 
using doesn't have this type of basic language support, you should 
reconsider your choice of tool.

[toc] | [prev] | [next] | [standalone]


#73972

FromGeorge Silva <georger.silva@gmail.com>
Date2014-07-04 13:37 -0300
Message-ID<mailman.11505.1404493740.18130.python-list@python.org>
In reply to#73969

[Multipart message — attachments visible in raw view] — view raw

> I assume any sane editor has similar functionality.  I see my coworkers
> using vim, sublime, eclipse, and X-code.  They all appear to do these
> things, and I would thus classify any of them as sane editors.  I'm sure
> there are others.  If the tool you're (in the generic sense of "you")
> using doesn't have this type of basic language support, you should
> reconsider your choice of tool


Could not agree more :D

[toc] | [prev] | [next] | [standalone]


#73980

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2014-07-05 11:14 +1200
Message-ID<c1oqr6Ftsj1U1@mid.individual.net>
In reply to#73955
Roy Smith wrote:
> The problem is, tools always get mixed.  I use emacs.  The next guy uses 
> vi.  Somebody else uses Sublime.  The list goes on and on.  You will 
> never control what tools other people use.

Yes, but my point is that none of the tools are "broken",
they're just incompatible.

-- 
Greg

[toc] | [prev] | [next] | [standalone]


#73984

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2014-07-04 19:00 -0700
Message-ID<22220d8c-af69-434b-9361-520e396e615e@googlegroups.com>
In reply to#73908
On Thursday, July 3, 2014 12:31:04 PM UTC-5, Tobiah wrote:
> Coworker takes PEP8 as gospel and uses 4 spaces <snip>

I'm saddened that every one of these little "tabs versus
spaces" arguments revolve more around selfishness and less
around an understanding of what a "tabs" and "spaces"
actually *are*, because, how can you solve a problem when
you're unable to understand the fundamental dicotomoy of
this relationship between "tabs" and "spaces"?

I believe the whole issue can be boiled down into: "Use the
correct tool for the job". And there in lies the rub, before
we can make the *choice*, we must comprehend the
*differences*.

============================================================
 What is a "space"
============================================================

Duh!

============================================================
 What is a "tab"
============================================================

We all know "tabs" are used to present text in tabular form
(aka: tables), however, tabs are much more than merely a
"concatenation-of-N-spaces". Not only do tabs allow a user
to control alignments via the mechanical process of pressing
the "tab key", tabs also allow a more powerful and precise
"hook" into the underlying mechinism of vertical alignments
via "rules" defined by the user.

    AND THIS LAST POINT IS THE TRUE POWER OF "TABS"!

Yes, "tabs" are an extrapolation of "spaces", but they are
also more powerful than a "space" could ever be. If we
imagine "spaces" and "backspaces" to be like *addtion* and
*subtraction*, we can extrapolate that "tabs" and um, well,
"backtabs" to be like *multiplication* and *division* -- not
in a quantitve sense of course, but in an "exponentially
more powerful" sense. 

============================================================
 Tabs or spaces?
============================================================

And now we must answer the burning question. 

Not that my habits really matter but I myself use only
spaces and NEVER tabs, and i only use four spaces, never
more, never less,,, and i don't use spaces because i prefer
spaces over tabs, no, i use spaces because spaces are going
to render the same in all editors.

Strangly, I rather fancy the idea of using tabs in code,,,
which allow each viewer to view the code in his or her level
of indention,,, however, i cannot justify using a tab as a
replacement for a space. Tabs should be used for "tabular"
data (aka: speadsheets), and since code is NOT tabular data,
we would be wise to use the space char for indention.

    from brain import logic

[toc] | [prev] | [next] | [standalone]


#73985

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2014-07-04 19:47 -0700
Message-ID<8c3844c1-9008-474f-9db5-49d6fad7c0bb@googlegroups.com>
In reply to#73984
[A continuation of my last reply...]

Here is a recent situation that occurred to me that showcases
the tendency of humans to carelessly bind illogical terms to
common objects, thereby creating a inverse esoteric of
ubiquitous illogic, in this case, the term: "flash-light".

============================================================
 Illuminating the illogical:
============================================================

A friend and myself where working outside and as the light
began to fade he realized we needed a light source, so he
called out: 

    "SOMEBODY GET ME A FLASH-LIGHT!"
    
As i was heading in to grab a "flashlight" i realized the
bombastic insanity of such a term. Why is a handheld light
called a flashlight? It does not flash, in fact, its main
purpose is to provide a consistent light source that is easy
to carry, whereas flashing would be quite annoying!

*And just then that mischievous little inner voice started
whispering in my ear, giving me "ideas", Muahahah!*

So i returned to my friend who was already quite annoyed
with his repair project, and started "flashing" the light on
and off. He quickly turned around and demanded: "What the
hell are you doing?", to which i replied, "You asked for a
flash-light, yes?"

Of course everyone knows that a flash light does not
"flash", so why do we continue to propagate such foolish
terms? Well, for the same reason language designers keep
giving us illogical terms like "function" and "class", but i
digress.

The point is we go around the world falsely believing we have
a strong grasp of the simple things, when in fact, a whole
world of illogic infects our understanding of even the most
basic aspects of our lives.

Of course, I'm anxiously await my friend to ask for a "drop
light" -- oh boy, that will be fun! >:^)

[toc] | [prev] | [next] | [standalone]


#73990

FromChris Angelico <rosuav@gmail.com>
Date2014-07-05 13:03 +1000
Message-ID<mailman.11518.1404549110.18130.python-list@python.org>
In reply to#73985
On Sat, Jul 5, 2014 at 12:47 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> Of course, I'm anxiously await my friend to ask for a "drop
> light" -- oh boy, that will be fun! >:^)

Just wait till you get into theatre, and people start asking for
parcans, domes, bubbles, gobos, gels, and workers. If you can't learn
a little technical terminology for the field you're in, you're in the
wrong universe.

ChrisA

[toc] | [prev] | [next] | [standalone]


#73991

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2014-07-05 20:57 +1200
Message-ID<c1psvdF5otdU1@mid.individual.net>
In reply to#73985
Rick Johnson wrote:
> Why is a handheld light
> called a flashlight? It does not flash,

According to Wikipedia, originally it did:

"Early flashlights ran on zinc–carbon batteries, which could not provide a 
steady electric current and required periodic 'rest' to continue functioning. 
Because these early flashlights also used energy-inefficient carbon-filament 
bulbs, "resting" occurred at short intervals. Consequently, they could be used 
only in brief flashes, hence the common American name flashlight."

Of course, in sane parts of the world, we
call them torches. :-)

-- 
Greg

[toc] | [prev] | [next] | [standalone]


#73992

Fromalister <alister.nospam.ware@ntlworld.com>
Date2014-07-05 09:48 +0000
Message-ID<bSPtv.139153$f_5.132063@fx08.am4>
In reply to#73991
On Sat, 05 Jul 2014 20:57:14 +1200, Gregory Ewing wrote:

> Rick Johnson wrote:
>> Why is a handheld light called a flashlight? It does not flash,
> 
> According to Wikipedia, originally it did:
> 
> "Early flashlights ran on zinc–carbon batteries, which could not provide
> a steady electric current and required periodic 'rest' to continue
> functioning. Because these early flashlights also used
> energy-inefficient carbon-filament bulbs, "resting" occurred at short
> intervals. Consequently, they could be used only in brief flashes, hence
> the common American name flashlight."
> 
> Of course, in sane parts of the world, we call them torches. :-)

+1
don't just use the correct tool fro the job use the correct name for the 
tool ;-)

-- 
If your bread is stale, make toast.

[toc] | [prev] | [next] | [standalone]


#73993 — OT: Flashlights [was Re: PEP8 and 4 spaces]

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-07-05 10:15 +0000
SubjectOT: Flashlights [was Re: PEP8 and 4 spaces]
Message-ID<53b7d044$0$29985$c3e8da3$5496439d@news.astraweb.com>
In reply to#73985
On Fri, 04 Jul 2014 19:47:45 -0700, Rick Johnson wrote:

> [A continuation of my last reply...]
> 
> Here is a recent situation that occurred to me that showcases the
> tendency of humans to carelessly bind illogical terms to common objects,

I think you mean the tendency of certain people to go off half-cocked and 
mistake their own ignorance for knowledge.

"Since I personally don't know why flashlights are called that name, it 
clearly MUST BE that there is no reason for that name!!!"

(By the way, outside of the USA, flashlights in the rest of the English-
speaking world are usually called "torches", so called because, like the 
old-fashioned burning torch, they provide light.)


> thereby creating a inverse esoteric of ubiquitous illogic, in this case,
> the term: "flash-light".

A few minutes googling would have given you the answer: flashlights are 
called flashlights because originally you could only flash them on and 
off. Due to the high power requirements and the low battery capacities at 
the time, leaving the torch switched on would burn out the filament, 
exhaust the battery, or both.

The Oxford Dictionary also points out that "flashlight" is a term used 
for signalling and warning lights, such as in lighthouses. It doesn't say 
whether the signalling use inspired, or was inspired by, the hand-held 
flashlight. I expect that, since electric lighthouses are more than two 
decades older than flashlights, that usage came first.

Both the flashlight and the flash bulb were first patented in 1899, and 
it is possible that the name of one was influenced by the name of the 
other. Flash bulbs used an electrically-ignited filament of magnesium to 
provide a single, extremely bright, flash of light. They replaced the 
older system of a small trough of flash powder (a mixture of magnesium 
and potassium chlorate) ignited in the air.

So far from being an illogical term, the name "flashlight" actually gives 
you a glimpse into the historical background of the invention.


> Of course everyone knows that a flash light does not "flash", 

"Everybody" is wrong. I have torches (flashlights) with a "flash" 
function, where they flash on and off. I've also owned torches where they 
had a switch to turn them on and give a steady, hands-free light, and a 
second button that only generated light while it was held down.


> so why do we continue to propagate such foolish terms? 

Not a foolish term, merely a sign that technology marches on.


> Well, for the same reason
> language designers keep giving us illogical terms like "function" and
> "class", but i digress.

Oh my, I can hardly wait to hear this. It ought to be good.


> The point is we go around the world falsely believing we have a strong
> grasp of the simple things

Speak for yourself. Oh, I see you are!



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#74023 — Re: OT: Flashlights [was Re: PEP8 and 4 spaces]

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2014-07-06 08:41 -0700
SubjectRe: OT: Flashlights [was Re: PEP8 and 4 spaces]
Message-ID<dfbeebcf-cf77-4798-adc9-a9ce722a1845@googlegroups.com>
In reply to#73993
On Saturday, July 5, 2014 5:15:32 AM UTC-5, Steven D'Aprano wrote:
> (By the way, outside of the USA, flashlights in the rest
> of the English- speaking world are usually called
> "torches", so called because, like the old-fashioned
> burning torch, they provide light.)

Well Steven all i can hope is that one day you and i will be
working on a project together, and you will ask me for a
"touch", and when i return with a petrol soaked rag burning
on the end of twig and proceed to light your hair on fire,
hopefully at that moment, you will THEN gain a healthy respect
for logical naming conventions! 

You see, just as a "proper" programming language utilize the
punishments of Exceptions for illogical behaviors, life
utilizes the power of pain for even greater effect.

Ah, what's that old adage about doing the same things over
and over but expecting different results? Oh well, maybe
someone can chime in...

    SHALL WE "RINSE AND REPEAT" MR.D'APRANO?

> A few minutes googling would have given you the answer:
> flashlights are called flashlights because originally you
> could only flash them on and off. Due to the high power
> requirements and the low battery capacities at the time,
> leaving the torch switched on would burn out the filament,
> exhaust the battery, or both.

So what you're telling me is that in the early days of the
"portable light" the function of the device was so terrible
that the best all one could hope for was limited
intermittent functionality with a great chance of destroying
the device simply in the course of its normal use?

Wow, and people actually paid money for these devices?

Sounds like window 95 all over again!

<SNIP HISTORY LESSON> *yawn*

> So far from being an illogical term, the name "flashlight"
> actually gives you a glimpse into the historical
> background of the invention.

Yes, because when my power goes out, and i need to get to
the electrical panel during a torrential rainstorm, at 2am
in the morning, after a long day working in the company of
idiots, and then coming home to a nagging "significant
other", and then my dog dies... whist i tromp through the
mud and the muck, at least my mind will be at peace knowing
the historical significance of an illogical naming
convention coined for a device that was so impractical as to
render itself completely useless...

    THANKS "FLASHLIGHT" @_@!

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | comp.lang.python


csiph-web